PublicEndpoint - TypeScript SDK
PublicEndpoint - TypeScript SDK
PublicEndpoint type definition
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Information about a specific model endpoint
Example Usage
1 import { PublicEndpoint } from "@openrouter/sdk/models"; 2 3 let value: PublicEndpoint = { 4 contextLength: 8192, 5 latencyLast30m: { 6 p50: 0.25, 7 p75: 0.35, 8 p90: 0.48, 9 p99: 0.85, 10 }, 11 maxCompletionTokens: 4096, 12 maxPromptTokens: 8192, 13 modelId: "openai/gpt-4", 14 modelName: "GPT-4", 15 name: "OpenAI: GPT-4", 16 pricing: { 17 completion: "0.00006", 18 prompt: "0.00003", 19 }, 20 providerName: "OpenAI", 21 quantization: "fp16", 22 supportedParameters: [ 23 "temperature", 24 "top_p", 25 "max_tokens", 26 ], 27 supportsImplicitCaching: true, 28 tag: "openai", 29 throughputLast30m: { 30 p50: 45.2, 31 p75: 38.5, 32 p90: 28.3, 33 p99: 15.1, 34 }, 35 uptimeLast1d: 99.8, 36 uptimeLast30m: 99.5, 37 uptimeLast5m: 100, 38 };
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
contextLength | number | ✔️ | N/A | |
latencyLast30m | models.PercentileStats | ✔️ | Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. | {"p50": 25.5,"p75": 35.2,"p90": 48.7,"p99": 85.3} |
maxCompletionTokens | number | ✔️ | N/A | |
maxPromptTokens | number | ✔️ | N/A | |
modelId | string | ✔️ | The unique identifier for the model (permaslug) | openai/gpt-4 |
modelName | string | ✔️ | N/A | |
name | string | ✔️ | N/A | |
pricing | models.Pricing | ✔️ | N/A | |
providerName | models.ProviderName | ✔️ | N/A | OpenAI |
quantization | models.PublicEndpointQuantization | ✔️ | N/A | fp16 |
status | models.EndpointStatus | ➖ | N/A | 0 |
supportedParameters | models.Parameter[] | ✔️ | N/A | |
supportsImplicitCaching | boolean | ✔️ | N/A | |
tag | string | ✔️ | N/A | |
throughputLast30m | models.PercentileStats | ✔️ | N/A | {"p50": 25.5,"p75": 35.2,"p90": 48.7,"p99": 85.3} |
uptimeLast1d | number | ✔️ | Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. | |
uptimeLast30m | number | ✔️ | N/A | |
uptimeLast5m | number | ✔️ | Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. |