@openrouter/sdk 1.5.30 → 1.5.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/decisions.d.ts +16 -0
- package/esm/models/decisions.js +22 -0
- package/esm/models/embeddings.d.ts +16 -0
- package/esm/models/embeddings.js +23 -0
- package/esm/models/imagegeneration.d.ts +16 -0
- package/esm/models/imagegeneration.js +22 -0
- package/esm/models/index.d.ts +13 -0
- package/esm/models/index.js +13 -0
- package/esm/models/nativetools.d.ts +13 -0
- package/esm/models/nativetools.js +15 -0
- package/esm/models/operations/listendpointszdr.d.ts +1 -1
- package/esm/models/operations/listendpointszdr.js +2 -2
- package/esm/models/perflast30mbyworkload.d.ts +30 -0
- package/esm/models/perflast30mbyworkload.js +38 -0
- package/esm/models/pricing.d.ts +74 -0
- package/esm/models/pricing.js +43 -0
- package/esm/models/publicendpoint.d.ts +3 -195
- package/esm/models/publicendpoint.js +6 -186
- package/esm/models/publiczdrendpoint.d.ts +93 -0
- package/esm/models/publiczdrendpoint.js +76 -0
- package/esm/models/rerank.d.ts +16 -0
- package/esm/models/rerank.js +22 -0
- package/esm/models/stt.d.ts +16 -0
- package/esm/models/stt.js +22 -0
- package/esm/models/textgeneration.d.ts +16 -0
- package/esm/models/textgeneration.js +22 -0
- package/esm/models/tts.d.ts +16 -0
- package/esm/models/tts.js +22 -0
- package/esm/models/unknown.d.ts +16 -0
- package/esm/models/unknown.js +22 -0
- package/esm/models/videogeneration.d.ts +16 -0
- package/esm/models/videogeneration.js +22 -0
- package/jsr.json +1 -1
- package/package.json +6 -6
|
@@ -2,171 +2,15 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { EndpointStatus } from "./endpointstatus.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { NativeTools } from "./nativetools.js";
|
|
5
6
|
import { Parameter } from "./parameter.js";
|
|
6
7
|
import { PercentileStats } from "./percentilestats.js";
|
|
7
|
-
import {
|
|
8
|
+
import { PerfLast30mByWorkload } from "./perflast30mbyworkload.js";
|
|
9
|
+
import { Pricing } from "./pricing.js";
|
|
8
10
|
import { ProviderName } from "./providername.js";
|
|
9
11
|
import { PublicServiceTier } from "./publicservicetier.js";
|
|
10
12
|
import { Quantization } from "./quantization.js";
|
|
11
13
|
import { ToolChoiceSupport } from "./toolchoicesupport.js";
|
|
12
|
-
export type NativeTools = {
|
|
13
|
-
/**
|
|
14
|
-
* The provider tool type the request is translated to when this tool runs natively, e.g. `web_search_20260209` on Anthropic or `google_search` on Gemini.
|
|
15
|
-
*/
|
|
16
|
-
type: string;
|
|
17
|
-
};
|
|
18
|
-
export type Decisions = {
|
|
19
|
-
latency: PercentileStats | null;
|
|
20
|
-
/**
|
|
21
|
-
* Total requests admitted for this workload in the window.
|
|
22
|
-
*/
|
|
23
|
-
requestCount: number | null;
|
|
24
|
-
throughput: PercentileStats | null;
|
|
25
|
-
};
|
|
26
|
-
export type Embeddings = {
|
|
27
|
-
latency: PercentileStats | null;
|
|
28
|
-
/**
|
|
29
|
-
* Total requests admitted for this workload in the window.
|
|
30
|
-
*/
|
|
31
|
-
requestCount: number | null;
|
|
32
|
-
throughput: PercentileStats | null;
|
|
33
|
-
};
|
|
34
|
-
export type ImageGeneration = {
|
|
35
|
-
latency: PercentileStats | null;
|
|
36
|
-
/**
|
|
37
|
-
* Total requests admitted for this workload in the window.
|
|
38
|
-
*/
|
|
39
|
-
requestCount: number | null;
|
|
40
|
-
throughput: PercentileStats | null;
|
|
41
|
-
};
|
|
42
|
-
export type Rerank = {
|
|
43
|
-
latency: PercentileStats | null;
|
|
44
|
-
/**
|
|
45
|
-
* Total requests admitted for this workload in the window.
|
|
46
|
-
*/
|
|
47
|
-
requestCount: number | null;
|
|
48
|
-
throughput: PercentileStats | null;
|
|
49
|
-
};
|
|
50
|
-
export type STT = {
|
|
51
|
-
latency: PercentileStats | null;
|
|
52
|
-
/**
|
|
53
|
-
* Total requests admitted for this workload in the window.
|
|
54
|
-
*/
|
|
55
|
-
requestCount: number | null;
|
|
56
|
-
throughput: PercentileStats | null;
|
|
57
|
-
};
|
|
58
|
-
export type TextGeneration = {
|
|
59
|
-
latency: PercentileStats | null;
|
|
60
|
-
/**
|
|
61
|
-
* Total requests admitted for this workload in the window.
|
|
62
|
-
*/
|
|
63
|
-
requestCount: number | null;
|
|
64
|
-
throughput: PercentileStats | null;
|
|
65
|
-
};
|
|
66
|
-
export type TTS = {
|
|
67
|
-
latency: PercentileStats | null;
|
|
68
|
-
/**
|
|
69
|
-
* Total requests admitted for this workload in the window.
|
|
70
|
-
*/
|
|
71
|
-
requestCount: number | null;
|
|
72
|
-
throughput: PercentileStats | null;
|
|
73
|
-
};
|
|
74
|
-
export type Unknown = {
|
|
75
|
-
latency: PercentileStats | null;
|
|
76
|
-
/**
|
|
77
|
-
* Total requests admitted for this workload in the window.
|
|
78
|
-
*/
|
|
79
|
-
requestCount: number | null;
|
|
80
|
-
throughput: PercentileStats | null;
|
|
81
|
-
};
|
|
82
|
-
export type VideoGeneration = {
|
|
83
|
-
latency: PercentileStats | null;
|
|
84
|
-
/**
|
|
85
|
-
* Total requests admitted for this workload in the window.
|
|
86
|
-
*/
|
|
87
|
-
requestCount: number | null;
|
|
88
|
-
throughput: PercentileStats | null;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* 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.
|
|
92
|
-
*/
|
|
93
|
-
export type PerfLast30mByWorkload = {
|
|
94
|
-
decisions?: Decisions | undefined;
|
|
95
|
-
embeddings?: Embeddings | undefined;
|
|
96
|
-
imageGeneration?: ImageGeneration | undefined;
|
|
97
|
-
rerank?: Rerank | undefined;
|
|
98
|
-
stt?: STT | undefined;
|
|
99
|
-
textGeneration?: TextGeneration | undefined;
|
|
100
|
-
tts?: TTS | undefined;
|
|
101
|
-
unknown?: Unknown | undefined;
|
|
102
|
-
videoGeneration?: VideoGeneration | undefined;
|
|
103
|
-
};
|
|
104
|
-
export type Pricing = {
|
|
105
|
-
/**
|
|
106
|
-
* Price in USD per audio input token
|
|
107
|
-
*/
|
|
108
|
-
audio?: string | undefined;
|
|
109
|
-
/**
|
|
110
|
-
* Price in USD per audio output token
|
|
111
|
-
*/
|
|
112
|
-
audioOutput?: string | undefined;
|
|
113
|
-
/**
|
|
114
|
-
* Price in USD per token for completion (output) generation
|
|
115
|
-
*/
|
|
116
|
-
completion: string;
|
|
117
|
-
/**
|
|
118
|
-
* Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)
|
|
119
|
-
*/
|
|
120
|
-
discount?: number | undefined;
|
|
121
|
-
/**
|
|
122
|
-
* Price in USD per input image
|
|
123
|
-
*/
|
|
124
|
-
image?: string | undefined;
|
|
125
|
-
/**
|
|
126
|
-
* Price in USD per output image
|
|
127
|
-
*/
|
|
128
|
-
imageOutput?: string | undefined;
|
|
129
|
-
/**
|
|
130
|
-
* Price in USD per image token
|
|
131
|
-
*/
|
|
132
|
-
imageToken?: string | undefined;
|
|
133
|
-
/**
|
|
134
|
-
* Price in USD per cached audio input token
|
|
135
|
-
*/
|
|
136
|
-
inputAudioCache?: string | undefined;
|
|
137
|
-
/**
|
|
138
|
-
* Price in USD per cached input token (read)
|
|
139
|
-
*/
|
|
140
|
-
inputCacheRead?: string | undefined;
|
|
141
|
-
/**
|
|
142
|
-
* Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate.
|
|
143
|
-
*/
|
|
144
|
-
inputCacheWrite?: string | undefined;
|
|
145
|
-
/**
|
|
146
|
-
* Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic.
|
|
147
|
-
*/
|
|
148
|
-
inputCacheWrite1h?: string | undefined;
|
|
149
|
-
/**
|
|
150
|
-
* Price in USD per internal reasoning token
|
|
151
|
-
*/
|
|
152
|
-
internalReasoning?: string | undefined;
|
|
153
|
-
/**
|
|
154
|
-
* Conditional overrides of the base pricing (e.g. long-context or time-based pricing). An entry applies when all of its condition fields (e.g. min_prompt_tokens, or the utc_start/utc_end time window) match the request; among applicable entries, later entries win per key; price keys absent from an entry inherit the base price. The top-level pricing keys always reflect the price that applies under default conditions.
|
|
155
|
-
*/
|
|
156
|
-
overrides?: Array<PricingOverride> | undefined;
|
|
157
|
-
/**
|
|
158
|
-
* Price in USD per token for prompt (input) processing
|
|
159
|
-
*/
|
|
160
|
-
prompt: string;
|
|
161
|
-
/**
|
|
162
|
-
* Price in USD per request
|
|
163
|
-
*/
|
|
164
|
-
request?: string | undefined;
|
|
165
|
-
/**
|
|
166
|
-
* Price in USD per web search
|
|
167
|
-
*/
|
|
168
|
-
webSearch?: string | undefined;
|
|
169
|
-
};
|
|
170
14
|
/**
|
|
171
15
|
* Information about a specific model endpoint
|
|
172
16
|
*/
|
|
@@ -240,42 +84,6 @@ export type PublicEndpoint = {
|
|
|
240
84
|
uptimeLast5m: number | null;
|
|
241
85
|
};
|
|
242
86
|
/** @internal */
|
|
243
|
-
export declare const NativeTools$inboundSchema: z.ZodType<NativeTools, unknown>;
|
|
244
|
-
export declare function nativeToolsFromJSON(jsonString: string): SafeParseResult<NativeTools, SDKValidationError>;
|
|
245
|
-
/** @internal */
|
|
246
|
-
export declare const Decisions$inboundSchema: z.ZodType<Decisions, unknown>;
|
|
247
|
-
export declare function decisionsFromJSON(jsonString: string): SafeParseResult<Decisions, SDKValidationError>;
|
|
248
|
-
/** @internal */
|
|
249
|
-
export declare const Embeddings$inboundSchema: z.ZodType<Embeddings, unknown>;
|
|
250
|
-
export declare function embeddingsFromJSON(jsonString: string): SafeParseResult<Embeddings, SDKValidationError>;
|
|
251
|
-
/** @internal */
|
|
252
|
-
export declare const ImageGeneration$inboundSchema: z.ZodType<ImageGeneration, unknown>;
|
|
253
|
-
export declare function imageGenerationFromJSON(jsonString: string): SafeParseResult<ImageGeneration, SDKValidationError>;
|
|
254
|
-
/** @internal */
|
|
255
|
-
export declare const Rerank$inboundSchema: z.ZodType<Rerank, unknown>;
|
|
256
|
-
export declare function rerankFromJSON(jsonString: string): SafeParseResult<Rerank, SDKValidationError>;
|
|
257
|
-
/** @internal */
|
|
258
|
-
export declare const STT$inboundSchema: z.ZodType<STT, unknown>;
|
|
259
|
-
export declare function sttFromJSON(jsonString: string): SafeParseResult<STT, SDKValidationError>;
|
|
260
|
-
/** @internal */
|
|
261
|
-
export declare const TextGeneration$inboundSchema: z.ZodType<TextGeneration, unknown>;
|
|
262
|
-
export declare function textGenerationFromJSON(jsonString: string): SafeParseResult<TextGeneration, SDKValidationError>;
|
|
263
|
-
/** @internal */
|
|
264
|
-
export declare const TTS$inboundSchema: z.ZodType<TTS, unknown>;
|
|
265
|
-
export declare function ttsFromJSON(jsonString: string): SafeParseResult<TTS, SDKValidationError>;
|
|
266
|
-
/** @internal */
|
|
267
|
-
export declare const Unknown$inboundSchema: z.ZodType<Unknown, unknown>;
|
|
268
|
-
export declare function unknownFromJSON(jsonString: string): SafeParseResult<Unknown, SDKValidationError>;
|
|
269
|
-
/** @internal */
|
|
270
|
-
export declare const VideoGeneration$inboundSchema: z.ZodType<VideoGeneration, unknown>;
|
|
271
|
-
export declare function videoGenerationFromJSON(jsonString: string): SafeParseResult<VideoGeneration, SDKValidationError>;
|
|
272
|
-
/** @internal */
|
|
273
|
-
export declare const PerfLast30mByWorkload$inboundSchema: z.ZodType<PerfLast30mByWorkload, unknown>;
|
|
274
|
-
export declare function perfLast30mByWorkloadFromJSON(jsonString: string): SafeParseResult<PerfLast30mByWorkload, SDKValidationError>;
|
|
275
|
-
/** @internal */
|
|
276
|
-
export declare const Pricing$inboundSchema: z.ZodType<Pricing, unknown>;
|
|
277
|
-
export declare function pricingFromJSON(jsonString: string): SafeParseResult<Pricing, SDKValidationError>;
|
|
278
|
-
/** @internal */
|
|
279
87
|
export declare const PublicEndpoint$inboundSchema: z.ZodType<PublicEndpoint, unknown>;
|
|
280
88
|
export declare function publicEndpointFromJSON(jsonString: string): SafeParseResult<PublicEndpoint, SDKValidationError>;
|
|
281
89
|
//# sourceMappingURL=publicendpoint.d.ts.map
|
|
@@ -6,195 +6,16 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { EndpointStatus$inboundSchema, } from "./endpointstatus.js";
|
|
9
|
+
import { NativeTools$inboundSchema } from "./nativetools.js";
|
|
9
10
|
import { Parameter$inboundSchema } from "./parameter.js";
|
|
10
11
|
import { PercentileStats$inboundSchema, } from "./percentilestats.js";
|
|
11
|
-
import {
|
|
12
|
+
import { PerfLast30mByWorkload$inboundSchema, } from "./perflast30mbyworkload.js";
|
|
13
|
+
import { Pricing$inboundSchema } from "./pricing.js";
|
|
12
14
|
import { ProviderName$inboundSchema } from "./providername.js";
|
|
13
15
|
import { PublicServiceTier$inboundSchema, } from "./publicservicetier.js";
|
|
14
16
|
import { Quantization$inboundSchema } from "./quantization.js";
|
|
15
17
|
import { ToolChoiceSupport$inboundSchema, } from "./toolchoicesupport.js";
|
|
16
18
|
/** @internal */
|
|
17
|
-
export const NativeTools$inboundSchema = z
|
|
18
|
-
.object({
|
|
19
|
-
type: z.string(),
|
|
20
|
-
});
|
|
21
|
-
export function nativeToolsFromJSON(jsonString) {
|
|
22
|
-
return safeParse(jsonString, (x) => NativeTools$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NativeTools' from JSON`);
|
|
23
|
-
}
|
|
24
|
-
/** @internal */
|
|
25
|
-
export const Decisions$inboundSchema = z.object({
|
|
26
|
-
latency: z.nullable(PercentileStats$inboundSchema),
|
|
27
|
-
request_count: z.nullable(z.int()),
|
|
28
|
-
throughput: z.nullable(PercentileStats$inboundSchema),
|
|
29
|
-
}).transform((v) => {
|
|
30
|
-
return remap$(v, {
|
|
31
|
-
"request_count": "requestCount",
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
export function decisionsFromJSON(jsonString) {
|
|
35
|
-
return safeParse(jsonString, (x) => Decisions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Decisions' from JSON`);
|
|
36
|
-
}
|
|
37
|
-
/** @internal */
|
|
38
|
-
export const Embeddings$inboundSchema = z
|
|
39
|
-
.object({
|
|
40
|
-
latency: z.nullable(PercentileStats$inboundSchema),
|
|
41
|
-
request_count: z.nullable(z.int()),
|
|
42
|
-
throughput: z.nullable(PercentileStats$inboundSchema),
|
|
43
|
-
}).transform((v) => {
|
|
44
|
-
return remap$(v, {
|
|
45
|
-
"request_count": "requestCount",
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
export function embeddingsFromJSON(jsonString) {
|
|
49
|
-
return safeParse(jsonString, (x) => Embeddings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Embeddings' from JSON`);
|
|
50
|
-
}
|
|
51
|
-
/** @internal */
|
|
52
|
-
export const ImageGeneration$inboundSchema = z.object({
|
|
53
|
-
latency: z.nullable(PercentileStats$inboundSchema),
|
|
54
|
-
request_count: z.nullable(z.int()),
|
|
55
|
-
throughput: z.nullable(PercentileStats$inboundSchema),
|
|
56
|
-
}).transform((v) => {
|
|
57
|
-
return remap$(v, {
|
|
58
|
-
"request_count": "requestCount",
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
export function imageGenerationFromJSON(jsonString) {
|
|
62
|
-
return safeParse(jsonString, (x) => ImageGeneration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImageGeneration' from JSON`);
|
|
63
|
-
}
|
|
64
|
-
/** @internal */
|
|
65
|
-
export const Rerank$inboundSchema = z.object({
|
|
66
|
-
latency: z.nullable(PercentileStats$inboundSchema),
|
|
67
|
-
request_count: z.nullable(z.int()),
|
|
68
|
-
throughput: z.nullable(PercentileStats$inboundSchema),
|
|
69
|
-
}).transform((v) => {
|
|
70
|
-
return remap$(v, {
|
|
71
|
-
"request_count": "requestCount",
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
export function rerankFromJSON(jsonString) {
|
|
75
|
-
return safeParse(jsonString, (x) => Rerank$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Rerank' from JSON`);
|
|
76
|
-
}
|
|
77
|
-
/** @internal */
|
|
78
|
-
export const STT$inboundSchema = z.object({
|
|
79
|
-
latency: z.nullable(PercentileStats$inboundSchema),
|
|
80
|
-
request_count: z.nullable(z.int()),
|
|
81
|
-
throughput: z.nullable(PercentileStats$inboundSchema),
|
|
82
|
-
}).transform((v) => {
|
|
83
|
-
return remap$(v, {
|
|
84
|
-
"request_count": "requestCount",
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
export function sttFromJSON(jsonString) {
|
|
88
|
-
return safeParse(jsonString, (x) => STT$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'STT' from JSON`);
|
|
89
|
-
}
|
|
90
|
-
/** @internal */
|
|
91
|
-
export const TextGeneration$inboundSchema = z.object({
|
|
92
|
-
latency: z.nullable(PercentileStats$inboundSchema),
|
|
93
|
-
request_count: z.nullable(z.int()),
|
|
94
|
-
throughput: z.nullable(PercentileStats$inboundSchema),
|
|
95
|
-
}).transform((v) => {
|
|
96
|
-
return remap$(v, {
|
|
97
|
-
"request_count": "requestCount",
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
export function textGenerationFromJSON(jsonString) {
|
|
101
|
-
return safeParse(jsonString, (x) => TextGeneration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextGeneration' from JSON`);
|
|
102
|
-
}
|
|
103
|
-
/** @internal */
|
|
104
|
-
export const TTS$inboundSchema = z.object({
|
|
105
|
-
latency: z.nullable(PercentileStats$inboundSchema),
|
|
106
|
-
request_count: z.nullable(z.int()),
|
|
107
|
-
throughput: z.nullable(PercentileStats$inboundSchema),
|
|
108
|
-
}).transform((v) => {
|
|
109
|
-
return remap$(v, {
|
|
110
|
-
"request_count": "requestCount",
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
export function ttsFromJSON(jsonString) {
|
|
114
|
-
return safeParse(jsonString, (x) => TTS$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TTS' from JSON`);
|
|
115
|
-
}
|
|
116
|
-
/** @internal */
|
|
117
|
-
export const Unknown$inboundSchema = z.object({
|
|
118
|
-
latency: z.nullable(PercentileStats$inboundSchema),
|
|
119
|
-
request_count: z.nullable(z.int()),
|
|
120
|
-
throughput: z.nullable(PercentileStats$inboundSchema),
|
|
121
|
-
}).transform((v) => {
|
|
122
|
-
return remap$(v, {
|
|
123
|
-
"request_count": "requestCount",
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
export function unknownFromJSON(jsonString) {
|
|
127
|
-
return safeParse(jsonString, (x) => Unknown$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Unknown' from JSON`);
|
|
128
|
-
}
|
|
129
|
-
/** @internal */
|
|
130
|
-
export const VideoGeneration$inboundSchema = z.object({
|
|
131
|
-
latency: z.nullable(PercentileStats$inboundSchema),
|
|
132
|
-
request_count: z.nullable(z.int()),
|
|
133
|
-
throughput: z.nullable(PercentileStats$inboundSchema),
|
|
134
|
-
}).transform((v) => {
|
|
135
|
-
return remap$(v, {
|
|
136
|
-
"request_count": "requestCount",
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
export function videoGenerationFromJSON(jsonString) {
|
|
140
|
-
return safeParse(jsonString, (x) => VideoGeneration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VideoGeneration' from JSON`);
|
|
141
|
-
}
|
|
142
|
-
/** @internal */
|
|
143
|
-
export const PerfLast30mByWorkload$inboundSchema = z.object({
|
|
144
|
-
decisions: z.lazy(() => Decisions$inboundSchema).optional(),
|
|
145
|
-
embeddings: z.lazy(() => Embeddings$inboundSchema).optional(),
|
|
146
|
-
image_generation: z.lazy(() => ImageGeneration$inboundSchema).optional(),
|
|
147
|
-
rerank: z.lazy(() => Rerank$inboundSchema).optional(),
|
|
148
|
-
stt: z.lazy(() => STT$inboundSchema).optional(),
|
|
149
|
-
text_generation: z.lazy(() => TextGeneration$inboundSchema).optional(),
|
|
150
|
-
tts: z.lazy(() => TTS$inboundSchema).optional(),
|
|
151
|
-
unknown: z.lazy(() => Unknown$inboundSchema).optional(),
|
|
152
|
-
video_generation: z.lazy(() => VideoGeneration$inboundSchema).optional(),
|
|
153
|
-
}).transform((v) => {
|
|
154
|
-
return remap$(v, {
|
|
155
|
-
"image_generation": "imageGeneration",
|
|
156
|
-
"text_generation": "textGeneration",
|
|
157
|
-
"video_generation": "videoGeneration",
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
export function perfLast30mByWorkloadFromJSON(jsonString) {
|
|
161
|
-
return safeParse(jsonString, (x) => PerfLast30mByWorkload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PerfLast30mByWorkload' from JSON`);
|
|
162
|
-
}
|
|
163
|
-
/** @internal */
|
|
164
|
-
export const Pricing$inboundSchema = z.object({
|
|
165
|
-
audio: z.string().optional(),
|
|
166
|
-
audio_output: z.string().optional(),
|
|
167
|
-
completion: z.string(),
|
|
168
|
-
discount: z.number().optional(),
|
|
169
|
-
image: z.string().optional(),
|
|
170
|
-
image_output: z.string().optional(),
|
|
171
|
-
image_token: z.string().optional(),
|
|
172
|
-
input_audio_cache: z.string().optional(),
|
|
173
|
-
input_cache_read: z.string().optional(),
|
|
174
|
-
input_cache_write: z.string().optional(),
|
|
175
|
-
input_cache_write_1h: z.string().optional(),
|
|
176
|
-
internal_reasoning: z.string().optional(),
|
|
177
|
-
overrides: z.array(PricingOverride$inboundSchema).optional(),
|
|
178
|
-
prompt: z.string(),
|
|
179
|
-
request: z.string().optional(),
|
|
180
|
-
web_search: z.string().optional(),
|
|
181
|
-
}).transform((v) => {
|
|
182
|
-
return remap$(v, {
|
|
183
|
-
"audio_output": "audioOutput",
|
|
184
|
-
"image_output": "imageOutput",
|
|
185
|
-
"image_token": "imageToken",
|
|
186
|
-
"input_audio_cache": "inputAudioCache",
|
|
187
|
-
"input_cache_read": "inputCacheRead",
|
|
188
|
-
"input_cache_write": "inputCacheWrite",
|
|
189
|
-
"input_cache_write_1h": "inputCacheWrite1h",
|
|
190
|
-
"internal_reasoning": "internalReasoning",
|
|
191
|
-
"web_search": "webSearch",
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
export function pricingFromJSON(jsonString) {
|
|
195
|
-
return safeParse(jsonString, (x) => Pricing$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Pricing' from JSON`);
|
|
196
|
-
}
|
|
197
|
-
/** @internal */
|
|
198
19
|
export const PublicEndpoint$inboundSchema = z.object({
|
|
199
20
|
context_length: z.int(),
|
|
200
21
|
latency_last_30m: z.nullable(PercentileStats$inboundSchema),
|
|
@@ -203,10 +24,9 @@ export const PublicEndpoint$inboundSchema = z.object({
|
|
|
203
24
|
model_id: z.string(),
|
|
204
25
|
model_name: z.string(),
|
|
205
26
|
name: z.string(),
|
|
206
|
-
native_tools: z.record(z.string(),
|
|
207
|
-
perf_last_30m_by_workload:
|
|
208
|
-
|
|
209
|
-
pricing: z.lazy(() => Pricing$inboundSchema),
|
|
27
|
+
native_tools: z.record(z.string(), NativeTools$inboundSchema),
|
|
28
|
+
perf_last_30m_by_workload: PerfLast30mByWorkload$inboundSchema.optional(),
|
|
29
|
+
pricing: Pricing$inboundSchema,
|
|
210
30
|
provider_name: ProviderName$inboundSchema,
|
|
211
31
|
quantization: z.nullable(Quantization$inboundSchema),
|
|
212
32
|
service_tier: z.nullable(PublicServiceTier$inboundSchema),
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { EndpointStatus } from "./endpointstatus.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { NativeTools } from "./nativetools.js";
|
|
6
|
+
import { Parameter } from "./parameter.js";
|
|
7
|
+
import { PercentileStats } from "./percentilestats.js";
|
|
8
|
+
import { PerfLast30mByWorkload } from "./perflast30mbyworkload.js";
|
|
9
|
+
import { Pricing } from "./pricing.js";
|
|
10
|
+
import { ProviderName } from "./providername.js";
|
|
11
|
+
import { PublicServiceTier } from "./publicservicetier.js";
|
|
12
|
+
import { Quantization } from "./quantization.js";
|
|
13
|
+
import { ToolChoiceSupport } from "./toolchoicesupport.js";
|
|
14
|
+
/**
|
|
15
|
+
* An endpoint whose data policy does not retain prompts by default
|
|
16
|
+
*/
|
|
17
|
+
export type PublicZdrEndpoint = {
|
|
18
|
+
contextLength: number;
|
|
19
|
+
/**
|
|
20
|
+
* 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.
|
|
21
|
+
*/
|
|
22
|
+
latencyLast30m: PercentileStats | null;
|
|
23
|
+
/**
|
|
24
|
+
* 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.
|
|
25
|
+
*/
|
|
26
|
+
maxCompletionTokens: number | null;
|
|
27
|
+
maxPromptTokens: number | null;
|
|
28
|
+
/**
|
|
29
|
+
* The unique identifier for the model (permaslug)
|
|
30
|
+
*/
|
|
31
|
+
modelId: string;
|
|
32
|
+
modelName: string;
|
|
33
|
+
name: string;
|
|
34
|
+
/**
|
|
35
|
+
* 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.
|
|
36
|
+
*/
|
|
37
|
+
nativeTools: {
|
|
38
|
+
[k: string]: NativeTools;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* 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.
|
|
42
|
+
*/
|
|
43
|
+
perfLast30mByWorkload?: PerfLast30mByWorkload | undefined;
|
|
44
|
+
pricing: Pricing;
|
|
45
|
+
providerName: ProviderName;
|
|
46
|
+
quantization: Quantization | null;
|
|
47
|
+
/**
|
|
48
|
+
* 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.
|
|
49
|
+
*/
|
|
50
|
+
serviceTier: PublicServiceTier | null;
|
|
51
|
+
status?: EndpointStatus | undefined;
|
|
52
|
+
supportedParameters: Array<Parameter>;
|
|
53
|
+
/**
|
|
54
|
+
* Whether this STT endpoint can label each transcript segment with a speaker (speaker diarization). False when the endpoint has not declared support.
|
|
55
|
+
*/
|
|
56
|
+
supportsDiarization: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* 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.
|
|
59
|
+
*/
|
|
60
|
+
supportsImageReference: boolean;
|
|
61
|
+
supportsImplicitCaching: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* 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.
|
|
64
|
+
*/
|
|
65
|
+
supportsMultipleAudioReferences: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* 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.
|
|
68
|
+
*/
|
|
69
|
+
supportsToolChoice: ToolChoiceSupport;
|
|
70
|
+
/**
|
|
71
|
+
* 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.
|
|
72
|
+
*/
|
|
73
|
+
supportsVoiceCloning: boolean;
|
|
74
|
+
tag: string;
|
|
75
|
+
throughputLast30m: PercentileStats | null;
|
|
76
|
+
/**
|
|
77
|
+
* 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.
|
|
78
|
+
*/
|
|
79
|
+
uptimeLast1d: number | null;
|
|
80
|
+
uptimeLast30m: number | null;
|
|
81
|
+
/**
|
|
82
|
+
* 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.
|
|
83
|
+
*/
|
|
84
|
+
uptimeLast5m: number | null;
|
|
85
|
+
/**
|
|
86
|
+
* Whether the endpoint uses Safety Retention: prompts are not retained by default, but the provider may retain prompts its safety classifiers flag. A ZDR-enforced request reaches these endpoints only when the account allows Safety Retention and no applied guardrail disallows it.
|
|
87
|
+
*/
|
|
88
|
+
safetyRetention: boolean;
|
|
89
|
+
};
|
|
90
|
+
/** @internal */
|
|
91
|
+
export declare const PublicZdrEndpoint$inboundSchema: z.ZodType<PublicZdrEndpoint, unknown>;
|
|
92
|
+
export declare function publicZdrEndpointFromJSON(jsonString: string): SafeParseResult<PublicZdrEndpoint, SDKValidationError>;
|
|
93
|
+
//# sourceMappingURL=publiczdrendpoint.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 965276f8cd2f
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { EndpointStatus$inboundSchema, } from "./endpointstatus.js";
|
|
9
|
+
import { NativeTools$inboundSchema } from "./nativetools.js";
|
|
10
|
+
import { Parameter$inboundSchema } from "./parameter.js";
|
|
11
|
+
import { PercentileStats$inboundSchema, } from "./percentilestats.js";
|
|
12
|
+
import { PerfLast30mByWorkload$inboundSchema, } from "./perflast30mbyworkload.js";
|
|
13
|
+
import { Pricing$inboundSchema } from "./pricing.js";
|
|
14
|
+
import { ProviderName$inboundSchema } from "./providername.js";
|
|
15
|
+
import { PublicServiceTier$inboundSchema, } from "./publicservicetier.js";
|
|
16
|
+
import { Quantization$inboundSchema } from "./quantization.js";
|
|
17
|
+
import { ToolChoiceSupport$inboundSchema, } from "./toolchoicesupport.js";
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const PublicZdrEndpoint$inboundSchema = z.object({
|
|
20
|
+
context_length: z.int(),
|
|
21
|
+
latency_last_30m: z.nullable(PercentileStats$inboundSchema),
|
|
22
|
+
max_completion_tokens: z.nullable(z.int()),
|
|
23
|
+
max_prompt_tokens: z.nullable(z.int()),
|
|
24
|
+
model_id: z.string(),
|
|
25
|
+
model_name: z.string(),
|
|
26
|
+
name: z.string(),
|
|
27
|
+
native_tools: z.record(z.string(), NativeTools$inboundSchema),
|
|
28
|
+
perf_last_30m_by_workload: PerfLast30mByWorkload$inboundSchema.optional(),
|
|
29
|
+
pricing: Pricing$inboundSchema,
|
|
30
|
+
provider_name: ProviderName$inboundSchema,
|
|
31
|
+
quantization: z.nullable(Quantization$inboundSchema),
|
|
32
|
+
service_tier: z.nullable(PublicServiceTier$inboundSchema),
|
|
33
|
+
status: EndpointStatus$inboundSchema.optional(),
|
|
34
|
+
supported_parameters: z.array(Parameter$inboundSchema),
|
|
35
|
+
supports_diarization: z.boolean(),
|
|
36
|
+
supports_image_reference: z.boolean().default(false),
|
|
37
|
+
supports_implicit_caching: z.boolean(),
|
|
38
|
+
supports_multiple_audio_references: z.boolean().default(false),
|
|
39
|
+
supports_tool_choice: ToolChoiceSupport$inboundSchema,
|
|
40
|
+
supports_voice_cloning: z.boolean().default(false),
|
|
41
|
+
tag: z.string(),
|
|
42
|
+
throughput_last_30m: z.nullable(PercentileStats$inboundSchema),
|
|
43
|
+
uptime_last_1d: z.nullable(z.number()),
|
|
44
|
+
uptime_last_30m: z.nullable(z.number()),
|
|
45
|
+
uptime_last_5m: z.nullable(z.number()),
|
|
46
|
+
safety_retention: z.boolean(),
|
|
47
|
+
}).transform((v) => {
|
|
48
|
+
return remap$(v, {
|
|
49
|
+
"context_length": "contextLength",
|
|
50
|
+
"latency_last_30m": "latencyLast30m",
|
|
51
|
+
"max_completion_tokens": "maxCompletionTokens",
|
|
52
|
+
"max_prompt_tokens": "maxPromptTokens",
|
|
53
|
+
"model_id": "modelId",
|
|
54
|
+
"model_name": "modelName",
|
|
55
|
+
"native_tools": "nativeTools",
|
|
56
|
+
"perf_last_30m_by_workload": "perfLast30mByWorkload",
|
|
57
|
+
"provider_name": "providerName",
|
|
58
|
+
"service_tier": "serviceTier",
|
|
59
|
+
"supported_parameters": "supportedParameters",
|
|
60
|
+
"supports_diarization": "supportsDiarization",
|
|
61
|
+
"supports_image_reference": "supportsImageReference",
|
|
62
|
+
"supports_implicit_caching": "supportsImplicitCaching",
|
|
63
|
+
"supports_multiple_audio_references": "supportsMultipleAudioReferences",
|
|
64
|
+
"supports_tool_choice": "supportsToolChoice",
|
|
65
|
+
"supports_voice_cloning": "supportsVoiceCloning",
|
|
66
|
+
"throughput_last_30m": "throughputLast30m",
|
|
67
|
+
"uptime_last_1d": "uptimeLast1d",
|
|
68
|
+
"uptime_last_30m": "uptimeLast30m",
|
|
69
|
+
"uptime_last_5m": "uptimeLast5m",
|
|
70
|
+
"safety_retention": "safetyRetention",
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
export function publicZdrEndpointFromJSON(jsonString) {
|
|
74
|
+
return safeParse(jsonString, (x) => PublicZdrEndpoint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PublicZdrEndpoint' from JSON`);
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=publiczdrendpoint.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { PercentileStats } from "./percentilestats.js";
|
|
5
|
+
export type Rerank = {
|
|
6
|
+
latency: PercentileStats | null;
|
|
7
|
+
/**
|
|
8
|
+
* Total requests admitted for this workload in the window.
|
|
9
|
+
*/
|
|
10
|
+
requestCount: number | null;
|
|
11
|
+
throughput: PercentileStats | null;
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const Rerank$inboundSchema: z.ZodType<Rerank, unknown>;
|
|
15
|
+
export declare function rerankFromJSON(jsonString: string): SafeParseResult<Rerank, SDKValidationError>;
|
|
16
|
+
//# sourceMappingURL=rerank.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 2b9cb6c3de15
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { PercentileStats$inboundSchema, } from "./percentilestats.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const Rerank$inboundSchema = z.object({
|
|
11
|
+
latency: z.nullable(PercentileStats$inboundSchema),
|
|
12
|
+
request_count: z.nullable(z.int()),
|
|
13
|
+
throughput: z.nullable(PercentileStats$inboundSchema),
|
|
14
|
+
}).transform((v) => {
|
|
15
|
+
return remap$(v, {
|
|
16
|
+
"request_count": "requestCount",
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
export function rerankFromJSON(jsonString) {
|
|
20
|
+
return safeParse(jsonString, (x) => Rerank$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Rerank' from JSON`);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=rerank.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { PercentileStats } from "./percentilestats.js";
|
|
5
|
+
export type STT = {
|
|
6
|
+
latency: PercentileStats | null;
|
|
7
|
+
/**
|
|
8
|
+
* Total requests admitted for this workload in the window.
|
|
9
|
+
*/
|
|
10
|
+
requestCount: number | null;
|
|
11
|
+
throughput: PercentileStats | null;
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const STT$inboundSchema: z.ZodType<STT, unknown>;
|
|
15
|
+
export declare function sttFromJSON(jsonString: string): SafeParseResult<STT, SDKValidationError>;
|
|
16
|
+
//# sourceMappingURL=stt.d.ts.map
|