PublicEndpoint - TypeScript SDK

PublicEndpoint method reference

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 name: "OpenAI: GPT-4",
5 modelId: "openai/gpt-4",
6 modelName: "GPT-4",
7 contextLength: 8192,
8 pricing: {
9 prompt: "0.00003",
10 completion: "0.00006",
11 },
12 providerName: "OpenAI",
13 tag: "openai",
14 quantization: "fp16",
15 maxCompletionTokens: 4096,
16 maxPromptTokens: 8192,
17 supportedParameters: [
18 "temperature",
19 "top_p",
20 "max_tokens",
21 ],
22 uptimeLast30m: 99.5,
23 supportsImplicitCaching: true,
24 latencyLast30m: {
25 p50: 0.25,
26 p75: 0.35,
27 p90: 0.48,
28 p99: 0.85,
29 },
30 throughputLast30m: {
31 p50: 45.2,
32 p75: 38.5,
33 p90: 28.3,
34 p99: 15.1,
35 },
36};

Fields

FieldTypeRequiredDescriptionExample
namestring✔️N/A
modelIdstring✔️The unique identifier for the model (permaslug)openai/gpt-4
modelNamestring✔️N/A
contextLengthnumber✔️N/A
pricingmodels.Pricing✔️N/A
providerNamemodels.ProviderName✔️N/AOpenAI
tagstring✔️N/A
quantizationmodels.PublicEndpointQuantization✔️N/Afp16
maxCompletionTokensnumber✔️N/A
maxPromptTokensnumber✔️N/A
supportedParametersmodels.Parameter[]✔️N/A
statusmodels.EndpointStatusN/A0
uptimeLast30mnumber✔️N/A
supportsImplicitCachingboolean✔️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.
throughputLast30mmodels.PercentileStats✔️N/A