All use cases
One endpoint
One API in front of every provider dialect
OpenAI /chat/completions, Anthropic /messages, and a Responses API — same key, same catalog.
What this is for
Apps accumulate one client per vendor. Failover and logging then live in your code instead of the gateway.
Steps, then copy
- 1.Use https://anyrouter.dev/api/v1 for OpenAI-compatible calls.
- 2.Use https://anyrouter.dev/api for Anthropic /messages (Claude Code, Agent SDK).
- 3.Start with anyrouter/auto so the first request is not a single upstream.
curl · anyrouter/auto
bash
curl https://anyrouter.dev/api/v1/chat/completions \
-H "Authorization: Bearer $ANYROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anyrouter/auto",
"messages": [{ "role": "user", "content": "Say hello in one sentence." }]
}'Ready to try it
The guide has the full walkthrough. Sign up if you still need a key.
Next playbooks
- Keep the OpenAI SDK, change two fieldsOverride baseURL and apiKey. Model ids are owner/model strings across 271+ models.
- One AI SDK provider for the whole catalogInstall @anyr/ai-sdk-provider. generateText and streamText take a catalog id — including anyrouter/free.
- Run every coding agent through one URLClaude Code, Codex, OpenCode, Cursor, and other OpenAI-compatible tools share 271+ models, one balance, and one request log.