Developer Platform
One OpenAI-compatible API, typed SDKs in three languages, an agent framework, local devtools, and an MCP server — backed by 400+ models across 70+ providers with automatic fallback.
Six products, one API key. Start with a single request and grow into a production agent without changing providers.
One OpenAI-compatible endpoint for 400+ models across 70+ providers, with automatic fallback when a provider fails.
https://openrouter.ai/api/v1The same typed client in TypeScript, Python, and Go — streaming, tools, and structured output behave identically in every language.
npm i @openrouter/sdkType-safe tools, multi-turn loops, streaming, and stop conditions. Build production agents that route across every provider.
npm i @openrouter/agentCapture SDK telemetry in development and replay every request, token count, and error in a local web viewer.
npm install -g @openrouter/cliGive any Model Context Protocol client — Claude Code, Cursor, or your own — access to all 400+ models.
https://mcp.openrouter.ai/mcpWorking recipes for agent harnesses, human-in-the-loop tools, evals, cost control, and image generation.
Swap the model string to change providers. Nothing else about your code has to change.
import { OpenRouter } from '@openrouter/sdk';
const client = new OpenRouter({
apiKey: process.env.OPENROUTER_API_KEY,
});
const response = await client.chat.send({
model: 'anthropic/claude-sonnet-4',
messages: [
{ role: 'user', content: 'Explain quantum computing in simple terms.' },
],
});
console.log(response.choices[0].message.content);from openrouter import OpenRouter
import os
with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY")
) as client:
response = client.chat.send(
model="anthropic/claude-sonnet-4",
messages=[
{"role": "user", "content": "Explain quantum computing in simple terms."}
]
)
print(response.choices[0].message.content)Most teams are through their first successful request in under five minutes.
Create a key from your dashboard. No subscription and no card required to start.
Already using the OpenAI SDK? Change the base URL and your key. Everything else stays put.
Use an author/slug string. Add fallbacks so a provider outage never becomes your outage.
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"models": [
"anthropic/claude-sonnet-4",
"openai/gpt-4o",
"google/gemini-2.5-pro"
],
"messages": [
{ "role": "user", "content": "Hello!" }
]
}'Free to get started. No subscription, no card required.