Skip to main content

OpenRouter

Use this when one aggregation or routing layer should sit in front of multiple upstream model vendors while staying explicit in config.

At A Glance

FieldValue
Built-in kindopenrouter
Provider groupGateway And Compatibility Providers
Protocol familyopenai_chat_completions
Feature familyopenai_compatible
Auth schemebearer
Credential envsOPENROUTER_API_KEY
Aliasesopenrouter_compatible
Default base URLhttps://openrouter.ai
Request endpointhttps://openrouter.ai/api/v1/chat/completions
Models endpointhttps://openrouter.ai/api/v1/models

Minimal Config

active_provider = "openrouter"

[providers.openrouter]
kind = "openrouter"
api_key = { env = "OPENROUTER_API_KEY" }
model = "auto"

Verify It

loong doctor
loong list-models
loong ask --message "Say hello and name the active provider."
If list-models is unreliable for this account or region, pin an explicit provider.model or add preferred_models instead of leaving recovery implicit.

Auth And Routing Contract

ContractValue
Auth optionalno
Model probe auth optionalno
Default API key envOPENROUTER_API_KEY
OAuth envnone
Primary request routehttps://openrouter.ai/api/v1/chat/completions
Primary model-catalog routehttps://openrouter.ai/api/v1/models