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.

Tip

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.

PYTHON
python
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)
TYPESCRIPT
typescript
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)
BASH
bash
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:

BASH
bash
curl https://anyrouter.dev/api/v1/models \
  -H "Authorization: Bearer ar-your-key"

Some popular choices:

Model IDProviderNotes
openai/gpt-4-turboOpenAIFlagship general-purpose
anthropic/claude-sonnet-4.6Anthropic1M context, strong coding
anthropic/claude-haiku-4.5AnthropicFast and cheap
google/gemini-2.5-proGoogleMultimodal, 2M context
meta-llama/llama-3.3-70bMetaOpen-weight flagship

4. What's next?