@openrouter/sdk 0.3.12 → 0.3.14

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.
Files changed (59) hide show
  1. package/esm/lib/anthropic-compat.test.js +3 -0
  2. package/esm/lib/chat-compat.test.js +3 -0
  3. package/esm/lib/config.d.ts +2 -2
  4. package/esm/lib/config.js +2 -2
  5. package/esm/lib/tool-types.d.ts +1 -1
  6. package/esm/models/chatgenerationparams.d.ts +93 -12
  7. package/esm/models/chatgenerationparams.js +75 -6
  8. package/esm/models/chatgenerationtokenusage.d.ts +1 -0
  9. package/esm/models/chatgenerationtokenusage.js +2 -0
  10. package/esm/models/chatmessagetokenlogprob.d.ts +4 -4
  11. package/esm/models/chatmessagetokenlogprob.js +4 -5
  12. package/esm/models/index.d.ts +7 -0
  13. package/esm/models/index.js +7 -0
  14. package/esm/models/openairesponsesinputunion.d.ts +15 -5
  15. package/esm/models/openairesponsesinputunion.js +5 -5
  16. package/esm/models/openresponseseasyinputmessage.d.ts +41 -16
  17. package/esm/models/openresponseseasyinputmessage.js +38 -13
  18. package/esm/models/openresponsesinputmessageitem.d.ts +37 -12
  19. package/esm/models/openresponsesinputmessageitem.js +33 -9
  20. package/esm/models/openresponsesnonstreamingresponse.d.ts +5 -2
  21. package/esm/models/openresponsesnonstreamingresponse.js +8 -2
  22. package/esm/models/openresponsesreasoning.d.ts +1 -0
  23. package/esm/models/openresponsesreasoning.js +1 -0
  24. package/esm/models/openresponsesrequest.d.ts +61 -24
  25. package/esm/models/openresponsesrequest.js +39 -6
  26. package/esm/models/operations/getgeneration.d.ts +4 -0
  27. package/esm/models/operations/getgeneration.js +1 -0
  28. package/esm/models/percentilelatencycutoffs.d.ts +33 -0
  29. package/esm/models/percentilelatencycutoffs.js +16 -0
  30. package/esm/models/percentilestats.d.ts +28 -0
  31. package/esm/models/percentilestats.js +17 -0
  32. package/esm/models/percentilethroughputcutoffs.d.ts +33 -0
  33. package/esm/models/percentilethroughputcutoffs.js +16 -0
  34. package/esm/models/preferredmaxlatency.d.ts +12 -0
  35. package/esm/models/preferredmaxlatency.js +12 -0
  36. package/esm/models/preferredminthroughput.d.ts +12 -0
  37. package/esm/models/preferredminthroughput.js +12 -0
  38. package/esm/models/providername.d.ts +3 -2
  39. package/esm/models/providername.js +3 -2
  40. package/esm/models/providerpreferences.d.ts +8 -20
  41. package/esm/models/providerpreferences.js +6 -6
  42. package/esm/models/publicendpoint.d.ts +6 -0
  43. package/esm/models/publicendpoint.js +5 -0
  44. package/esm/models/responseinputimage.d.ts +11 -3
  45. package/esm/models/responseinputimage.js +9 -2
  46. package/esm/models/responseinputvideo.d.ts +20 -0
  47. package/esm/models/responseinputvideo.js +19 -0
  48. package/esm/models/responseoutputtext.d.ts +38 -0
  49. package/esm/models/responseoutputtext.js +50 -0
  50. package/esm/models/responsesoutputitemreasoning.d.ts +30 -1
  51. package/esm/models/responsesoutputitemreasoning.js +22 -0
  52. package/esm/models/responsesoutputmodality.d.ts +10 -0
  53. package/esm/models/responsesoutputmodality.js +12 -0
  54. package/esm/models/schema0.d.ts +3 -2
  55. package/esm/models/schema0.js +3 -2
  56. package/esm/models/schema3.d.ts +1 -0
  57. package/esm/models/schema3.js +1 -0
  58. package/jsr.json +1 -1
  59. package/package.json +1 -1
@@ -17,10 +17,13 @@ import { OpenResponsesWebSearchPreview20250311Tool$outboundSchema, } from "./ope
17
17
  import { OpenResponsesWebSearchPreviewTool$outboundSchema, } from "./openresponseswebsearchpreviewtool.js";
18
18
  import { OpenResponsesWebSearchTool$outboundSchema, } from "./openresponseswebsearchtool.js";
19
19
  import { PDFParserOptions$outboundSchema, } from "./pdfparseroptions.js";
20
+ import { PreferredMaxLatency$outboundSchema, } from "./preferredmaxlatency.js";
21
+ import { PreferredMinThroughput$outboundSchema, } from "./preferredminthroughput.js";
20
22
  import { ProviderName$outboundSchema } from "./providername.js";
21
23
  import { ProviderSort$outboundSchema } from "./providersort.js";
22
24
  import { ProviderSortConfig$outboundSchema, } from "./providersortconfig.js";
23
25
  import { Quantization$outboundSchema } from "./quantization.js";
26
+ import { ResponsesOutputModality$outboundSchema, } from "./responsesoutputmodality.js";
24
27
  import { WebSearchEngine$outboundSchema, } from "./websearchengine.js";
25
28
  export const ServiceTier = {
26
29
  Auto: "auto",
@@ -52,6 +55,11 @@ export function openResponsesRequestToolUnionToJSON(openResponsesRequestToolUnio
52
55
  return JSON.stringify(OpenResponsesRequestToolUnion$outboundSchema.parse(openResponsesRequestToolUnion));
53
56
  }
54
57
  /** @internal */
58
+ export const OpenResponsesRequestImageConfig$outboundSchema = z.union([z.string(), z.number()]);
59
+ export function openResponsesRequestImageConfigToJSON(openResponsesRequestImageConfig) {
60
+ return JSON.stringify(OpenResponsesRequestImageConfig$outboundSchema.parse(openResponsesRequestImageConfig));
61
+ }
62
+ /** @internal */
55
63
  export const ServiceTier$outboundSchema = z.enum(ServiceTier);
56
64
  /** @internal */
57
65
  export const Truncation$outboundSchema = openEnums.outboundSchema(Truncation);
@@ -110,10 +118,10 @@ export const OpenResponsesRequestProvider$outboundSchema = z.object({
110
118
  ])).optional(),
111
119
  maxPrice: z.lazy(() => OpenResponsesRequestMaxPrice$outboundSchema)
112
120
  .optional(),
113
- preferredMinThroughput: z.nullable(z.number()).optional(),
114
- preferredMaxLatency: z.nullable(z.number()).optional(),
115
- minThroughput: z.nullable(z.number()).optional(),
116
- maxLatency: z.nullable(z.number()).optional(),
121
+ preferredMinThroughput: z.nullable(PreferredMinThroughput$outboundSchema)
122
+ .optional(),
123
+ preferredMaxLatency: z.nullable(PreferredMaxLatency$outboundSchema)
124
+ .optional(),
117
125
  }).transform((v) => {
118
126
  return remap$(v, {
119
127
  allowFallbacks: "allow_fallbacks",
@@ -123,8 +131,6 @@ export const OpenResponsesRequestProvider$outboundSchema = z.object({
123
131
  maxPrice: "max_price",
124
132
  preferredMinThroughput: "preferred_min_throughput",
125
133
  preferredMaxLatency: "preferred_max_latency",
126
- minThroughput: "min_throughput",
127
- maxLatency: "max_latency",
128
134
  });
129
135
  });
130
136
  export function openResponsesRequestProviderToJSON(openResponsesRequestProvider) {
@@ -171,7 +177,21 @@ export function openResponsesRequestPluginModerationToJSON(openResponsesRequestP
171
177
  return JSON.stringify(OpenResponsesRequestPluginModeration$outboundSchema.parse(openResponsesRequestPluginModeration));
172
178
  }
173
179
  /** @internal */
180
+ export const OpenResponsesRequestPluginAutoRouter$outboundSchema = z.object({
181
+ id: z.literal("auto-router"),
182
+ enabled: z.boolean().optional(),
183
+ allowedModels: z.array(z.string()).optional(),
184
+ }).transform((v) => {
185
+ return remap$(v, {
186
+ allowedModels: "allowed_models",
187
+ });
188
+ });
189
+ export function openResponsesRequestPluginAutoRouterToJSON(openResponsesRequestPluginAutoRouter) {
190
+ return JSON.stringify(OpenResponsesRequestPluginAutoRouter$outboundSchema.parse(openResponsesRequestPluginAutoRouter));
191
+ }
192
+ /** @internal */
174
193
  export const OpenResponsesRequestPluginUnion$outboundSchema = z.union([
194
+ z.lazy(() => OpenResponsesRequestPluginAutoRouter$outboundSchema),
175
195
  z.lazy(() => OpenResponsesRequestPluginModeration$outboundSchema),
176
196
  z.lazy(() => OpenResponsesRequestPluginWeb$outboundSchema),
177
197
  z.lazy(() => OpenResponsesRequestPluginFileParser$outboundSchema),
@@ -201,7 +221,14 @@ export const OpenResponsesRequest$outboundSchema = z.object({
201
221
  maxOutputTokens: z.nullable(z.number()).optional(),
202
222
  temperature: z.nullable(z.number()).optional(),
203
223
  topP: z.nullable(z.number()).optional(),
224
+ topLogprobs: z.nullable(z.int()).optional(),
225
+ maxToolCalls: z.nullable(z.int()).optional(),
226
+ presencePenalty: z.nullable(z.number()).optional(),
227
+ frequencyPenalty: z.nullable(z.number()).optional(),
204
228
  topK: z.number().optional(),
229
+ imageConfig: z.record(z.string(), z.union([z.string(), z.number()]))
230
+ .optional(),
231
+ modalities: z.array(ResponsesOutputModality$outboundSchema).optional(),
205
232
  promptCacheKey: z.nullable(z.string()).optional(),
206
233
  previousResponseId: z.nullable(z.string()).optional(),
207
234
  prompt: z.nullable(OpenAIResponsesPrompt$outboundSchema).optional(),
@@ -215,6 +242,7 @@ export const OpenResponsesRequest$outboundSchema = z.object({
215
242
  stream: z.boolean().default(false),
216
243
  provider: z.nullable(z.lazy(() => OpenResponsesRequestProvider$outboundSchema)).optional(),
217
244
  plugins: z.array(z.union([
245
+ z.lazy(() => OpenResponsesRequestPluginAutoRouter$outboundSchema),
218
246
  z.lazy(() => OpenResponsesRequestPluginModeration$outboundSchema),
219
247
  z.lazy(() => OpenResponsesRequestPluginWeb$outboundSchema),
220
248
  z.lazy(() => OpenResponsesRequestPluginFileParser$outboundSchema),
@@ -228,7 +256,12 @@ export const OpenResponsesRequest$outboundSchema = z.object({
228
256
  parallelToolCalls: "parallel_tool_calls",
229
257
  maxOutputTokens: "max_output_tokens",
230
258
  topP: "top_p",
259
+ topLogprobs: "top_logprobs",
260
+ maxToolCalls: "max_tool_calls",
261
+ presencePenalty: "presence_penalty",
262
+ frequencyPenalty: "frequency_penalty",
231
263
  topK: "top_k",
264
+ imageConfig: "image_config",
232
265
  promptCacheKey: "prompt_cache_key",
233
266
  previousResponseId: "previous_response_id",
234
267
  safetyIdentifier: "safety_identifier",
@@ -148,6 +148,10 @@ export type GetGenerationData = {
148
148
  * Type of API used for the generation
149
149
  */
150
150
  apiType: ApiType | null;
151
+ /**
152
+ * Router used for the request (e.g., openrouter/auto)
153
+ */
154
+ router: string | null;
151
155
  };
152
156
  /**
153
157
  * Generation response
@@ -57,6 +57,7 @@ export const GetGenerationData$inboundSchema = z.object({
57
57
  native_finish_reason: z.nullable(z.string()),
58
58
  external_user: z.nullable(z.string()),
59
59
  api_type: z.nullable(ApiType$inboundSchema),
60
+ router: z.nullable(z.string()),
60
61
  }).transform((v) => {
61
62
  return remap$(v, {
62
63
  "upstream_id": "upstreamId",
@@ -0,0 +1,33 @@
1
+ import * as z from "zod/v4";
2
+ /**
3
+ * Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
4
+ */
5
+ export type PercentileLatencyCutoffs = {
6
+ /**
7
+ * Maximum p50 latency (seconds)
8
+ */
9
+ p50?: number | null | undefined;
10
+ /**
11
+ * Maximum p75 latency (seconds)
12
+ */
13
+ p75?: number | null | undefined;
14
+ /**
15
+ * Maximum p90 latency (seconds)
16
+ */
17
+ p90?: number | null | undefined;
18
+ /**
19
+ * Maximum p99 latency (seconds)
20
+ */
21
+ p99?: number | null | undefined;
22
+ };
23
+ /** @internal */
24
+ export type PercentileLatencyCutoffs$Outbound = {
25
+ p50?: number | null | undefined;
26
+ p75?: number | null | undefined;
27
+ p90?: number | null | undefined;
28
+ p99?: number | null | undefined;
29
+ };
30
+ /** @internal */
31
+ export declare const PercentileLatencyCutoffs$outboundSchema: z.ZodType<PercentileLatencyCutoffs$Outbound, PercentileLatencyCutoffs>;
32
+ export declare function percentileLatencyCutoffsToJSON(percentileLatencyCutoffs: PercentileLatencyCutoffs): string;
33
+ //# sourceMappingURL=percentilelatencycutoffs.d.ts.map
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 92e053096488
4
+ */
5
+ import * as z from "zod/v4";
6
+ /** @internal */
7
+ export const PercentileLatencyCutoffs$outboundSchema = z.object({
8
+ p50: z.nullable(z.number()).optional(),
9
+ p75: z.nullable(z.number()).optional(),
10
+ p90: z.nullable(z.number()).optional(),
11
+ p99: z.nullable(z.number()).optional(),
12
+ });
13
+ export function percentileLatencyCutoffsToJSON(percentileLatencyCutoffs) {
14
+ return JSON.stringify(PercentileLatencyCutoffs$outboundSchema.parse(percentileLatencyCutoffs));
15
+ }
16
+ //# sourceMappingURL=percentilelatencycutoffs.js.map
@@ -0,0 +1,28 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ /**
5
+ * 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.
6
+ */
7
+ export type PercentileStats = {
8
+ /**
9
+ * Median (50th percentile)
10
+ */
11
+ p50: number;
12
+ /**
13
+ * 75th percentile
14
+ */
15
+ p75: number;
16
+ /**
17
+ * 90th percentile
18
+ */
19
+ p90: number;
20
+ /**
21
+ * 99th percentile
22
+ */
23
+ p99: number;
24
+ };
25
+ /** @internal */
26
+ export declare const PercentileStats$inboundSchema: z.ZodType<PercentileStats, unknown>;
27
+ export declare function percentileStatsFromJSON(jsonString: string): SafeParseResult<PercentileStats, SDKValidationError>;
28
+ //# sourceMappingURL=percentilestats.d.ts.map
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 9a6b504d3964
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ /** @internal */
8
+ export const PercentileStats$inboundSchema = z.object({
9
+ p50: z.number(),
10
+ p75: z.number(),
11
+ p90: z.number(),
12
+ p99: z.number(),
13
+ });
14
+ export function percentileStatsFromJSON(jsonString) {
15
+ return safeParse(jsonString, (x) => PercentileStats$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PercentileStats' from JSON`);
16
+ }
17
+ //# sourceMappingURL=percentilestats.js.map
@@ -0,0 +1,33 @@
1
+ import * as z from "zod/v4";
2
+ /**
3
+ * Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
4
+ */
5
+ export type PercentileThroughputCutoffs = {
6
+ /**
7
+ * Minimum p50 throughput (tokens/sec)
8
+ */
9
+ p50?: number | null | undefined;
10
+ /**
11
+ * Minimum p75 throughput (tokens/sec)
12
+ */
13
+ p75?: number | null | undefined;
14
+ /**
15
+ * Minimum p90 throughput (tokens/sec)
16
+ */
17
+ p90?: number | null | undefined;
18
+ /**
19
+ * Minimum p99 throughput (tokens/sec)
20
+ */
21
+ p99?: number | null | undefined;
22
+ };
23
+ /** @internal */
24
+ export type PercentileThroughputCutoffs$Outbound = {
25
+ p50?: number | null | undefined;
26
+ p75?: number | null | undefined;
27
+ p90?: number | null | undefined;
28
+ p99?: number | null | undefined;
29
+ };
30
+ /** @internal */
31
+ export declare const PercentileThroughputCutoffs$outboundSchema: z.ZodType<PercentileThroughputCutoffs$Outbound, PercentileThroughputCutoffs>;
32
+ export declare function percentileThroughputCutoffsToJSON(percentileThroughputCutoffs: PercentileThroughputCutoffs): string;
33
+ //# sourceMappingURL=percentilethroughputcutoffs.d.ts.map
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 847aba8ff633
4
+ */
5
+ import * as z from "zod/v4";
6
+ /** @internal */
7
+ export const PercentileThroughputCutoffs$outboundSchema = z.object({
8
+ p50: z.nullable(z.number()).optional(),
9
+ p75: z.nullable(z.number()).optional(),
10
+ p90: z.nullable(z.number()).optional(),
11
+ p99: z.nullable(z.number()).optional(),
12
+ });
13
+ export function percentileThroughputCutoffsToJSON(percentileThroughputCutoffs) {
14
+ return JSON.stringify(PercentileThroughputCutoffs$outboundSchema.parse(percentileThroughputCutoffs));
15
+ }
16
+ //# sourceMappingURL=percentilethroughputcutoffs.js.map
@@ -0,0 +1,12 @@
1
+ import * as z from "zod/v4";
2
+ import { PercentileLatencyCutoffs, PercentileLatencyCutoffs$Outbound } from "./percentilelatencycutoffs.js";
3
+ /**
4
+ * Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
5
+ */
6
+ export type PreferredMaxLatency = number | PercentileLatencyCutoffs | any;
7
+ /** @internal */
8
+ export type PreferredMaxLatency$Outbound = number | PercentileLatencyCutoffs$Outbound | any;
9
+ /** @internal */
10
+ export declare const PreferredMaxLatency$outboundSchema: z.ZodType<PreferredMaxLatency$Outbound, PreferredMaxLatency>;
11
+ export declare function preferredMaxLatencyToJSON(preferredMaxLatency: PreferredMaxLatency): string;
12
+ //# sourceMappingURL=preferredmaxlatency.d.ts.map
@@ -0,0 +1,12 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: e03f33269427
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { PercentileLatencyCutoffs$outboundSchema, } from "./percentilelatencycutoffs.js";
7
+ /** @internal */
8
+ export const PreferredMaxLatency$outboundSchema = z.union([z.number(), PercentileLatencyCutoffs$outboundSchema, z.any()]);
9
+ export function preferredMaxLatencyToJSON(preferredMaxLatency) {
10
+ return JSON.stringify(PreferredMaxLatency$outboundSchema.parse(preferredMaxLatency));
11
+ }
12
+ //# sourceMappingURL=preferredmaxlatency.js.map
@@ -0,0 +1,12 @@
1
+ import * as z from "zod/v4";
2
+ import { PercentileThroughputCutoffs, PercentileThroughputCutoffs$Outbound } from "./percentilethroughputcutoffs.js";
3
+ /**
4
+ * Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
5
+ */
6
+ export type PreferredMinThroughput = number | PercentileThroughputCutoffs | any;
7
+ /** @internal */
8
+ export type PreferredMinThroughput$Outbound = number | PercentileThroughputCutoffs$Outbound | any;
9
+ /** @internal */
10
+ export declare const PreferredMinThroughput$outboundSchema: z.ZodType<PreferredMinThroughput$Outbound, PreferredMinThroughput>;
11
+ export declare function preferredMinThroughputToJSON(preferredMinThroughput: PreferredMinThroughput): string;
12
+ //# sourceMappingURL=preferredminthroughput.d.ts.map
@@ -0,0 +1,12 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 5ff9056f1474
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { PercentileThroughputCutoffs$outboundSchema, } from "./percentilethroughputcutoffs.js";
7
+ /** @internal */
8
+ export const PreferredMinThroughput$outboundSchema = z.union([z.number(), PercentileThroughputCutoffs$outboundSchema, z.any()]);
9
+ export function preferredMinThroughputToJSON(preferredMinThroughput) {
10
+ return JSON.stringify(PreferredMinThroughput$outboundSchema.parse(preferredMinThroughput));
11
+ }
12
+ //# sourceMappingURL=preferredminthroughput.js.map
@@ -27,12 +27,12 @@ export declare const ProviderName: {
27
27
  readonly Fireworks: "Fireworks";
28
28
  readonly Friendli: "Friendli";
29
29
  readonly GMICloud: "GMICloud";
30
- readonly GoPomelo: "GoPomelo";
31
30
  readonly Google: "Google";
32
31
  readonly GoogleAIStudio: "Google AI Studio";
33
32
  readonly Groq: "Groq";
34
33
  readonly Hyperbolic: "Hyperbolic";
35
34
  readonly Inception: "Inception";
35
+ readonly Inceptron: "Inceptron";
36
36
  readonly InferenceNet: "InferenceNet";
37
37
  readonly Infermatic: "Infermatic";
38
38
  readonly Inflection: "Inflection";
@@ -57,13 +57,14 @@ export declare const ProviderName: {
57
57
  readonly Phala: "Phala";
58
58
  readonly Relace: "Relace";
59
59
  readonly SambaNova: "SambaNova";
60
+ readonly Seed: "Seed";
60
61
  readonly SiliconFlow: "SiliconFlow";
61
62
  readonly Sourceful: "Sourceful";
62
63
  readonly Stealth: "Stealth";
63
64
  readonly StreamLake: "StreamLake";
64
65
  readonly Switchpoint: "Switchpoint";
65
- readonly Targon: "Targon";
66
66
  readonly Together: "Together";
67
+ readonly Upstage: "Upstage";
67
68
  readonly Venice: "Venice";
68
69
  readonly WandB: "WandB";
69
70
  readonly Xiaomi: "Xiaomi";
@@ -30,12 +30,12 @@ export const ProviderName = {
30
30
  Fireworks: "Fireworks",
31
31
  Friendli: "Friendli",
32
32
  GMICloud: "GMICloud",
33
- GoPomelo: "GoPomelo",
34
33
  Google: "Google",
35
34
  GoogleAIStudio: "Google AI Studio",
36
35
  Groq: "Groq",
37
36
  Hyperbolic: "Hyperbolic",
38
37
  Inception: "Inception",
38
+ Inceptron: "Inceptron",
39
39
  InferenceNet: "InferenceNet",
40
40
  Infermatic: "Infermatic",
41
41
  Inflection: "Inflection",
@@ -60,13 +60,14 @@ export const ProviderName = {
60
60
  Phala: "Phala",
61
61
  Relace: "Relace",
62
62
  SambaNova: "SambaNova",
63
+ Seed: "Seed",
63
64
  SiliconFlow: "SiliconFlow",
64
65
  Sourceful: "Sourceful",
65
66
  Stealth: "Stealth",
66
67
  StreamLake: "StreamLake",
67
68
  Switchpoint: "Switchpoint",
68
- Targon: "Targon",
69
69
  Together: "Together",
70
+ Upstage: "Upstage",
70
71
  Venice: "Venice",
71
72
  WandB: "WandB",
72
73
  Xiaomi: "Xiaomi",
@@ -1,6 +1,8 @@
1
1
  import * as z from "zod/v4";
2
2
  import { ClosedEnum, OpenEnum } from "../types/enums.js";
3
3
  import { DataCollection } from "./datacollection.js";
4
+ import { PreferredMaxLatency, PreferredMaxLatency$Outbound } from "./preferredmaxlatency.js";
5
+ import { PreferredMinThroughput, PreferredMinThroughput$Outbound } from "./preferredminthroughput.js";
4
6
  import { ProviderName } from "./providername.js";
5
7
  import { ProviderSort } from "./providersort.js";
6
8
  import { Quantization } from "./quantization.js";
@@ -119,25 +121,13 @@ export type ProviderPreferences = {
119
121
  */
120
122
  maxPrice?: ProviderPreferencesMaxPrice | undefined;
121
123
  /**
122
- * Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
124
+ * Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
123
125
  */
124
- preferredMinThroughput?: number | null | undefined;
126
+ preferredMinThroughput?: PreferredMinThroughput | null | undefined;
125
127
  /**
126
- * Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
128
+ * Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
127
129
  */
128
- preferredMaxLatency?: number | null | undefined;
129
- /**
130
- * **DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput.
131
- *
132
- * @deprecated field: Use preferred_min_throughput instead..
133
- */
134
- minThroughput?: number | null | undefined;
135
- /**
136
- * **DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency.
137
- *
138
- * @deprecated field: Use preferred_max_latency instead..
139
- */
140
- maxLatency?: number | null | undefined;
130
+ preferredMaxLatency?: PreferredMaxLatency | null | undefined;
141
131
  };
142
132
  /** @internal */
143
133
  export type ProviderPreferencesOrder$Outbound = string | string;
@@ -204,10 +194,8 @@ export type ProviderPreferences$Outbound = {
204
194
  quantizations?: Array<string> | null | undefined;
205
195
  sort?: string | ProviderPreferencesProviderSortConfig$Outbound | string | string | null | undefined;
206
196
  max_price?: ProviderPreferencesMaxPrice$Outbound | undefined;
207
- preferred_min_throughput?: number | null | undefined;
208
- preferred_max_latency?: number | null | undefined;
209
- min_throughput?: number | null | undefined;
210
- max_latency?: number | null | undefined;
197
+ preferred_min_throughput?: PreferredMinThroughput$Outbound | null | undefined;
198
+ preferred_max_latency?: PreferredMaxLatency$Outbound | null | undefined;
211
199
  };
212
200
  /** @internal */
213
201
  export declare const ProviderPreferences$outboundSchema: z.ZodType<ProviderPreferences$Outbound, ProviderPreferences>;
@@ -6,6 +6,8 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import * as openEnums from "../types/enums.js";
8
8
  import { DataCollection$outboundSchema, } from "./datacollection.js";
9
+ import { PreferredMaxLatency$outboundSchema, } from "./preferredmaxlatency.js";
10
+ import { PreferredMinThroughput$outboundSchema, } from "./preferredminthroughput.js";
9
11
  import { ProviderName$outboundSchema } from "./providername.js";
10
12
  import { ProviderSort$outboundSchema } from "./providersort.js";
11
13
  import { Quantization$outboundSchema } from "./quantization.js";
@@ -113,10 +115,10 @@ export const ProviderPreferences$outboundSchema = z.object({
113
115
  SortEnum$outboundSchema,
114
116
  ])).optional(),
115
117
  maxPrice: z.lazy(() => ProviderPreferencesMaxPrice$outboundSchema).optional(),
116
- preferredMinThroughput: z.nullable(z.number()).optional(),
117
- preferredMaxLatency: z.nullable(z.number()).optional(),
118
- minThroughput: z.nullable(z.number()).optional(),
119
- maxLatency: z.nullable(z.number()).optional(),
118
+ preferredMinThroughput: z.nullable(PreferredMinThroughput$outboundSchema)
119
+ .optional(),
120
+ preferredMaxLatency: z.nullable(PreferredMaxLatency$outboundSchema)
121
+ .optional(),
120
122
  }).transform((v) => {
121
123
  return remap$(v, {
122
124
  allowFallbacks: "allow_fallbacks",
@@ -126,8 +128,6 @@ export const ProviderPreferences$outboundSchema = z.object({
126
128
  maxPrice: "max_price",
127
129
  preferredMinThroughput: "preferred_min_throughput",
128
130
  preferredMaxLatency: "preferred_max_latency",
129
- minThroughput: "min_throughput",
130
- maxLatency: "max_latency",
131
131
  });
132
132
  });
133
133
  export function providerPreferencesToJSON(providerPreferences) {
@@ -4,6 +4,7 @@ import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { EndpointStatus } from "./endpointstatus.js";
5
5
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
6
6
  import { Parameter } from "./parameter.js";
7
+ import { PercentileStats } from "./percentilestats.js";
7
8
  import { ProviderName } from "./providername.js";
8
9
  export type Pricing = {
9
10
  /**
@@ -85,6 +86,11 @@ export type PublicEndpoint = {
85
86
  status?: EndpointStatus | undefined;
86
87
  uptimeLast30m: number | null;
87
88
  supportsImplicitCaching: boolean;
89
+ /**
90
+ * 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.
91
+ */
92
+ latencyLast30m: PercentileStats | null;
93
+ throughputLast30m: PercentileStats | null;
88
94
  };
89
95
  /** @internal */
90
96
  export declare const Pricing$inboundSchema: z.ZodType<Pricing, unknown>;
@@ -8,6 +8,7 @@ import { safeParse } from "../lib/schemas.js";
8
8
  import * as openEnums from "../types/enums.js";
9
9
  import { EndpointStatus$inboundSchema, } from "./endpointstatus.js";
10
10
  import { Parameter$inboundSchema } from "./parameter.js";
11
+ import { PercentileStats$inboundSchema, } from "./percentilestats.js";
11
12
  import { ProviderName$inboundSchema } from "./providername.js";
12
13
  export const PublicEndpointQuantization = {
13
14
  Int4: "int4",
@@ -66,6 +67,8 @@ export const PublicEndpoint$inboundSchema = z.object({
66
67
  status: EndpointStatus$inboundSchema.optional(),
67
68
  uptime_last_30m: z.nullable(z.number()),
68
69
  supports_implicit_caching: z.boolean(),
70
+ latency_last_30m: z.nullable(PercentileStats$inboundSchema),
71
+ throughput_last_30m: z.nullable(PercentileStats$inboundSchema),
69
72
  }).transform((v) => {
70
73
  return remap$(v, {
71
74
  "model_name": "modelName",
@@ -76,6 +79,8 @@ export const PublicEndpoint$inboundSchema = z.object({
76
79
  "supported_parameters": "supportedParameters",
77
80
  "uptime_last_30m": "uptimeLast30m",
78
81
  "supports_implicit_caching": "supportsImplicitCaching",
82
+ "latency_last_30m": "latencyLast30m",
83
+ "throughput_last_30m": "throughputLast30m",
79
84
  });
80
85
  });
81
86
  export function publicEndpointFromJSON(jsonString) {
@@ -1,7 +1,11 @@
1
1
  import * as z from "zod/v4";
2
- import { OpenEnum } from "../types/enums.js";
2
+ import { ClosedEnum, OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ export declare const ResponseInputImageType: {
6
+ readonly InputImage: "input_image";
7
+ };
8
+ export type ResponseInputImageType = ClosedEnum<typeof ResponseInputImageType>;
5
9
  export declare const ResponseInputImageDetail: {
6
10
  readonly Auto: "auto";
7
11
  readonly High: "high";
@@ -12,11 +16,15 @@ export type ResponseInputImageDetail = OpenEnum<typeof ResponseInputImageDetail>
12
16
  * Image input content item
13
17
  */
14
18
  export type ResponseInputImage = {
15
- type: "input_image";
19
+ type: ResponseInputImageType;
16
20
  detail: ResponseInputImageDetail;
17
21
  imageUrl?: string | null | undefined;
18
22
  };
19
23
  /** @internal */
24
+ export declare const ResponseInputImageType$inboundSchema: z.ZodEnum<typeof ResponseInputImageType>;
25
+ /** @internal */
26
+ export declare const ResponseInputImageType$outboundSchema: z.ZodEnum<typeof ResponseInputImageType>;
27
+ /** @internal */
20
28
  export declare const ResponseInputImageDetail$inboundSchema: z.ZodType<ResponseInputImageDetail, unknown>;
21
29
  /** @internal */
22
30
  export declare const ResponseInputImageDetail$outboundSchema: z.ZodType<string, ResponseInputImageDetail>;
@@ -24,7 +32,7 @@ export declare const ResponseInputImageDetail$outboundSchema: z.ZodType<string,
24
32
  export declare const ResponseInputImage$inboundSchema: z.ZodType<ResponseInputImage, unknown>;
25
33
  /** @internal */
26
34
  export type ResponseInputImage$Outbound = {
27
- type: "input_image";
35
+ type: string;
28
36
  detail: string;
29
37
  image_url?: string | null | undefined;
30
38
  };
@@ -6,18 +6,25 @@ 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 * as openEnums from "../types/enums.js";
9
+ export const ResponseInputImageType = {
10
+ InputImage: "input_image",
11
+ };
9
12
  export const ResponseInputImageDetail = {
10
13
  Auto: "auto",
11
14
  High: "high",
12
15
  Low: "low",
13
16
  };
14
17
  /** @internal */
18
+ export const ResponseInputImageType$inboundSchema = z.enum(ResponseInputImageType);
19
+ /** @internal */
20
+ export const ResponseInputImageType$outboundSchema = ResponseInputImageType$inboundSchema;
21
+ /** @internal */
15
22
  export const ResponseInputImageDetail$inboundSchema = openEnums.inboundSchema(ResponseInputImageDetail);
16
23
  /** @internal */
17
24
  export const ResponseInputImageDetail$outboundSchema = openEnums.outboundSchema(ResponseInputImageDetail);
18
25
  /** @internal */
19
26
  export const ResponseInputImage$inboundSchema = z.object({
20
- type: z.literal("input_image"),
27
+ type: ResponseInputImageType$inboundSchema,
21
28
  detail: ResponseInputImageDetail$inboundSchema,
22
29
  image_url: z.nullable(z.string()).optional(),
23
30
  }).transform((v) => {
@@ -27,7 +34,7 @@ export const ResponseInputImage$inboundSchema = z.object({
27
34
  });
28
35
  /** @internal */
29
36
  export const ResponseInputImage$outboundSchema = z.object({
30
- type: z.literal("input_image"),
37
+ type: ResponseInputImageType$outboundSchema,
31
38
  detail: ResponseInputImageDetail$outboundSchema,
32
39
  imageUrl: z.nullable(z.string()).optional(),
33
40
  }).transform((v) => {
@@ -0,0 +1,20 @@
1
+ import * as z from "zod/v4";
2
+ /**
3
+ * Video input content item
4
+ */
5
+ export type ResponseInputVideo = {
6
+ type: "input_video";
7
+ /**
8
+ * A base64 data URL or remote URL that resolves to a video file
9
+ */
10
+ videoUrl: string;
11
+ };
12
+ /** @internal */
13
+ export type ResponseInputVideo$Outbound = {
14
+ type: "input_video";
15
+ video_url: string;
16
+ };
17
+ /** @internal */
18
+ export declare const ResponseInputVideo$outboundSchema: z.ZodType<ResponseInputVideo$Outbound, ResponseInputVideo>;
19
+ export declare function responseInputVideoToJSON(responseInputVideo: ResponseInputVideo): string;
20
+ //# sourceMappingURL=responseinputvideo.d.ts.map
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 79bef840e448
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ /** @internal */
8
+ export const ResponseInputVideo$outboundSchema = z.object({
9
+ type: z.literal("input_video"),
10
+ videoUrl: z.string(),
11
+ }).transform((v) => {
12
+ return remap$(v, {
13
+ videoUrl: "video_url",
14
+ });
15
+ });
16
+ export function responseInputVideoToJSON(responseInputVideo) {
17
+ return JSON.stringify(ResponseInputVideo$outboundSchema.parse(responseInputVideo));
18
+ }
19
+ //# sourceMappingURL=responseinputvideo.js.map