SDKs and tools
Anything that lets you set an OpenAI or Anthropic base URL works.
hackrouter speaks the OpenAI and Anthropic APIs, so you keep your SDK and change two settings: the base URL and the key.
| Client | Base URL | Key |
|---|---|---|
| OpenAI SDKs, LangChain, LlamaIndex, Vercel AI SDK | https://api.hackrouter.ai/v1 | HACKROUTER_KEY as the API key |
| Anthropic SDKs | https://api.hackrouter.ai | HACKROUTER_KEY as the API key |
| Editors and agents with a custom OpenAI endpoint (Cursor, Cline, Zed and others) | https://api.hackrouter.ai/v1 | HACKROUTER_KEY |
The key can travel as Authorization: Bearer hr-... or as x-api-key: hr-.... Both are accepted on every endpoint.
Which API to call
Every model lists the APIs it can be called through in endpoints on GET /v1/models. Chat Completions and Messages are interchangeable: when a model does not speak your client's format, the request and the answer are translated.
A few features cannot be translated and are refused before anything is charged: n above 1, logit_bias and logprobs from Chat to Messages, and structured outputs or built-in tools from Messages to Chat. Use the model's own format for those.