For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
ModelsChatRankingsDocs
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
    • Overview
    • Usage for Agents
  • TypeScript SDK
    • Overview
      • Analytics
      • APIKeys
      • Byok
      • Chat
      • Credits
      • Embeddings
      • Endpoints
      • Generations
      • Guardrails
        • Models
        • Model
      • OAuth
      • Observability
      • Organization
      • Presets
      • Providers
      • Rerank
      • Beta.Responses
      • Transcriptions
      • Speech
      • VideoGeneration
      • Workspaces
  • Python SDK
    • Overview
  • Go SDK
  • DevTools
    • Overview
    • Migrating to @openrouter/agent
LogoLogo
ModelsChatRankingsDocs
On this page
  • Example Usage
  • Fields
TypeScript SDKAPI ReferenceModels

Model - TypeScript SDK

Model type definition
Was this page helpful?
Previous

OAuth - TypeScript SDK

OAuth method reference
Next
Built with

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

Information about an AI model available on OpenRouter

Example Usage

1import { Model } from "@openrouter/sdk/models";
2
3let value: Model = {
4 architecture: {
5 inputModalities: [
6 "text",
7 ],
8 modality: "text->text",
9 outputModalities: [
10 "text",
11 ],
12 },
13 canonicalSlug: "openai/gpt-4",
14 contextLength: 8192,
15 created: 1692901234,
16 defaultParameters: null,
17 id: "openai/gpt-4",
18 links: {
19 details: "/api/v1/models/openai/gpt-5.4/endpoints",
20 },
21 name: "GPT-4",
22 perRequestLimits: null,
23 pricing: {
24 completion: "0.00006",
25 prompt: "0.00003",
26 },
27 supportedParameters: [
28 "temperature",
29 "top_p",
30 "max_tokens",
31 ],
32 supportedVoices: null,
33 topProvider: {
34 isModerated: true,
35 },
36};

Fields

FieldTypeRequiredDescriptionExample
architecturemodels.ModelArchitecture✔️Model architecture information{"input_modalities": ["text"],"instruct_type": "chatml","modality": "text-\u003etext","output_modalities": ["text"],"tokenizer": "GPT"}
canonicalSlugstring✔️Canonical slug for the modelopenai/gpt-4
contextLengthnumber✔️Maximum context length in tokens8192
creatednumber✔️Unix timestamp of when the model was created1692901234
defaultParametersmodels.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}
descriptionstring➖Description of the modelGPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
expirationDatestring➖The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration.2025-06-01
huggingFaceIdstring➖Hugging Face model identifier, if applicablemicrosoft/DialoGPT-medium
idstring✔️Unique identifier for the modelopenai/gpt-4
knowledgeCutoffstring➖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
linksmodels.ModelLinks✔️Related API endpoints and resources for this model.{"details": "/api/v1/models/openai/gpt-5.4/endpoints"}
namestring✔️Display name of the modelGPT-4
perRequestLimitsmodels.PerRequestLimits✔️Per-request token limits{"completion_tokens": 1000,"prompt_tokens": 1000}
pricingmodels.PublicPricing✔️Pricing information for the model{"completion": "0.00006","image": "0","prompt": "0.00003","request": "0"}
supportedParametersmodels.Parameter[]✔️List of supported parameters for this model
supportedVoicesstring[]✔️List of supported voice identifiers for TTS models. Null for non-TTS models.<nil>
topProvidermodels.TopProviderInfo✔️Information about the top provider for this model{"context_length": 8192,"is_moderated": true,"max_completion_tokens": 4096}