The TypeScript SDK and docs are currently in beta.
Report issues on GitHub.
Example Usage
import { ListEndpointsResponse } from "@openrouter/sdk/models/operations";
let value: ListEndpointsResponse = {
data: {
id: "openai/gpt-4",
name: "GPT-4",
created: 1692901234,
description:
"GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
architecture: {
tokenizer: "GPT",
instructType: "chatml",
modality: "text->text",
inputModalities: [
"text",
],
outputModalities: [
"text",
],
},
endpoints: [
{
name: "OpenAI: GPT-4",
modelName: "GPT-4",
contextLength: 8192,
pricing: {
prompt: "0.00003",
completion: "0.00006",
},
providerName: "OpenAI",
tag: "openai",
quantization: "fp16",
maxCompletionTokens: 4096,
maxPromptTokens: 8192,
supportedParameters: [
"temperature",
"top_p",
"max_tokens",
"frequency_penalty",
"presence_penalty",
],
uptimeLast30m: 99.5,
supportsImplicitCaching: true,
latencyLast30m: {
p50: 0.25,
p75: 0.35,
p90: 0.48,
p99: 0.85,
},
throughputLast30m: {
p50: 45.2,
p75: 38.5,
p90: 28.3,
p99: 15.1,
},
},
],
},
};
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
data | models.ListEndpointsResponse | :heavy_check_mark: | List of available endpoints for a model | {"id": "openai/gpt-4","name": "GPT-4","created": 1692901234,"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.","architecture": {"tokenizer": "GPT","instruct_type": "chatml","modality": "text-\u003etext","input_modalities": ["text"],"output_modalities": ["text"]},“endpoints”: [ {"name": "OpenAI: GPT-4","model_name": "GPT-4","context_length": 8192,"pricing": {"prompt": "0.00003","completion": "0.00006","request": "0","image": "0"},“provider_name”: “OpenAI”, “tag”: “openai”, “quantization”: “fp16”, “max_completion_tokens”: 4096, “max_prompt_tokens”: 8192, “supported_parameters”: [ “temperature”, “top_p”, “max_tokens”, “frequency_penalty”, “presence_penalty” ], “status”: “default”, “uptime_last_30m”: 99.5, “supports_implicit_caching”: true, “latency_last_30m”: {"p50": 0.25,"p75": 0.35,"p90": 0.48,"p99": 0.85},“throughput_last_30m”: {"p50": 45.2,"p75": 38.5,"p90": 28.3,"p99": 15.1}} ] } |