Docs

Make the first request in minutes.

Use the standard OpenAI request shape. Point your client at OpenRouter, add a scoped key and select a published route.

Quickstart

  1. 1. Buy OpenRouter credits.
  2. 2. Create an OpenRouter API key in the dashboard.
  3. 3. Send requests to the base URL with a model ID such as openrouter/claude-sonnet-4-6.
Base URL
https://api.openrouter.stream/v1
API key format
sk-...

Model aliases

openrouter/claude-fable-5
Claude Fable 5 through OpenRouter
openrouter/claude-opus-5
Claude Opus 5 through OpenRouter
openrouter/claude-sonnet-5
Claude Sonnet 5 through OpenRouter
openrouter/claude-opus-4-8
Claude Opus 4.8 through OpenRouter
openrouter/claude-opus-4-8-thinking
Claude Opus 4.8 Thinking through OpenRouter
openrouter/claude-opus-4-7
Claude Opus 4.7 through OpenRouter
openrouter/claude-sonnet-4-6
Claude Sonnet 4.6 through OpenRouter
openrouter/claude-haiku-4-5
Claude Haiku 4.5 through OpenRouter

Streaming

Streaming support depends on the selected route. Check route availability and test with your OpenRouter API key before wide rollout.

Controlled user note

Do not send highly sensitive data through best-effort community routes. Route multipliers apply to total token usage.

bash
curl https://api.openrouter.stream/v1/chat/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openrouter/claude-sonnet-4-6",
    "messages": [
      {"role": "user", "content": "Summarize this diff and suggest next edits."}
    ]
  }'
javascript
const response = await fetch("https://api.openrouter.stream/v1/chat/completions", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer sk-...",
  },
  body: JSON.stringify({
    model: "openrouter/claude-sonnet-4-6",
    messages: [{ role: "user", content: "Review this pull request." }],
  }),
});

const data = await response.json();
python
import requests

response = requests.post(
    "https://api.openrouter.stream/v1/chat/completions",
    headers={
        "Authorization": "Bearer sk-...",
        "Content-Type": "application/json",
    },
    json={
        "model": "openrouter/claude-sonnet-4-6",
        "messages": [{"role": "user", "content": "Generate release notes from these commits."}],
    },
)

print(response.json())
json
{
  "error": {
    "code": "insufficient_balance",
    "message": "Your OpenRouter credit balance is too low for this route.",
    "type": "billing_error"
  }
}
json
{
  "usage": {
    "input_tokens": 1800,
    "output_tokens": 3400,
    "route_multiplier": "x3",
    "charged_quota_tokens": 15600
  }
}