ModelResponse - TypeScript SDK
ModelResponse - TypeScript SDK
ModelResponse type definition
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Single model response
Example Usage
1 import { ModelResponse } from "@openrouter/sdk/models"; 2 3 let value: ModelResponse = { 4 data: { 5 architecture: { 6 inputModalities: [ 7 "text", 8 ], 9 modality: "text->text", 10 outputModalities: [ 11 "text", 12 ], 13 }, 14 canonicalSlug: "openai/gpt-4", 15 contextLength: 8192, 16 created: 1692901234, 17 defaultParameters: {}, 18 id: "openai/gpt-4", 19 links: { 20 details: "/api/v1/models/openai/gpt-5.4/endpoints", 21 }, 22 name: "GPT-4", 23 perRequestLimits: null, 24 pricing: { 25 completion: "0.00006", 26 prompt: "0.00003", 27 }, 28 supportedParameters: [ 29 "temperature", 30 "top_p", 31 "max_tokens", 32 ], 33 supportedVoices: null, 34 topProvider: { 35 isModerated: true, 36 }, 37 }, 38 };
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
data | models.Model | ✔️ | Information about an AI model available on OpenRouter | {"architecture": {"input_modalities": ["text"],"instruct_type": "chatml","modality": "text-\u003etext","output_modalities": ["text"],"tokenizer": "GPT"},“canonical_slug”: “openai/gpt-4”, “context_length”: 8192, “created”: 1692901234, “default_parameters”: null, “description”: “GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.”, “expiration_date”: null, “id”: “openai/gpt-4”, “knowledge_cutoff”: null, “links”: {"details": "/api/v1/models/openai/gpt-5.4/endpoints"},“name”: “GPT-4”, “per_request_limits”: null, “pricing”: {"completion": "0.00006","image": "0","prompt": "0.00003","request": "0"},“supported_parameters”: [ “temperature”, “top_p”, “max_tokens” ], “supported_voices”: null, “top_provider”: {"context_length": 8192,"is_moderated": true,"max_completion_tokens": 4096}} |