Model - TypeScript SDK
Model - TypeScript SDK
Model type definition
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Information about an AI model available on OpenRouter
Example Usage
1 import { Model } from "@openrouter/sdk/models"; 2 3 let 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 topProvider: { 33 isModerated: true, 34 }, 35 };
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
architecture | models.ModelArchitecture | ✔️ | Model architecture information | {"input_modalities": ["text"],"instruct_type": "chatml","modality": "text-\u003etext","output_modalities": ["text"],"tokenizer": "GPT"} |
canonicalSlug | string | ✔️ | Canonical slug for the model | openai/gpt-4 |
contextLength | number | ✔️ | Maximum context length in tokens | 8192 |
created | number | ✔️ | Unix timestamp of when the model was created | 1692901234 |
defaultParameters | models.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} |
description | string | ➖ | Description of the model | GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. |
expirationDate | string | ➖ | The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. | 2025-06-01 |
huggingFaceId | string | ➖ | Hugging Face model identifier, if applicable | microsoft/DialoGPT-medium |
id | string | ✔️ | Unique identifier for the model | openai/gpt-4 |
knowledgeCutoff | string | ➖ | 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 |
links | models.ModelLinks | ✔️ | Related API endpoints and resources for this model. | {"details": "/api/v1/models/openai/gpt-5.4/endpoints"} |
name | string | ✔️ | Display name of the model | GPT-4 |
perRequestLimits | models.PerRequestLimits | ✔️ | Per-request token limits | {"completion_tokens": 1000,"prompt_tokens": 1000} |
pricing | models.PublicPricing | ✔️ | Pricing information for the model | {"completion": "0.00006","image": "0","prompt": "0.00003","request": "0"} |
supportedParameters | models.Parameter[] | ✔️ | List of supported parameters for this model | |
topProvider | models.TopProviderInfo | ✔️ | Information about the top provider for this model | {"context_length": 8192,"is_moderated": true,"max_completion_tokens": 4096} |