One endpoint for every model.
Every model, one URL — resilient by default.
AnyRouter is an OpenAI- and Anthropic-compatible LLM gateway on Cloudflare. One API key reaches hundreds of models, with automatic failover, free models, bring-your-own-key at $0 markup, and a shared key Pool.
One key reaches every major provider
Capabilities
Everything the gateway does
Architecture
How the gateway routes a request
One endpoint fans out to whichever provider serves the model, with every call logged and cached alongside it.
For coding agents
Built for coding agents
Switch the model behind Claude Code, Codex, or Cursor without editing a single config file — from the command line or straight from your code.
A gateway that improves itself
AnyRouter is an AI-first, self-improving development project: built and maintained by AI coding agents running on the very gateway they ship. New providers, fixes, and features land continuously as those agents test, deploy, and refine the platform — so the catalog stays current and the routing keeps getting better without waiting on a release cycle.
Principles
What we stand for
How it works
From request to answer
Comparison
AnyRouter or the provider directly
| Calling providers directly | Through AnyRouter | |
|---|---|---|
| Integration | One SDK, one key, and one error format per provider. | One base URL, one key, one error format. |
| Changing models | A new integration when the model is on another provider. | Change the model id. |
| Provider outage or rate limit | Your code has to detect it and retry elsewhere. | The gateway retries on the next upstream. |
| Billing and logs | One invoice and one dashboard per provider. | One balance and one usage log. |
| Your own provider keys | Used directly. | Attached as BYOK at $0 markup, with failover and logging. |
| Best fit | You call one provider and never change models. | You use several models or providers, or run coding agents. |
FAQ
Questions people ask
What is AnyRouter?
AnyRouter is an OpenAI- and Anthropic-compatible LLM gateway on Cloudflare. One API key reaches hundreds of models, with automatic failover, free models, bring-your-own-key at $0 markup, and a shared key Pool.
Who is AnyRouter for?
Developers who use more than one model provider, teams that want one bill and one usage log, and people who run coding agents such as Claude Code, Codex, or OpenCode and want to swap models without editing config.
Which APIs does it speak?
OpenAI Chat Completions, OpenAI Responses, OpenAI Embeddings, and Anthropic Messages. An OpenAI or Anthropic SDK works after you change the base URL and the key.
Is there a free tier?
Yes. The model id anyrouter/free routes to the best free model available at that moment and deducts no credits. The Decisions API is also free on every plan.
Can I use my own provider keys?
Yes. Bring-your-own-key routes through the keys you already pay for with a $0 markup, so you pay your provider exactly what it charges. You can also donate a key to the shared Pool.
What happens when a provider fails?
On a 401, 429, or 5xx from one upstream, AnyRouter retries the request on the next upstream for that model. Your client sees the final answer.
Does AnyRouter store my prompts?
Request and response bodies are logged by default so you can debug real traffic in Request Logs. Turn off Body logging in Privacy settings to stop storing them. Provider keys are encrypted at rest.
Does it generate images or video?
No. The catalog covers text generation and embeddings only.