List Models
List all supported text generation models with optional filtering.
including pricing, context length, latency, and OpenRouter availability.
Note: Image generation models are excluded from this endpoint.
Examples:
- Get all models: /v2/models
- OpenRouter only: /v2/models?openrouter_only=true
- Specific provider: /v2/models?provider=openai
- Multiple providers: /v2/models?provider=openai&provider=anthropic
Query Parameters:
- provider: Filter by provider name(s). Can specify multiple times for multiple providers (e.g., ?provider=openai&provider=anthropic)
- openrouter_only: Return only models that have OpenRouter support (default: false)
Returns:
- models: List of active text generation model objects with metadata
- total: Total number of active models returned
- deprecated_models: List of deprecated text generation model objects with metadata (respects the same filters as active models)
Caching:
- Response is cacheable for 1 hour (model list rarely changes)
Query parameters
Filter by provider name(s). Can specify multiple providers (e.g., 'openai', 'anthropic')
Filter by provider name(s). Can specify multiple providers (e.g., 'openai', 'anthropic')
Return only OpenRouter-supported models
Return only OpenRouter-supported models
Response
Successful Response
Example response
{
"deprecated_models": [
{
"context_length": 4096,
"input_price": 0.5,
"model": "gpt-4o",
"openrouter_model": "openai/gpt-3.5-turbo",
"output_price": 1.5,
"provider": "openai"
}
],
"models": [
{
"context_length": 8192,
"input_price": 30,
"model": "gpt-4",
"openrouter_model": "openai/gpt-4",
"output_price": 60,
"provider": "openai"
},
{
"context_length": 200000,
"input_price": 15,
"model": "claude-3-opus-20240229",
"openrouter_model": "anthropic/claude-3-opus-20240229",
"output_price": 75,
"provider": "anthropic"
}
],
"total": 2
}Changes
Changed in 1 of the 2 revisions of this API.2
- ○
added the optional property
detail/items/ctxto the response with the422statusresponse-optional-property-added
- ○
added the optional property
detail/items/inputto the response with the422statusresponse-optional-property-added
- ○