Quickstart
Get up and running with AnyRouter in under five minutes. Point any OpenAI-compatible client at the AnyRouter base URL and you're done.
Quickstart
AnyRouter is a universal AI model router — a single OpenAI-compatible API gateway that routes requests to 150+ AI models across 28+ providers. This guide gets you making your first request in under five minutes.
1. Create an API key
Sign in to your dashboard and create a new API key. AnyRouter keys are prefixed with ar- so you can tell them apart from upstream provider keys.
Keys are scoped per-organization. Create a separate key for every environment (dev, staging, prod) so you can rotate them independently.
2. Point your client at AnyRouter
AnyRouter implements the OpenAI Chat Completions API. Every official and community SDK works with zero code changes — just override the base URL and API key.
from openai import OpenAI
client = OpenAI(
base_url="https://anyrouter.dev/api/v1",
api_key="ar-your-key",
)
response = client.chat.completions.create(
model="openai/gpt-4-turbo",
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: "ar-your-key",
})
const response = await client.chat.completions.create({
model: "openai/gpt-4-turbo",
messages: [{ role: "user", content: "Hello!" }],
})
console.log(response.choices[0].message.content)curl https://anyrouter.dev/api/v1/chat/completions \
-H "Authorization: Bearer ar-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4-turbo",
"messages": [{"role": "user", "content": "Hello!"}]
}'3. Choose a model
Model IDs follow the provider/model convention, just like OpenRouter. Browse the full list on the models page or fetch it via the API:
curl https://anyrouter.dev/api/v1/models \
-H "Authorization: Bearer ar-your-key"Some popular choices:
| Model ID | Provider | Notes |
|---|---|---|
openai/gpt-4-turbo | OpenAI | Flagship general-purpose |
anthropic/claude-sonnet-4.6 | Anthropic | 1M context, strong coding |
anthropic/claude-haiku-4.5 | Anthropic | Fast and cheap |
google/gemini-2.5-pro | Multimodal, 2M context | |
meta-llama/llama-3.3-70b | Meta | Open-weight flagship |
4. What's next?
- Authentication — key scopes, rotation, and BYOK
- Chat Completions API — full request/response reference
- Streaming — server-sent events for live output
- Use Claude Code with AnyRouter — point Claude Code at AnyRouter with two env vars