Features
- 200+ models from OpenAI, Anthropic, Google, Meta, Mistral, Cohere, etc.
- OpenAI-compatible — drop-in replacement, change one line of code
- Automatic fallbacks — if a model is down, route to alternatives
- Usage-based pricing — pay per token, no subscriptions
- Rate limiting — built-in handling across providers
Usage with Python
from openai import OpenAI
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key="sk-or-...",
)
response = client.chat.completions.create(
model="anthropic/claude-sonnet-4-20250514",
messages=[{"role": "user", "content": "Hello"}],
)