Skip to main content
The OpenRouter model provides unified access to various language models through OpenRouter.

Parameters

ParameterTypeDefaultDescription
idstr"openai/gpt-4o-mini"The id of the OpenRouter model to use
namestr"OpenRouter"The name of the model
providerstr"OpenRouter"The provider of the model
api_keyOptional[str]NoneThe API key for OpenRouter (defaults to OPENROUTER_API_KEY env var)
base_urlstr"https://openrouter.ai/api/v1"The base URL for the OpenRouter API
app_nameOptional[str]"agno"Application name for OpenRouter request headers
retriesint0Number of retries to attempt before raising a ModelProviderError
delay_between_retriesint1Delay between retries, in seconds
exponential_backoffboolFalseIf True, the delay between retries is doubled each time
OpenRouter extends the OpenAI-compatible interface and supports most parameters from OpenAI.