Quickstart

Send your first AnyRouter request by pointing any OpenAI-compatible client at one base URL.

AnyRouter is an OpenAI- and Anthropic-compatible LLM gateway. One API key reaches hundreds of models, with automatic failover, free models, bring-your-own-key at $0 markup, and a shared key Pool. Three settings stay the same in every client:

SettingValue
Base URLhttps://anyrouter.dev/api/v1
API keyyour sk-ar-v1-… inference key
Model idprovider/model, e.g. anyrouter/free (free models need Go)

Make your first request

  1. Create a key in the dashboard. No card required.

  2. A new account starts at $0 balance. Before a paid-model call, top up, subscribe to Go ($2/mo, includes $4/mo credits), or donate a provider key to unlock Go free. See Credits & Billing.

  3. Export the key and send a request:

    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!"}]
      }'

Add "stream": true to get server-sent events.

Use a client

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)

Launch a coding agent

curl -fsSL https://anyrouter.dev/cli.sh | bash
anyr auth login
anyr claude --install --ok

See the AnyRouter CLI and Grok Bot, Herdr, and Anyr CLI.

Choose a model

Browse the models page or call GET /api/v1/models with your key.

Model idNotes
anyrouter/freeRoutes to a working free model. Needs Go ($2/mo, or free with one donated key)
anthropic/claude-sonnet-4-61M context, strong coding
anthropic/claude-haiku-4-5Fast and cheap
google/gemini-3.1-proMultimodal, long context

AnyRouter routes requests to third-party models. Models and outputs are provided as is, with no warranty; you use them at your own risk. Disclaimer