OpenRouter Model Switch
One API key, 400+ models, automatic provider routing
CALCULATING...
OpenRouter exposes a single OpenAI-compatible endpoint with per-model pricing, provider routing, fallbacks and usage accounting. It is the simplest way to compare models without opening accounts with every lab.
Switching Instructions & Commands
Step 1
Point any OpenAI-compatible client at OpenRouter
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="sk-or-v1-..."
Works with the OpenAI SDK, LangChain, OpenCode, Pi and most agent frameworks.
Step 2
Pick a current DeepSeek model
export OPENAI_MODEL="deepseek/deepseek-v4.1-flash"
Use the exact OpenRouter model slug. Model pages list live context and pricing.
Step 3
Route directly to DeepSeek
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "HTTP-Referer: https://codingplans.dev" \
-H "X-Title: codingplans" \
-d '{"model":"deepseek/deepseek-v4.1-flash","provider":{"order":["DeepSeek"]}}'
Provider routing is a preference, not a guarantee; OpenRouter falls back if the preferred provider is unavailable.
DeepSeek Peak Pricing Impact on OpenRouter
OpenRouter passes DeepSeek's peak and off-peak prices through. Off-peak V4.1 Flash is $0.15/M input and $0.60/M output; weekday peak windows double those rates. For predictable budgets, set a provider allowlist and a max price in the request, or route batch jobs to an open-weight model with flat pricing.
Data verified from https://openrouter.ai/docs/quickstart on 2026-10-17.