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

1import { PublicEndpoint } from "@openrouter/sdk/models";
2
3let 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

FieldTypeRequiredDescriptionExample
contextLengthnumber✔️N/A
latencyLast30mmodels.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}
maxCompletionTokensnumber✔️N/A
maxPromptTokensnumber✔️N/A
modelIdstring✔️The unique identifier for the model (permaslug)openai/gpt-4
modelNamestring✔️N/A
namestring✔️N/A
pricingmodels.Pricing✔️N/A
providerNamemodels.ProviderName✔️N/AOpenAI
quantizationmodels.PublicEndpointQuantization✔️N/Afp16
statusmodels.EndpointStatusN/A0
supportedParametersmodels.Parameter[]✔️N/A
supportsImplicitCachingboolean✔️N/A
tagstring✔️N/A
throughputLast30mmodels.PercentileStats✔️N/A{"p50": 25.5,"p75": 35.2,"p90": 48.7,"p99": 85.3}
uptimeLast1dnumber✔️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.
uptimeLast30mnumber✔️N/A
uptimeLast5mnumber✔️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.