Appearance
OpenRouter
See also: Configuration Reference, Model Routing and API Behavior, Provider API Compatibility, Pricing Catalog and Accounting
This page owns provider-specific configuration examples for OpenRouter routes.
Current Runtime Boundary
OpenRouter is configured with the generic openai_compat provider type because its HTTP API is OpenAI-compatible. OpenRouter-specific provider-selection policy is route metadata under compatibility.openrouter; do not hide that policy in extra_body.provider.
Use generic openai_compat without compatibility.openrouter for arbitrary OpenAI-compatible endpoints. Use compatibility.openrouter only for routes that call https://openrouter.ai/api/v1 and need OpenRouter's upstream provider routing controls.
Provider
yaml
providers:
- id: openrouter
type: openai_compat
base_url: https://openrouter.ai/api/v1
pricing_provider_id: openai
auth:
kind: bearer
token: env.OPENROUTER_API_KEY
display:
label: OpenRouter
icon_key: openrouterRoute Policy
OpenRouter routes one requested model across upstream provider endpoints. That is OpenRouter behavior, not Oceans multi-route fallback. Oceans still selects one gateway route before provider execution.
yaml
models:
- id: openrouter-fast-zdr
routes:
- provider: openrouter
upstream_model: openai/gpt-4o-mini
compatibility:
openrouter:
provider:
zdr: true
only: [openai, anthropic]
ignore: [deepinfra]
order: [openai, anthropic]
preferred_max_latency:
p90: 2.5
max_price:
prompt: 1.0
completion: 2.0Policy fields:
zdr: restricts routing to OpenRouter endpoints with Zero Data Retention.only: provider slugs OpenRouter may use.ignore: provider slugs OpenRouter must skip.order: preferred provider slug order. OpenRouter disables its default load balancing when ordered provider preference is set.preferred_max_latency: a preference, not a hard exclusion. Use a number orp50,p75,p90, andp99cutoffs in seconds.max_price: a hard ceiling. Supported dimensions areprompt,completion,request, andimage.
Provider slugs must match OpenRouter's provider names. Oceans validates shape and conflicts but does not maintain an OpenRouter provider catalog.
