What does OpenAI-compatible mean?
Many apps already talk to the OpenAI API. An OpenAI-compatible gateway accepts those same requests, so you do not rewrite the client.
The gateway then routes the request to the model you named. AnyRouter is an LLM gateway: one API key, one base URL, and hundreds of models behind it.
Which API shapes sit behind one base URL?
AnyRouter serves four shapes at https://anyrouter.dev/api/v1. Pick the one your client already speaks.
| API shape | Path under the base URL |
|---|---|
| OpenAI Chat Completions | /chat/completions |
| OpenAI Responses | /responses |
| OpenAI Embeddings | /embeddings |
| Anthropic Messages | /messages |
The Chat Completions page shows the unified shape in detail.
How do I switch an existing client?
- 1
Create a key. Make an inference key in the dashboard. It starts with sk-ar-v1-.
- 2
Change the base URL. Set it to https://anyrouter.dev/api/v1.
- 3
Name a model. Use a provider/model id, such as anyrouter/free.
export ANYROUTER_API_KEY="sk-ar-v1-your-key"
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!"}]
}'from openai import OpenAI
client = OpenAI(
base_url="https://anyrouter.dev/api/v1",
api_key="sk-ar-v1-your-key",
)
response = client.chat.completions.create(
model="anyrouter/free",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)import OpenAI from "openai"
const client = new OpenAI({
baseURL: "https://anyrouter.dev/api/v1",
apiKey: "sk-ar-v1-your-key",
})
const response = await client.chat.completions.create({
model: "anyrouter/free",
messages: [{ role: "user", content: "Hello!" }],
})
console.log(response.choices[0].message.content)The full walkthrough is the quickstart. For the Vercel AI SDK, see the AI SDK page.
How are model ids written?
Every id has the form provider/model. The part before the slash names the provider or owner. The part after it names the model.
- moonshotai/kimi-k3.1-pro is a model from moonshotai.
- anyrouter/free asks AnyRouter to pick a working free model.
Browse every id on the models page. Switching models means changing one string. If one upstream fails, model fallbacks can retry on another.
Where do I go next?
Read Unify an LLM API for the idea behind one endpoint, and one endpoint for every AI API for the wider set of shapes. For routing and failover in general, see the LLM gateway page. To use your own provider keys, read BYOK.
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. Check the domain before you send API keys or payments.
FAQ
What does OpenAI-compatible mean for a gateway?
The gateway accepts the same requests as the OpenAI API and returns the same response shape. Your existing OpenAI client works after you change the base URL and the API key.
Which API shapes does AnyRouter accept?
OpenAI Chat Completions, Responses and Embeddings, and Anthropic Messages. All four sit behind the base URL https://anyrouter.dev/api/v1.
How do I name a model?
Write provider/model, for example moonshotai/kimi-k3.1-pro. The id tells the gateway which model to route to.
Do I need a separate key for each provider?
No. One AnyRouter inference key (it starts with sk-ar-v1-) reaches every model. You can also bring your own provider keys at $0 markup.
Related posts
- Unify every LLM API behind one endpointGuidesJune 29, 2026 · OpenAI, Anthropic, Google, and a dozen others each ship a different SDK, auth scheme, and error shape. Unifying them behind one OpenAI-compatible API turns model choice into a config value instead of an integration project.
- A unified AI API: one endpoint, every provider dialectGuidesJuly 12, 2026 · OpenAI ships /chat/completions, Anthropic ships /messages, OpenAI's newer surface is /responses. A unified AI API speaks all of them at one URL, so the client library you already use keeps working. You swap the base URL, not the code.
- 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.
- 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.