# What is an AI router?

> An AI router picks which model or provider serves each request. This post explains how routing by model id works, what happens on a 401, 429 or 5xx, why your own keys go first, and how a router differs from a plain proxy.

- Date: December 4, 2026
- Category: guides
- HTML: https://anyrouter.dev/blog/what-is-an-ai-router

## 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](/blog/direct-provider-vs-gateway).

## How does a request get routed?



```bash
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!"}]
  }'
```

_One request. The model id tells the router where to send it._

## 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](https://anyrouter.dev/byok) has a $0 markup. The provider bills you exactly what it charges.

You can still add failover on top. See [model fallbacks](https://anyrouter.dev/docs/guides/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](https://anyrouter.dev/free) or the full [model list](https://anyrouter.dev/models).

## 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.
