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

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 topProvider: {
33 isModerated: true,
34 },
35};

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}
descriptionstringDescription of the modelGPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
expirationDatestringThe date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration.2025-06-01
huggingFaceIdstringHugging Face model identifier, if applicablemicrosoft/DialoGPT-medium
idstring✔️Unique identifier for the modelopenai/gpt-4
knowledgeCutoffstringThe 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
topProvidermodels.TopProviderInfo✔️Information about the top provider for this model{"context_length": 8192,"is_moderated": true,"max_completion_tokens": 4096}