Documentation

Everything you need to integrate AnRouter. Fully compatible with OpenAI, Anthropic, and Gemini SDKs — get your first response in under 2 minutes.

Quick Start

AnRouter is fully compatible with the OpenAI API specification. If you've already used OpenAI, you only need to change two things: your base URL and your API key. Everything else stays the same.

BASE URL: https://api.anrouter.com/v1

AUTH: Authorization: Bearer YOUR_API_KEY

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_ANROUTER_API_KEY",
    base_url="https://api.anrouter.com/v1"
)

response = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user",   "content": "Write a binary search in Python."}
    ]
)

print(response.choices[0].message.content)