Skip to content
The universal AI model router

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.

1 URLto reach every provider
100sof models, one catalog
$4monthly credit on Go
0client rewrites needed

One key reaches every major provider

OpenAI
Anthropic
Google
Meta
Mistral
DeepSeek
xAI
Groq
Qwen
Cohere
Z-AI
Cloudflare
01

Capabilities

Everything the gateway does

One URL, every model

A single OpenAI- and Anthropic-compatible endpoint reaches hundreds of models across providers.

Auto-failover

401, 429, and 5xx errors transparently retry on the next upstream so your run never stalls.

BYOK + subscription pooling

Pool your own provider keys and paid plans behind one gateway. BYOK never spends platform credits.

Better prices

Transparent per-token pricing, BYOK at no markup, and a curated set of free models on Go — route real traffic for a dollar or a donated key.

Higher uptime

Continuous upstream monitoring plus cross-provider fallback keeps the gateway answering when one provider doesn't.

Swap models, no code change

Presets and virtual models let you change the underlying model from your account, not your codebase.

CLI & agent launchers

anyr claude points Claude Code, Codex, or Cursor at the gateway — config injects on demand, then wipes clean.

Private by default

Prompt and completion bodies are never logged unless you opt in. Secrets are encrypted at rest with per-row salts.

MCP server built in

Manage keys, credits, and the catalog from any MCP client — the gateway speaks the protocol natively.

02

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.

03

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.

The CLI

anyr claude launches your coding agent on the gateway. Pass a flag to swap models mid-project — same agent, different model, no config surgery. Your keys and presets inject on demand, then wipe clean on exit.

anyr claude --model z-ai/glm-4.7-flash

The SDK

@anyr/sdk and the Vercel AI SDK provider @anyr/ai-sdk-provider let your own agents reach every model through one client — change the model id in code and routing, failover, and billing follow.

createAnyRouter().chat("anthropic/claude-opus-4")
04
AI-first

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.

Why we exist

The model landscape changes every week — new providers, new prices, new rate limits. Wiring each one into your stack by hand is wasted effort that breaks the moment something shifts. AnyRouter absorbs that churn so you can treat models as interchangeable building blocks: pick the best one for the job, and let the gateway handle the keys, fallbacks, and plumbing underneath.

05

Principles

What we stand for

Private by default

We don't log prompt or completion bodies unless you opt in per account. Secrets are encrypted at rest with per-row salts.

Open and compatible

We speak the OpenAI, Anthropic, and Responses APIs you already use. No lock-in — point your client elsewhere any time.

Cheap to start

Bring your own keys at no markup, or top up and pay per token. Add a $4 monthly credit and free models with Go — $2/mo, or free when you donate a provider key.

06

How it works

From request to answer

  1. Step 1

    Point your client at one base URL

    Set an OpenAI SDK base URL to https://anyrouter.dev/api/v1, or an Anthropic SDK base URL to https://anyrouter.dev/api (the Anthropic SDK adds /v1/messages itself). Use an AnyRouter key (sk-ar-v1-...). Nothing else in your code changes.

  2. Step 2

    Name a model

    Models use the provider/model form, for example z-ai/glm-4.7-flash. Virtual ids such as anyrouter/free and anyrouter/auto pick a model for you.

  3. Step 3

    AnyRouter picks an upstream

    The gateway chooses a provider for that model, using your own key, a pooled key, or the platform's, and translates the request into that provider's format.

  4. Step 4

    Failures retry, answers stream back

    If an upstream returns 401, 429, or 5xx, the next upstream gets the request. Your client receives one streamed answer, and the call lands in your usage log.

07

Comparison

AnyRouter or the provider directly

 Calling providers directlyThrough AnyRouter
IntegrationOne SDK, one key, and one error format per provider.One base URL, one key, one error format.
Changing modelsA new integration when the model is on another provider.Change the model id.
Provider outage or rate limitYour code has to detect it and retry elsewhere.The gateway retries on the next upstream.
Billing and logsOne invoice and one dashboard per provider.One balance and one usage log.
Your own provider keysUsed directly.Attached as BYOK at $0 markup, with failover and logging.
Best fitYou call one provider and never change models.You use several models or providers, or run coding agents.
08

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.

Route your first request in 2 minutes

Run anyr claude or point your existing client at our base URL — one key, every model, automatic failover.