Example Usage
import { PublicEndpoint } from "@openrouter/sdk/models";
let value: PublicEndpoint = {
contextLength: 8192,
latencyLast30m: {
p50: 0.25,
p75: 0.35,
p90: 0.48,
p99: 0.85,
},
maxCompletionTokens: 4096,
maxPromptTokens: 8192,
modelId: "openai/gpt-4",
modelName: "GPT-4",
name: "OpenAI: GPT-4",
nativeTools: {
"openrouter:web_search": {
type: "web_search_20260209",
},
},
pricing: {
completion: "0.00006",
prompt: "0.00003",
},
providerName: "OpenAI",
quantization: "fp16",
serviceTier: null,
supportedParameters: [
"temperature",
"top_p",
"max_tokens",
],
supportsDiarization: false,
supportsImplicitCaching: true,
supportsToolChoice: {
auto: true,
function: true,
none: true,
required: true,
},
tag: "openai",
throughputLast30m: {
p50: 45.2,
p75: 38.5,
p90: 28.3,
p99: 15.1,
},
uptimeLast1d: 99.8,
uptimeLast30m: 99.5,
uptimeLast5m: 100,
};
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 | ✔️ | Maximum completion tokens for this endpoint. Input and output tokens share the context window, so the effective maximum output for a request is further limited by the context remaining after input tokens. | |
maxPromptTokens | number | ✔️ | N/A | |
modelId | string | ✔️ | The unique identifier for the model (permaslug) | openai/gpt-4 |
modelName | string | ✔️ | N/A | |
name | string | ✔️ | N/A | |
nativeTools | Record<string, models.NativeTools> | ✔️ | The server tools this endpoint accepts as the provider’s own built-in tool (engine: "native") instead of an OpenRouter engine, keyed by canonical openrouter:* name. Each value names the provider tool type the request is translated to. Where that tool runs (provider-side, or returned to the client as with Anthropic bash) is documented per tool. Empty when the provider has none. | { “openrouter:web_search”: { “type”: “web_search_20260209” } } |
perfLast30mByWorkload | models.PerfLast30mByWorkload | ➖ | Endpoint performance over the last 30 minutes, keyed by the kind of request served (e.g. text_generation, image_generation). Additive to the legacy singular latency and throughput fields; image and video generation report end-to-end latency. Only visible when authenticated with an API key or cookie. | |
pricing | models.Pricing | ✔️ | N/A | |
providerName | models.ProviderName | ✔️ | N/A | OpenAI |
quantization | models.Quantization | ✔️ | N/A | fp16 |
serviceTier | models.PublicServiceTier | ✔️ | The service tier this endpoint sells, or null for a standard endpoint. The same value whether the provider selects the tier with a request parameter or with a dedicated model id. Always the canonical tier: priority covers the fast request alias and the turbo, highspeed, and prime provider model-id spellings, none of which this field reports. | priority |
status | models.EndpointStatus | ➖ | N/A | 0 |
supportedParameters | models.Parameter[] | ✔️ | N/A | |
supportsDiarization | boolean | ✔️ | Whether this STT endpoint can label each transcript segment with a speaker (speaker diarization). For transcription endpoints, derived from the serving STT adapter: true when that adapter supports diarize: true for this model. Diarized requests also need response_format: verbose_json. | |
supportsImageReference | boolean | ➖ | Whether this TTS endpoint accepts an image_url reference describing the desired voice. Requests carrying an image reference are only routed to endpoints where this is true. | |
supportsImplicitCaching | boolean | ✔️ | N/A | |
supportsMultipleAudioReferences | boolean | ➖ | Whether this TTS endpoint accepts more than one input_audio reference clip per request. Requests carrying several clips are only routed to endpoints where this is true. | |
supportsToolChoice | models.ToolChoiceSupport | ✔️ | Per-variant tool_choice support. tool_choice in supported_parameters only says the parameter is accepted; these flags say which of its values passed testing. | { “auto”: true, “function”: true, “none”: true, “required”: true } |
supportsVoiceCloning | boolean | ➖ | Whether this TTS endpoint accepts inline reference audio (input_references) for stateless voice cloning. Requests carrying reference audio are only routed to endpoints where this is true. | |
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 day: the share of minutes in which at least 80% of provider attempts succeeded, counting only minutes with 10 or more attempts. Rate-limited and caller-caused failures are excluded. Null when no minute had enough traffic. | |
uptimeLast30m | number | ✔️ | N/A | |
uptimeLast5m | number | ✔️ | Uptime percentage over the last 5 minutes: the share of minutes in which at least 80% of provider attempts succeeded, counting only minutes with 10 or more attempts. Rate-limited and caller-caused failures are excluded. Null when no minute had enough traffic. |