What does an AI router decide?
An AI router sits between your app and many model providers. For every request, it decides which model or provider serves it.
You send one request to one base URL with one API key. The router does the picking, and your code stays the same.
How is a router different from a plain proxy?
A plain proxy forwards a request to one fixed destination. If that destination fails, the caller sees the failure.
A router chooses the destination for each request and can try another one when the first fails.
| Plain proxy | AI router | |
|---|---|---|
| Destination | One fixed upstream | Chosen per request |
| Model selection | You manage it | By the model id you send |
| On an upstream error | The caller sees it | Retries on the next upstream |
| Your own keys | You wire them in | Tried first when you have them |
The longer comparison with calling a provider directly is in Direct provider vs gateway.
How does a request get routed?
- 1
Send the request with a model id. Model ids are written provider/model, for example moonshotai/kimi-k3.1-pro. Send them to the base URL https://anyrouter.dev/api/v1.
- 2
The router picks an upstream. It chooses an upstream for that model. Your own keys come first when you have them.
- 3
A failure moves to the next upstream. On a 401, 429 or 5xx, the router retries the next upstream. Your client sees the final answer, not the error.
- 4
The call lands in one log. Each request records model, tokens, cost, latency and errors. See request logs.
curl https://anyrouter.dev/api/v1/chat/completions \
-H "Authorization: Bearer $ANYROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anyrouter/free",
"messages": [{"role": "user", "content": "Hello!"}]
}'Why do your own keys go first?
If you already pay a provider, you want those calls to use your account. The router tries your keys before any shared route.
Bring-your-own-key has a $0 markup. The provider bills you exactly what it charges.
You can still add failover on top. See model fallbacks for how to set it up.
What happens when a free model is busy?
Free routes share a throttled pool, so a busy hour can return 429.
Browse the free models or the full model list.
Official site
The official AnyRouter domain is https://anyrouter.dev, shortened as https://anyr.dev. It is the only valid domain for the API, docs, models, pricing and terms.
Sites on other domains that use the AnyRouter name are clones and are not affiliated with AnyRouter.
FAQ
What does an AI router do?
An AI router picks which model or provider serves a request. AnyRouter routes by the model id you send, and falls back automatically on a 401, 429 or 5xx from one upstream.
Is AnyRouter an AI router?
Yes. AnyRouter is the product. AI router is the category it belongs to. It is an OpenAI- and Anthropic-compatible LLM gateway, so one API key reaches hundreds of models.
Will a router use my own provider keys?
Yes. When you have your own keys, the router tries them first. Bring-your-own-key has a $0 markup, so the provider bills you exactly what it charges.
What happens if a free model fails?
Free routes share a throttled pool, so a busy hour can return 429. If a :free model fails on every route, AnyRouter answers with anyrouter/free instead of an error and sets the response header x-anyrouter-fallback: anyrouter/free.
Related posts
- What is AnyRouter? A plain-English guide to AI model routingGuidesAugust 5, 2026 · An AI model router lets you call many LLMs through one API. Here's what AnyRouter is, why it exists, and whether it's useful for your next project.
- Calling providers directly vs. routing through one gatewayComparisonsJuly 12, 2026 · Call OpenAI, Anthropic, and every other provider directly and you manage a key, an SDK, and an audit trail per provider. Route the same calls through one gateway and you manage one of each, at the cost of an extra hop. Here's the honest trade-off on auth, SDKs, failover, billing, audit logs, and switching cost.
- How automatic failover works in an LLM gatewayEngineeringJuly 12, 2026 · A single provider call has a single point of failure: one rate limit, one outage, one bad deploy on their end, and your request fails. Here's the actual mechanism AnyRouter uses to route around that, circuit breakers, escalating cooldowns, and a fallback chain, and why the extra hop barely registers next to model generation time.
- One API for every LLMGuidesJuly 12, 2026 · One OpenAI-compatible endpoint reaches every model in the catalog, hundreds of models addressed as provider/model, with automatic failover across upstreams, routing presets, and streaming. Point your existing client at AnyRouter and change a model with a string, not a rewrite.