# One API for every LLM

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

- Date: July 12, 2026
- Category: guides
- HTML: https://anyrouter.dev/blog/one-api-every-llm

## What does 'one API for every LLM' mean?

AnyRouter puts a single OpenAI-compatible API in front of every model it serves, hundreds of them today. You send the same request shape you already send to OpenAI, and the model id decides which provider actually runs it. There's no per-provider SDK, no second auth scheme, no bespoke error handling: one base URL, one key, every model.

The same surface also speaks the other common dialects. Chat lives at /chat/completions (OpenAI-style), Claude clients can hit /messages (Anthropic-style), the newer OpenAI Responses API is at /responses, and embeddings at /embeddings. Same account, same key, same audit log across all of them.

## Model ids are just provider/model strings

Every model is addressed as `provider/model`, so switching models is a config value rather than an integration project. Point the standard OpenAI SDK at AnyRouter and iterate over the whole catalog with one client:

```python
from openai import OpenAI

client = OpenAI(base_url="https://anyrouter.dev/api/v1", api_key="sk-ar-v1-...")

for model in ["openai/gpt-5.5", "anthropic/claude-opus-4-8", "google/gemini-2.5-pro", "z-ai/glm-5.2"]:
  resp = client.chat.completions.create(
      model=model,
      messages=[{"role": "user", "content": "Say hello"}],
      stream=True,
  )
  for chunk in resp:
      print(chunk.choices[0].delta.content or "", end="")
```

_One client, one base URL. Every model is a string._

Streaming works exactly as it does with OpenAI, pass `stream=True` and read deltas. Because the contract is the standard API, there's no lock-in: the same code points straight back at any provider if you ever leave.

## What happens when an upstream fails?

A model id can be served by more than one upstream provider. When the primary is rate-limited, erroring, or down, AnyRouter fails over to the next healthy upstream for that model automatically. A single 429 no longer stalls an agent mid-task. You can also steer that choice yourself with provider preferences and saved routing presets, so a request can prefer cheaper capacity, pin a specific provider, or fall back through a chosen order.

- Automatic failover, multiple upstreams per model, unhealthy ones quarantined.
- Provider preferences, prefer, pin, or order the upstreams a request may use.
- Routing presets, save a routing policy once and reuse it by name.
- Streaming and tools. SSE deltas and function calling pass through unchanged.

## Where to start

Browse the full catalog on /models, try any model live in the /playground, and read the endpoint reference in /docs. If you route on keys you already pay for, see BYOK below. Those calls carry $0 markup.

- Bring your own provider keys at $0 markup: /blog/byok-bring-your-own-keys.
- Point Claude Code, Codex, or Cursor at the same endpoint: /blog/coding-agents-one-gateway.
- Keep your OpenAI SDK and just swap the base URL: /blog/openai-api-alternative.

One OpenAI-compatible API in front of hundreds of models, with automatic failover and streaming.

[Set it up free](https://anyrouter.dev/dashboard)
