@openrouter/sdk 0.3.12 → 0.3.15

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 (172) hide show
  1. package/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
  2. package/esm/funcs/analyticsGetUserActivity.js +1 -1
  3. package/esm/funcs/apiKeysCreate.d.ts +3 -0
  4. package/esm/funcs/apiKeysCreate.js +3 -0
  5. package/esm/funcs/apiKeysDelete.d.ts +3 -0
  6. package/esm/funcs/apiKeysDelete.js +3 -0
  7. package/esm/funcs/apiKeysGet.d.ts +3 -0
  8. package/esm/funcs/apiKeysGet.js +3 -0
  9. package/esm/funcs/apiKeysList.d.ts +3 -0
  10. package/esm/funcs/apiKeysList.js +3 -0
  11. package/esm/funcs/apiKeysUpdate.d.ts +3 -0
  12. package/esm/funcs/apiKeysUpdate.js +3 -0
  13. package/esm/funcs/call-model.js +9 -6
  14. package/esm/funcs/creditsGetCredits.d.ts +1 -1
  15. package/esm/funcs/creditsGetCredits.js +1 -1
  16. package/esm/funcs/guardrailsBulkAssignKeys.d.ts +18 -0
  17. package/esm/funcs/guardrailsBulkAssignKeys.js +89 -0
  18. package/esm/funcs/guardrailsBulkAssignMembers.d.ts +18 -0
  19. package/esm/funcs/guardrailsBulkAssignMembers.js +89 -0
  20. package/esm/funcs/guardrailsBulkUnassignKeys.d.ts +18 -0
  21. package/esm/funcs/guardrailsBulkUnassignKeys.js +89 -0
  22. package/esm/funcs/guardrailsBulkUnassignMembers.d.ts +18 -0
  23. package/esm/funcs/guardrailsBulkUnassignMembers.js +89 -0
  24. package/esm/funcs/guardrailsCreate.d.ts +18 -0
  25. package/esm/funcs/guardrailsCreate.js +83 -0
  26. package/esm/funcs/guardrailsDelete.d.ts +18 -0
  27. package/esm/funcs/guardrailsDelete.js +88 -0
  28. package/esm/funcs/{parametersGetParameters.d.ts → guardrailsGet.d.ts} +6 -3
  29. package/esm/funcs/guardrailsGet.js +88 -0
  30. package/esm/funcs/guardrailsList.d.ts +18 -0
  31. package/esm/funcs/guardrailsList.js +87 -0
  32. package/esm/funcs/guardrailsListGuardrailKeyAssignments.d.ts +18 -0
  33. package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +93 -0
  34. package/esm/funcs/guardrailsListGuardrailMemberAssignments.d.ts +18 -0
  35. package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +93 -0
  36. package/esm/funcs/guardrailsListKeyAssignments.d.ts +18 -0
  37. package/esm/funcs/guardrailsListKeyAssignments.js +87 -0
  38. package/esm/funcs/guardrailsListMemberAssignments.d.ts +18 -0
  39. package/esm/funcs/guardrailsListMemberAssignments.js +87 -0
  40. package/esm/funcs/guardrailsUpdate.d.ts +18 -0
  41. package/esm/funcs/{parametersGetParameters.js → guardrailsUpdate.js} +24 -32
  42. package/esm/index.d.ts +4 -3
  43. package/esm/index.js +3 -1
  44. package/esm/lib/anthropic-compat.test.js +3 -0
  45. package/esm/lib/async-params.d.ts +46 -6
  46. package/esm/lib/async-params.js +10 -2
  47. package/esm/lib/chat-compat.test.js +3 -0
  48. package/esm/lib/config.d.ts +2 -4
  49. package/esm/lib/config.js +2 -2
  50. package/esm/lib/conversation-state.d.ts +61 -0
  51. package/esm/lib/conversation-state.js +207 -0
  52. package/esm/lib/model-result.d.ts +175 -2
  53. package/esm/lib/model-result.js +678 -181
  54. package/esm/lib/tool-types.d.ts +109 -1
  55. package/esm/lib/tool-types.js +13 -0
  56. package/esm/lib/tool.d.ts +21 -1
  57. package/esm/lib/tool.js +7 -0
  58. package/esm/models/assistantmessage.d.ts +31 -0
  59. package/esm/models/assistantmessage.js +43 -0
  60. package/esm/models/chatgenerationparams.d.ts +93 -12
  61. package/esm/models/chatgenerationparams.js +75 -6
  62. package/esm/models/chatgenerationtokenusage.d.ts +1 -0
  63. package/esm/models/chatgenerationtokenusage.js +2 -0
  64. package/esm/models/chatmessagecontentitemimage.d.ts +8 -8
  65. package/esm/models/chatmessagecontentitemimage.js +8 -9
  66. package/esm/models/chatmessagetokenlogprob.d.ts +4 -4
  67. package/esm/models/chatmessagetokenlogprob.js +4 -5
  68. package/esm/models/chatresponsechoice.d.ts +0 -2
  69. package/esm/models/chatresponsechoice.js +0 -3
  70. package/esm/models/chatstreamingmessagechunk.d.ts +2 -2
  71. package/esm/models/chatstreamingmessagechunk.js +2 -2
  72. package/esm/models/index.d.ts +8 -1
  73. package/esm/models/index.js +8 -1
  74. package/esm/models/model.d.ts +4 -0
  75. package/esm/models/model.js +2 -0
  76. package/esm/models/openairesponsesinputunion.d.ts +15 -5
  77. package/esm/models/openairesponsesinputunion.js +5 -5
  78. package/esm/models/openresponseseasyinputmessage.d.ts +41 -16
  79. package/esm/models/openresponseseasyinputmessage.js +38 -13
  80. package/esm/models/openresponsesinputmessageitem.d.ts +37 -12
  81. package/esm/models/openresponsesinputmessageitem.js +33 -9
  82. package/esm/models/openresponsesnonstreamingresponse.d.ts +5 -2
  83. package/esm/models/openresponsesnonstreamingresponse.js +8 -2
  84. package/esm/models/openresponsesreasoning.d.ts +1 -0
  85. package/esm/models/openresponsesreasoning.js +1 -0
  86. package/esm/models/openresponsesrequest.d.ts +61 -24
  87. package/esm/models/openresponsesrequest.js +39 -6
  88. package/esm/models/operations/bulkassignkeystoguardrail.d.ts +44 -0
  89. package/esm/models/operations/bulkassignkeystoguardrail.js +42 -0
  90. package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +44 -0
  91. package/esm/models/operations/bulkassignmemberstoguardrail.js +42 -0
  92. package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +44 -0
  93. package/esm/models/operations/bulkunassignkeysfromguardrail.js +42 -0
  94. package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +44 -0
  95. package/esm/models/operations/bulkunassignmembersfromguardrail.js +42 -0
  96. package/esm/models/operations/createguardrail.d.ts +136 -0
  97. package/esm/models/operations/createguardrail.js +85 -0
  98. package/esm/models/operations/deleteguardrail.d.ts +29 -0
  99. package/esm/models/operations/deleteguardrail.js +21 -0
  100. package/esm/models/operations/getgeneration.d.ts +4 -0
  101. package/esm/models/operations/getgeneration.js +1 -0
  102. package/esm/models/operations/getguardrail.d.ts +92 -0
  103. package/esm/models/operations/getguardrail.js +60 -0
  104. package/esm/models/operations/getmodels.d.ts +28 -1
  105. package/esm/models/operations/getmodels.js +22 -1
  106. package/esm/models/operations/index.d.ts +13 -1
  107. package/esm/models/operations/index.js +13 -1
  108. package/esm/models/operations/listguardrailkeyassignments.d.ts +76 -0
  109. package/esm/models/operations/listguardrailkeyassignments.js +51 -0
  110. package/esm/models/operations/listguardrailmemberassignments.d.ts +72 -0
  111. package/esm/models/operations/listguardrailmemberassignments.js +49 -0
  112. package/esm/models/operations/listguardrails.d.ts +98 -0
  113. package/esm/models/operations/listguardrails.js +66 -0
  114. package/esm/models/operations/listkeyassignments.d.ts +71 -0
  115. package/esm/models/operations/listkeyassignments.js +50 -0
  116. package/esm/models/operations/listmemberassignments.d.ts +67 -0
  117. package/esm/models/operations/listmemberassignments.js +48 -0
  118. package/esm/models/operations/updateguardrail.d.ts +151 -0
  119. package/esm/models/operations/updateguardrail.js +97 -0
  120. package/esm/models/percentilelatencycutoffs.d.ts +33 -0
  121. package/esm/models/percentilelatencycutoffs.js +16 -0
  122. package/esm/models/percentilestats.d.ts +28 -0
  123. package/esm/models/percentilestats.js +17 -0
  124. package/esm/models/percentilethroughputcutoffs.d.ts +33 -0
  125. package/esm/models/percentilethroughputcutoffs.js +16 -0
  126. package/esm/models/preferredmaxlatency.d.ts +12 -0
  127. package/esm/models/preferredmaxlatency.js +12 -0
  128. package/esm/models/preferredminthroughput.d.ts +12 -0
  129. package/esm/models/preferredminthroughput.js +12 -0
  130. package/esm/models/providername.d.ts +3 -2
  131. package/esm/models/providername.js +3 -2
  132. package/esm/models/providerpreferences.d.ts +8 -20
  133. package/esm/models/providerpreferences.js +6 -6
  134. package/esm/models/publicendpoint.d.ts +6 -0
  135. package/esm/models/publicendpoint.js +5 -0
  136. package/esm/models/responseinputimage.d.ts +11 -3
  137. package/esm/models/responseinputimage.js +9 -2
  138. package/esm/models/responseinputvideo.d.ts +20 -0
  139. package/esm/models/responseinputvideo.js +19 -0
  140. package/esm/models/responseoutputtext.d.ts +38 -0
  141. package/esm/models/responseoutputtext.js +50 -0
  142. package/esm/models/responsesoutputitemreasoning.d.ts +30 -1
  143. package/esm/models/responsesoutputitemreasoning.js +22 -0
  144. package/esm/models/responsesoutputmodality.d.ts +10 -0
  145. package/esm/models/responsesoutputmodality.js +12 -0
  146. package/esm/models/schema0.d.ts +3 -2
  147. package/esm/models/schema0.js +3 -2
  148. package/esm/models/schema2.d.ts +92 -0
  149. package/esm/models/schema2.js +109 -0
  150. package/esm/sdk/analytics.d.ts +1 -1
  151. package/esm/sdk/analytics.js +1 -1
  152. package/esm/sdk/apikeys.d.ts +15 -0
  153. package/esm/sdk/apikeys.js +15 -0
  154. package/esm/sdk/credits.d.ts +1 -1
  155. package/esm/sdk/credits.js +1 -1
  156. package/esm/sdk/guardrails.d.ts +96 -0
  157. package/esm/sdk/guardrails.js +139 -0
  158. package/esm/sdk/sdk.d.ts +3 -3
  159. package/esm/sdk/sdk.js +4 -4
  160. package/esm/types/index.d.ts +2 -0
  161. package/esm/types/index.js +1 -0
  162. package/esm/types/models.d.ts +25 -0
  163. package/esm/types/models.js +10 -0
  164. package/jsr.json +1 -1
  165. package/package.json +12 -10
  166. package/scripts/check-types.js +127 -0
  167. package/esm/models/operations/getparameters.d.ts +0 -87
  168. package/esm/models/operations/getparameters.js +0 -73
  169. package/esm/models/schema3.d.ts +0 -50
  170. package/esm/models/schema3.js +0 -61
  171. package/esm/sdk/parameters.d.ts +0 -9
  172. package/esm/sdk/parameters.js +0 -16
@@ -0,0 +1,97 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: d4106fbc6dca
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 * as openEnums from "../../types/enums.js";
9
+ /**
10
+ * Interval at which the limit resets (daily, weekly, monthly)
11
+ */
12
+ export const UpdateGuardrailResetIntervalRequest = {
13
+ Daily: "daily",
14
+ Weekly: "weekly",
15
+ Monthly: "monthly",
16
+ };
17
+ /**
18
+ * Interval at which the limit resets (daily, weekly, monthly)
19
+ */
20
+ export const UpdateGuardrailResetIntervalResponse = {
21
+ Daily: "daily",
22
+ Weekly: "weekly",
23
+ Monthly: "monthly",
24
+ };
25
+ /** @internal */
26
+ export const UpdateGuardrailResetIntervalRequest$outboundSchema = openEnums.outboundSchema(UpdateGuardrailResetIntervalRequest);
27
+ /** @internal */
28
+ export const UpdateGuardrailRequestBody$outboundSchema = z.object({
29
+ name: z.string().optional(),
30
+ description: z.nullable(z.string()).optional(),
31
+ limitUsd: z.nullable(z.number()).optional(),
32
+ resetInterval: z.nullable(UpdateGuardrailResetIntervalRequest$outboundSchema)
33
+ .optional(),
34
+ allowedProviders: z.nullable(z.array(z.string())).optional(),
35
+ allowedModels: z.nullable(z.array(z.string())).optional(),
36
+ enforceZdr: z.nullable(z.boolean()).optional(),
37
+ }).transform((v) => {
38
+ return remap$(v, {
39
+ limitUsd: "limit_usd",
40
+ resetInterval: "reset_interval",
41
+ allowedProviders: "allowed_providers",
42
+ allowedModels: "allowed_models",
43
+ enforceZdr: "enforce_zdr",
44
+ });
45
+ });
46
+ export function updateGuardrailRequestBodyToJSON(updateGuardrailRequestBody) {
47
+ return JSON.stringify(UpdateGuardrailRequestBody$outboundSchema.parse(updateGuardrailRequestBody));
48
+ }
49
+ /** @internal */
50
+ export const UpdateGuardrailRequest$outboundSchema = z.object({
51
+ id: z.string(),
52
+ requestBody: z.lazy(() => UpdateGuardrailRequestBody$outboundSchema),
53
+ }).transform((v) => {
54
+ return remap$(v, {
55
+ requestBody: "RequestBody",
56
+ });
57
+ });
58
+ export function updateGuardrailRequestToJSON(updateGuardrailRequest) {
59
+ return JSON.stringify(UpdateGuardrailRequest$outboundSchema.parse(updateGuardrailRequest));
60
+ }
61
+ /** @internal */
62
+ export const UpdateGuardrailResetIntervalResponse$inboundSchema = openEnums.inboundSchema(UpdateGuardrailResetIntervalResponse);
63
+ /** @internal */
64
+ export const UpdateGuardrailData$inboundSchema = z.object({
65
+ id: z.string(),
66
+ name: z.string(),
67
+ description: z.nullable(z.string()).optional(),
68
+ limit_usd: z.nullable(z.number()).optional(),
69
+ reset_interval: z.nullable(UpdateGuardrailResetIntervalResponse$inboundSchema)
70
+ .optional(),
71
+ allowed_providers: z.nullable(z.array(z.string())).optional(),
72
+ allowed_models: z.nullable(z.array(z.string())).optional(),
73
+ enforce_zdr: z.nullable(z.boolean()).optional(),
74
+ created_at: z.string(),
75
+ updated_at: z.nullable(z.string()).optional(),
76
+ }).transform((v) => {
77
+ return remap$(v, {
78
+ "limit_usd": "limitUsd",
79
+ "reset_interval": "resetInterval",
80
+ "allowed_providers": "allowedProviders",
81
+ "allowed_models": "allowedModels",
82
+ "enforce_zdr": "enforceZdr",
83
+ "created_at": "createdAt",
84
+ "updated_at": "updatedAt",
85
+ });
86
+ });
87
+ export function updateGuardrailDataFromJSON(jsonString) {
88
+ return safeParse(jsonString, (x) => UpdateGuardrailData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateGuardrailData' from JSON`);
89
+ }
90
+ /** @internal */
91
+ export const UpdateGuardrailResponse$inboundSchema = z.object({
92
+ data: z.lazy(() => UpdateGuardrailData$inboundSchema),
93
+ });
94
+ export function updateGuardrailResponseFromJSON(jsonString) {
95
+ return safeParse(jsonString, (x) => UpdateGuardrailResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateGuardrailResponse' from JSON`);
96
+ }
97
+ //# sourceMappingURL=updateguardrail.js.map
@@ -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: ab5ef16080c7
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: f8001516363f
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: 366b617b09b4
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: 17fc19055e19
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: 04b7597c84f9
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: be5ad9346721
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