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.
01
The problem
What this is for
Apps accumulate one client per vendor. Failover and logging then live in your code instead of the gateway.
02
What to do
Three 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.
Related
Next playbooks
Keep the OpenAI SDK, change two fields
Override baseURL and apiKey. Model ids are owner/model strings across 209+ models.
OpenOne AI SDK provider for the whole catalog
Install @anyr/ai-sdk-provider. generateText and streamText take a catalog id — including anyrouter/free.
OpenRun every coding agent through one URL
Claude Code, Codex, OpenCode, Cursor, and other OpenAI-compatible tools share 209+ models, one balance, and one request log.
Open