Model - Python SDK

Model method reference

The Python SDK and docs are currently in beta. Report issues on GitHub.

Information about an AI model available on OpenRouter

Fields

FieldTypeRequiredDescriptionExample
architecturecomponents.ModelArchitecture✔️Model architecture information{"input_modalities": ["text"],"instruct_type": "chatml","modality": "text-\u003etext","output_modalities": ["text"],"tokenizer": "GPT"}
canonical_slugstr✔️Canonical slug for the modelopenai/gpt-4
context_lengthNullable[int]✔️Maximum context length in tokens8192
createdint✔️Unix timestamp of when the model was created1692901234
default_parametersNullable[components.DefaultParameters]✔️Default parameters for this model{"frequency_penalty": 0,"presence_penalty": 0,"repetition_penalty": 1,"temperature": 0.7,"top_k": 0,"top_p": 0.9}
descriptionOptional[str]Description of the modelGPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
expiration_dateOptionalNullable[str]The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration.2025-06-01
hugging_face_idOptionalNullable[str]Hugging Face model identifier, if applicablemicrosoft/DialoGPT-medium
idstr✔️Unique identifier for the modelopenai/gpt-4
knowledge_cutoffOptionalNullable[str]The date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown.2024-10-01
linkscomponents.ModelLinks✔️Related API endpoints and resources for this model.{"details": "/api/v1/models/openai/gpt-5.4/endpoints"}
namestr✔️Display name of the modelGPT-4
per_request_limitsNullable[components.PerRequestLimits]✔️Per-request token limits{"completion_tokens": 1000,"prompt_tokens": 1000}
pricingcomponents.PublicPricing✔️Pricing information for the model{"completion": "0.00006","image": "0","prompt": "0.00003","request": "0"}
supported_parametersList[components.Parameter]✔️List of supported parameters for this model
supported_voicesList[str]✔️List of supported voice identifiers for TTS models. Null for non-TTS models.<nil>
top_providercomponents.TopProviderInfo✔️Information about the top provider for this model{"context_length": 8192,"is_moderated": true,"max_completion_tokens": 4096}