@openrouter/sdk 0.0.0-beta.32 → 0.0.0-beta.33

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 (168) hide show
  1. package/FUNCTIONS.md +2 -0
  2. package/REACT_QUERY.md +2 -0
  3. package/README.md +12 -0
  4. package/dist/commonjs/funcs/endpointsList.d.ts +1 -1
  5. package/dist/commonjs/funcs/endpointsList.d.ts.map +1 -1
  6. package/dist/commonjs/funcs/endpointsList.js +1 -1
  7. package/dist/commonjs/funcs/endpointsList.js.map +1 -1
  8. package/dist/commonjs/funcs/modelsList.d.ts +1 -1
  9. package/dist/commonjs/funcs/modelsList.d.ts.map +1 -1
  10. package/dist/commonjs/funcs/modelsList.js +1 -1
  11. package/dist/commonjs/funcs/modelsList.js.map +1 -1
  12. package/dist/commonjs/lib/config.d.ts +2 -2
  13. package/dist/commonjs/lib/config.js +2 -2
  14. package/dist/commonjs/models/endpointslist.d.ts +768 -0
  15. package/dist/commonjs/models/endpointslist.d.ts.map +1 -0
  16. package/dist/commonjs/models/endpointslist.js +625 -0
  17. package/dist/commonjs/models/endpointslist.js.map +1 -0
  18. package/dist/commonjs/models/index.d.ts +3 -0
  19. package/dist/commonjs/models/index.d.ts.map +1 -1
  20. package/dist/commonjs/models/index.js +3 -0
  21. package/dist/commonjs/models/index.js.map +1 -1
  22. package/dist/commonjs/models/keyinfo.d.ts +155 -0
  23. package/dist/commonjs/models/keyinfo.d.ts.map +1 -0
  24. package/dist/commonjs/models/keyinfo.js +163 -0
  25. package/dist/commonjs/models/keyinfo.js.map +1 -0
  26. package/dist/commonjs/models/modelslist.d.ts +854 -0
  27. package/dist/commonjs/models/modelslist.d.ts.map +1 -0
  28. package/dist/commonjs/models/modelslist.js +768 -0
  29. package/dist/commonjs/models/modelslist.js.map +1 -0
  30. package/dist/commonjs/models/openairesponsesrequest.d.ts +52 -52
  31. package/dist/commonjs/models/openairesponsesrequest.d.ts.map +1 -1
  32. package/dist/commonjs/models/openairesponsesrequest.js +74 -76
  33. package/dist/commonjs/models/openairesponsesrequest.js.map +1 -1
  34. package/dist/commonjs/models/operations/getcurrentkey.d.ts +3 -108
  35. package/dist/commonjs/models/operations/getcurrentkey.d.ts.map +1 -1
  36. package/dist/commonjs/models/operations/getcurrentkey.js +4 -88
  37. package/dist/commonjs/models/operations/getcurrentkey.js.map +1 -1
  38. package/dist/commonjs/models/operations/list.d.ts +63 -825
  39. package/dist/commonjs/models/operations/list.d.ts.map +1 -1
  40. package/dist/commonjs/models/operations/list.js +86 -667
  41. package/dist/commonjs/models/operations/list.js.map +1 -1
  42. package/dist/commonjs/models/operations/listmodels.d.ts +16 -865
  43. package/dist/commonjs/models/operations/listmodels.d.ts.map +1 -1
  44. package/dist/commonjs/models/operations/listmodels.js +19 -742
  45. package/dist/commonjs/models/operations/listmodels.js.map +1 -1
  46. package/dist/commonjs/models/operations/listusermodels.d.ts +3 -852
  47. package/dist/commonjs/models/operations/listusermodels.d.ts.map +1 -1
  48. package/dist/commonjs/models/operations/listusermodels.js +4 -730
  49. package/dist/commonjs/models/operations/listusermodels.js.map +1 -1
  50. package/dist/commonjs/models/operations/previewzdr.d.ts +97 -97
  51. package/dist/commonjs/models/operations/previewzdr.d.ts.map +1 -1
  52. package/dist/commonjs/models/operations/previewzdr.js +134 -133
  53. package/dist/commonjs/models/operations/previewzdr.js.map +1 -1
  54. package/dist/commonjs/models/responsereasoningconfig.d.ts +4 -0
  55. package/dist/commonjs/models/responsereasoningconfig.d.ts.map +1 -1
  56. package/dist/commonjs/models/responsereasoningconfig.js +13 -0
  57. package/dist/commonjs/models/responsereasoningconfig.js.map +1 -1
  58. package/dist/commonjs/models/responsesusage.d.ts +41 -0
  59. package/dist/commonjs/models/responsesusage.d.ts.map +1 -1
  60. package/dist/commonjs/models/responsesusage.js +54 -1
  61. package/dist/commonjs/models/responsesusage.js.map +1 -1
  62. package/dist/commonjs/react-query/endpointsList.d.ts +4 -4
  63. package/dist/commonjs/react-query/endpointsList.d.ts.map +1 -1
  64. package/dist/commonjs/react-query/endpointsList.js.map +1 -1
  65. package/dist/commonjs/react-query/modelsList.d.ts +4 -4
  66. package/dist/commonjs/react-query/modelsList.d.ts.map +1 -1
  67. package/dist/commonjs/react-query/modelsList.js.map +1 -1
  68. package/dist/commonjs/sdk/endpoints.d.ts +1 -1
  69. package/dist/commonjs/sdk/endpoints.d.ts.map +1 -1
  70. package/dist/commonjs/sdk/endpoints.js.map +1 -1
  71. package/dist/commonjs/sdk/models.d.ts +1 -1
  72. package/dist/commonjs/sdk/models.d.ts.map +1 -1
  73. package/dist/commonjs/sdk/models.js.map +1 -1
  74. package/dist/esm/funcs/endpointsList.d.ts +1 -1
  75. package/dist/esm/funcs/endpointsList.d.ts.map +1 -1
  76. package/dist/esm/funcs/endpointsList.js +1 -1
  77. package/dist/esm/funcs/endpointsList.js.map +1 -1
  78. package/dist/esm/funcs/modelsList.d.ts +1 -1
  79. package/dist/esm/funcs/modelsList.d.ts.map +1 -1
  80. package/dist/esm/funcs/modelsList.js +1 -1
  81. package/dist/esm/funcs/modelsList.js.map +1 -1
  82. package/dist/esm/lib/config.d.ts +2 -2
  83. package/dist/esm/lib/config.js +2 -2
  84. package/dist/esm/models/endpointslist.d.ts +768 -0
  85. package/dist/esm/models/endpointslist.d.ts.map +1 -0
  86. package/dist/esm/models/endpointslist.js +562 -0
  87. package/dist/esm/models/endpointslist.js.map +1 -0
  88. package/dist/esm/models/index.d.ts +3 -0
  89. package/dist/esm/models/index.d.ts.map +1 -1
  90. package/dist/esm/models/index.js +3 -0
  91. package/dist/esm/models/index.js.map +1 -1
  92. package/dist/esm/models/keyinfo.d.ts +155 -0
  93. package/dist/esm/models/keyinfo.d.ts.map +1 -0
  94. package/dist/esm/models/keyinfo.js +123 -0
  95. package/dist/esm/models/keyinfo.js.map +1 -0
  96. package/dist/esm/models/modelslist.d.ts +854 -0
  97. package/dist/esm/models/modelslist.d.ts.map +1 -0
  98. package/dist/esm/models/modelslist.js +697 -0
  99. package/dist/esm/models/modelslist.js.map +1 -0
  100. package/dist/esm/models/openairesponsesrequest.d.ts +52 -52
  101. package/dist/esm/models/openairesponsesrequest.d.ts.map +1 -1
  102. package/dist/esm/models/openairesponsesrequest.js +64 -66
  103. package/dist/esm/models/openairesponsesrequest.js.map +1 -1
  104. package/dist/esm/models/operations/getcurrentkey.d.ts +3 -108
  105. package/dist/esm/models/operations/getcurrentkey.d.ts.map +1 -1
  106. package/dist/esm/models/operations/getcurrentkey.js +3 -83
  107. package/dist/esm/models/operations/getcurrentkey.js.map +1 -1
  108. package/dist/esm/models/operations/list.d.ts +63 -825
  109. package/dist/esm/models/operations/list.d.ts.map +1 -1
  110. package/dist/esm/models/operations/list.js +81 -635
  111. package/dist/esm/models/operations/list.js.map +1 -1
  112. package/dist/esm/models/operations/listmodels.d.ts +16 -865
  113. package/dist/esm/models/operations/listmodels.d.ts.map +1 -1
  114. package/dist/esm/models/operations/listmodels.js +16 -704
  115. package/dist/esm/models/operations/listmodels.js.map +1 -1
  116. package/dist/esm/models/operations/listusermodels.d.ts +3 -852
  117. package/dist/esm/models/operations/listusermodels.d.ts.map +1 -1
  118. package/dist/esm/models/operations/listusermodels.js +3 -694
  119. package/dist/esm/models/operations/listusermodels.js.map +1 -1
  120. package/dist/esm/models/operations/previewzdr.d.ts +97 -97
  121. package/dist/esm/models/operations/previewzdr.d.ts.map +1 -1
  122. package/dist/esm/models/operations/previewzdr.js +118 -117
  123. package/dist/esm/models/operations/previewzdr.js.map +1 -1
  124. package/dist/esm/models/responsereasoningconfig.d.ts +4 -0
  125. package/dist/esm/models/responsereasoningconfig.d.ts.map +1 -1
  126. package/dist/esm/models/responsereasoningconfig.js +13 -0
  127. package/dist/esm/models/responsereasoningconfig.js.map +1 -1
  128. package/dist/esm/models/responsesusage.d.ts +41 -0
  129. package/dist/esm/models/responsesusage.d.ts.map +1 -1
  130. package/dist/esm/models/responsesusage.js +51 -0
  131. package/dist/esm/models/responsesusage.js.map +1 -1
  132. package/dist/esm/react-query/endpointsList.d.ts +4 -4
  133. package/dist/esm/react-query/endpointsList.d.ts.map +1 -1
  134. package/dist/esm/react-query/endpointsList.js.map +1 -1
  135. package/dist/esm/react-query/modelsList.d.ts +4 -4
  136. package/dist/esm/react-query/modelsList.d.ts.map +1 -1
  137. package/dist/esm/react-query/modelsList.js.map +1 -1
  138. package/dist/esm/sdk/endpoints.d.ts +1 -1
  139. package/dist/esm/sdk/endpoints.d.ts.map +1 -1
  140. package/dist/esm/sdk/endpoints.js.map +1 -1
  141. package/dist/esm/sdk/models.d.ts +1 -1
  142. package/dist/esm/sdk/models.d.ts.map +1 -1
  143. package/dist/esm/sdk/models.js.map +1 -1
  144. package/docs/sdks/endpoints/README.md +1 -1
  145. package/docs/sdks/models/README.md +1 -1
  146. package/docs/sdks/responses/README.md +4 -0
  147. package/examples/betaResponsesSendRequest.example.ts +2 -0
  148. package/jsr.json +1 -1
  149. package/package.json +1 -1
  150. package/src/funcs/endpointsList.ts +3 -3
  151. package/src/funcs/modelsList.ts +3 -5
  152. package/src/lib/config.ts +2 -2
  153. package/src/models/endpointslist.ts +1034 -0
  154. package/src/models/index.ts +3 -0
  155. package/src/models/keyinfo.ts +281 -0
  156. package/src/models/modelslist.ts +1394 -0
  157. package/src/models/openairesponsesrequest.ts +133 -94
  158. package/src/models/operations/getcurrentkey.ts +5 -203
  159. package/src/models/operations/list.ts +109 -1106
  160. package/src/models/operations/listmodels.ts +26 -1436
  161. package/src/models/operations/listusermodels.ts +5 -1440
  162. package/src/models/operations/previewzdr.ts +196 -225
  163. package/src/models/responsereasoningconfig.ts +17 -0
  164. package/src/models/responsesusage.ts +96 -0
  165. package/src/react-query/endpointsList.ts +4 -4
  166. package/src/react-query/modelsList.ts +4 -4
  167. package/src/sdk/endpoints.ts +1 -1
  168. package/src/sdk/models.ts +1 -1
@@ -0,0 +1,1394 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { ClosedEnum } from "../types/enums.js";
9
+ import { Result as SafeParseResult } from "../types/fp.js";
10
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
11
+
12
+ export type ModelsListPrompt = number | string | any;
13
+
14
+ export type ModelsListCompletion = number | string | any;
15
+
16
+ export type ModelsListRequest = number | string | any;
17
+
18
+ export type ModelsListImage = number | string | any;
19
+
20
+ export type ModelsListImageOutput = number | string | any;
21
+
22
+ export type ModelsListAudio = number | string | any;
23
+
24
+ export type ModelsListInputAudioCache = number | string | any;
25
+
26
+ export type ModelsListWebSearch = number | string | any;
27
+
28
+ export type ModelsListInternalReasoning = number | string | any;
29
+
30
+ export type ModelsListInputCacheRead = number | string | any;
31
+
32
+ export type ModelsListInputCacheWrite = number | string | any;
33
+
34
+ /**
35
+ * Pricing information for the model
36
+ */
37
+ export type ModelsListPricing = {
38
+ prompt?: number | string | any | undefined;
39
+ completion?: number | string | any | undefined;
40
+ request?: number | string | any | undefined;
41
+ image?: number | string | any | undefined;
42
+ imageOutput?: number | string | any | undefined;
43
+ audio?: number | string | any | undefined;
44
+ inputAudioCache?: number | string | any | undefined;
45
+ webSearch?: number | string | any | undefined;
46
+ internalReasoning?: number | string | any | undefined;
47
+ inputCacheRead?: number | string | any | undefined;
48
+ inputCacheWrite?: number | string | any | undefined;
49
+ discount?: number | undefined;
50
+ };
51
+
52
+ /**
53
+ * Tokenizer type used by the model
54
+ */
55
+ export const Tokenizer = {
56
+ Router: "Router",
57
+ Media: "Media",
58
+ Other: "Other",
59
+ Gpt: "GPT",
60
+ Claude: "Claude",
61
+ Gemini: "Gemini",
62
+ Grok: "Grok",
63
+ Cohere: "Cohere",
64
+ Nova: "Nova",
65
+ Qwen: "Qwen",
66
+ Yi: "Yi",
67
+ DeepSeek: "DeepSeek",
68
+ Mistral: "Mistral",
69
+ Llama2: "Llama2",
70
+ Llama3: "Llama3",
71
+ Llama4: "Llama4",
72
+ PaLM: "PaLM",
73
+ Rwkv: "RWKV",
74
+ Qwen3: "Qwen3",
75
+ } as const;
76
+ /**
77
+ * Tokenizer type used by the model
78
+ */
79
+ export type Tokenizer = ClosedEnum<typeof Tokenizer>;
80
+
81
+ /**
82
+ * Instruction format type
83
+ */
84
+ export const InstructType = {
85
+ None: "none",
86
+ Airoboros: "airoboros",
87
+ Alpaca: "alpaca",
88
+ AlpacaModif: "alpaca-modif",
89
+ Chatml: "chatml",
90
+ Claude: "claude",
91
+ CodeLlama: "code-llama",
92
+ Gemma: "gemma",
93
+ Llama2: "llama2",
94
+ Llama3: "llama3",
95
+ Mistral: "mistral",
96
+ Nemotron: "nemotron",
97
+ Neural: "neural",
98
+ Openchat: "openchat",
99
+ Phi3: "phi3",
100
+ Rwkv: "rwkv",
101
+ Vicuna: "vicuna",
102
+ Zephyr: "zephyr",
103
+ DeepseekR1: "deepseek-r1",
104
+ DeepseekV31: "deepseek-v3.1",
105
+ Qwq: "qwq",
106
+ Qwen3: "qwen3",
107
+ } as const;
108
+ /**
109
+ * Instruction format type
110
+ */
111
+ export type InstructType = ClosedEnum<typeof InstructType>;
112
+
113
+ export const InputModality = {
114
+ Text: "text",
115
+ Image: "image",
116
+ File: "file",
117
+ Audio: "audio",
118
+ } as const;
119
+ export type InputModality = ClosedEnum<typeof InputModality>;
120
+
121
+ export const OutputModality = {
122
+ Text: "text",
123
+ Image: "image",
124
+ Embeddings: "embeddings",
125
+ } as const;
126
+ export type OutputModality = ClosedEnum<typeof OutputModality>;
127
+
128
+ /**
129
+ * Model architecture information
130
+ */
131
+ export type Architecture = {
132
+ /**
133
+ * Tokenizer type used by the model
134
+ */
135
+ tokenizer?: Tokenizer | undefined;
136
+ /**
137
+ * Instruction format type
138
+ */
139
+ instructType?: InstructType | null | undefined;
140
+ /**
141
+ * Primary modality of the model
142
+ */
143
+ modality: string | null;
144
+ /**
145
+ * Supported input modalities
146
+ */
147
+ inputModalities: Array<InputModality>;
148
+ /**
149
+ * Supported output modalities
150
+ */
151
+ outputModalities: Array<OutputModality>;
152
+ };
153
+
154
+ /**
155
+ * Information about the top provider for this model
156
+ */
157
+ export type TopProvider = {
158
+ /**
159
+ * Context length from the top provider
160
+ */
161
+ contextLength?: number | null | undefined;
162
+ /**
163
+ * Maximum completion tokens from the top provider
164
+ */
165
+ maxCompletionTokens?: number | null | undefined;
166
+ /**
167
+ * Whether the top provider moderates content
168
+ */
169
+ isModerated: boolean;
170
+ };
171
+
172
+ /**
173
+ * Per-request token limits
174
+ */
175
+ export type PerRequestLimits = {
176
+ /**
177
+ * Maximum prompt tokens per request
178
+ */
179
+ promptTokens?: any | undefined;
180
+ /**
181
+ * Maximum completion tokens per request
182
+ */
183
+ completionTokens?: any | undefined;
184
+ };
185
+
186
+ export const ModelsListSupportedParameter = {
187
+ Temperature: "temperature",
188
+ TopP: "top_p",
189
+ TopK: "top_k",
190
+ MinP: "min_p",
191
+ TopA: "top_a",
192
+ FrequencyPenalty: "frequency_penalty",
193
+ PresencePenalty: "presence_penalty",
194
+ RepetitionPenalty: "repetition_penalty",
195
+ MaxTokens: "max_tokens",
196
+ LogitBias: "logit_bias",
197
+ Logprobs: "logprobs",
198
+ TopLogprobs: "top_logprobs",
199
+ Seed: "seed",
200
+ ResponseFormat: "response_format",
201
+ StructuredOutputs: "structured_outputs",
202
+ Stop: "stop",
203
+ Tools: "tools",
204
+ ToolChoice: "tool_choice",
205
+ ParallelToolCalls: "parallel_tool_calls",
206
+ IncludeReasoning: "include_reasoning",
207
+ Reasoning: "reasoning",
208
+ WebSearchOptions: "web_search_options",
209
+ Verbosity: "verbosity",
210
+ } as const;
211
+ export type ModelsListSupportedParameter = ClosedEnum<
212
+ typeof ModelsListSupportedParameter
213
+ >;
214
+
215
+ /**
216
+ * Default parameters for this model
217
+ */
218
+ export type DefaultParameters = {
219
+ temperature?: number | null | undefined;
220
+ topP?: number | null | undefined;
221
+ frequencyPenalty?: number | null | undefined;
222
+ };
223
+
224
+ export type ModelsList = {
225
+ /**
226
+ * Unique identifier for the model
227
+ */
228
+ id: string;
229
+ /**
230
+ * Canonical slug for the model
231
+ */
232
+ canonicalSlug: string;
233
+ /**
234
+ * Hugging Face model identifier, if applicable
235
+ */
236
+ huggingFaceId?: string | null | undefined;
237
+ /**
238
+ * Display name of the model
239
+ */
240
+ name: string;
241
+ /**
242
+ * Unix timestamp of when the model was created
243
+ */
244
+ created: number;
245
+ /**
246
+ * Description of the model
247
+ */
248
+ description?: string | undefined;
249
+ /**
250
+ * Pricing information for the model
251
+ */
252
+ pricing: ModelsListPricing;
253
+ /**
254
+ * Maximum context length in tokens
255
+ */
256
+ contextLength: number | null;
257
+ /**
258
+ * Model architecture information
259
+ */
260
+ architecture: Architecture;
261
+ /**
262
+ * Information about the top provider for this model
263
+ */
264
+ topProvider: TopProvider;
265
+ /**
266
+ * Per-request token limits
267
+ */
268
+ perRequestLimits: PerRequestLimits | null;
269
+ /**
270
+ * List of supported parameters for this model
271
+ */
272
+ supportedParameters: Array<ModelsListSupportedParameter>;
273
+ /**
274
+ * Default parameters for this model
275
+ */
276
+ defaultParameters: DefaultParameters | null;
277
+ };
278
+
279
+ /** @internal */
280
+ export const ModelsListPrompt$inboundSchema: z.ZodType<
281
+ ModelsListPrompt,
282
+ z.ZodTypeDef,
283
+ unknown
284
+ > = z.union([z.number(), z.string(), z.any()]);
285
+
286
+ /** @internal */
287
+ export type ModelsListPrompt$Outbound = number | string | any;
288
+
289
+ /** @internal */
290
+ export const ModelsListPrompt$outboundSchema: z.ZodType<
291
+ ModelsListPrompt$Outbound,
292
+ z.ZodTypeDef,
293
+ ModelsListPrompt
294
+ > = z.union([z.number(), z.string(), z.any()]);
295
+
296
+ /**
297
+ * @internal
298
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
299
+ */
300
+ export namespace ModelsListPrompt$ {
301
+ /** @deprecated use `ModelsListPrompt$inboundSchema` instead. */
302
+ export const inboundSchema = ModelsListPrompt$inboundSchema;
303
+ /** @deprecated use `ModelsListPrompt$outboundSchema` instead. */
304
+ export const outboundSchema = ModelsListPrompt$outboundSchema;
305
+ /** @deprecated use `ModelsListPrompt$Outbound` instead. */
306
+ export type Outbound = ModelsListPrompt$Outbound;
307
+ }
308
+
309
+ export function modelsListPromptToJSON(
310
+ modelsListPrompt: ModelsListPrompt,
311
+ ): string {
312
+ return JSON.stringify(
313
+ ModelsListPrompt$outboundSchema.parse(modelsListPrompt),
314
+ );
315
+ }
316
+
317
+ export function modelsListPromptFromJSON(
318
+ jsonString: string,
319
+ ): SafeParseResult<ModelsListPrompt, SDKValidationError> {
320
+ return safeParse(
321
+ jsonString,
322
+ (x) => ModelsListPrompt$inboundSchema.parse(JSON.parse(x)),
323
+ `Failed to parse 'ModelsListPrompt' from JSON`,
324
+ );
325
+ }
326
+
327
+ /** @internal */
328
+ export const ModelsListCompletion$inboundSchema: z.ZodType<
329
+ ModelsListCompletion,
330
+ z.ZodTypeDef,
331
+ unknown
332
+ > = z.union([z.number(), z.string(), z.any()]);
333
+
334
+ /** @internal */
335
+ export type ModelsListCompletion$Outbound = number | string | any;
336
+
337
+ /** @internal */
338
+ export const ModelsListCompletion$outboundSchema: z.ZodType<
339
+ ModelsListCompletion$Outbound,
340
+ z.ZodTypeDef,
341
+ ModelsListCompletion
342
+ > = z.union([z.number(), z.string(), z.any()]);
343
+
344
+ /**
345
+ * @internal
346
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
347
+ */
348
+ export namespace ModelsListCompletion$ {
349
+ /** @deprecated use `ModelsListCompletion$inboundSchema` instead. */
350
+ export const inboundSchema = ModelsListCompletion$inboundSchema;
351
+ /** @deprecated use `ModelsListCompletion$outboundSchema` instead. */
352
+ export const outboundSchema = ModelsListCompletion$outboundSchema;
353
+ /** @deprecated use `ModelsListCompletion$Outbound` instead. */
354
+ export type Outbound = ModelsListCompletion$Outbound;
355
+ }
356
+
357
+ export function modelsListCompletionToJSON(
358
+ modelsListCompletion: ModelsListCompletion,
359
+ ): string {
360
+ return JSON.stringify(
361
+ ModelsListCompletion$outboundSchema.parse(modelsListCompletion),
362
+ );
363
+ }
364
+
365
+ export function modelsListCompletionFromJSON(
366
+ jsonString: string,
367
+ ): SafeParseResult<ModelsListCompletion, SDKValidationError> {
368
+ return safeParse(
369
+ jsonString,
370
+ (x) => ModelsListCompletion$inboundSchema.parse(JSON.parse(x)),
371
+ `Failed to parse 'ModelsListCompletion' from JSON`,
372
+ );
373
+ }
374
+
375
+ /** @internal */
376
+ export const ModelsListRequest$inboundSchema: z.ZodType<
377
+ ModelsListRequest,
378
+ z.ZodTypeDef,
379
+ unknown
380
+ > = z.union([z.number(), z.string(), z.any()]);
381
+
382
+ /** @internal */
383
+ export type ModelsListRequest$Outbound = number | string | any;
384
+
385
+ /** @internal */
386
+ export const ModelsListRequest$outboundSchema: z.ZodType<
387
+ ModelsListRequest$Outbound,
388
+ z.ZodTypeDef,
389
+ ModelsListRequest
390
+ > = z.union([z.number(), z.string(), z.any()]);
391
+
392
+ /**
393
+ * @internal
394
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
395
+ */
396
+ export namespace ModelsListRequest$ {
397
+ /** @deprecated use `ModelsListRequest$inboundSchema` instead. */
398
+ export const inboundSchema = ModelsListRequest$inboundSchema;
399
+ /** @deprecated use `ModelsListRequest$outboundSchema` instead. */
400
+ export const outboundSchema = ModelsListRequest$outboundSchema;
401
+ /** @deprecated use `ModelsListRequest$Outbound` instead. */
402
+ export type Outbound = ModelsListRequest$Outbound;
403
+ }
404
+
405
+ export function modelsListRequestToJSON(
406
+ modelsListRequest: ModelsListRequest,
407
+ ): string {
408
+ return JSON.stringify(
409
+ ModelsListRequest$outboundSchema.parse(modelsListRequest),
410
+ );
411
+ }
412
+
413
+ export function modelsListRequestFromJSON(
414
+ jsonString: string,
415
+ ): SafeParseResult<ModelsListRequest, SDKValidationError> {
416
+ return safeParse(
417
+ jsonString,
418
+ (x) => ModelsListRequest$inboundSchema.parse(JSON.parse(x)),
419
+ `Failed to parse 'ModelsListRequest' from JSON`,
420
+ );
421
+ }
422
+
423
+ /** @internal */
424
+ export const ModelsListImage$inboundSchema: z.ZodType<
425
+ ModelsListImage,
426
+ z.ZodTypeDef,
427
+ unknown
428
+ > = z.union([z.number(), z.string(), z.any()]);
429
+
430
+ /** @internal */
431
+ export type ModelsListImage$Outbound = number | string | any;
432
+
433
+ /** @internal */
434
+ export const ModelsListImage$outboundSchema: z.ZodType<
435
+ ModelsListImage$Outbound,
436
+ z.ZodTypeDef,
437
+ ModelsListImage
438
+ > = z.union([z.number(), z.string(), z.any()]);
439
+
440
+ /**
441
+ * @internal
442
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
443
+ */
444
+ export namespace ModelsListImage$ {
445
+ /** @deprecated use `ModelsListImage$inboundSchema` instead. */
446
+ export const inboundSchema = ModelsListImage$inboundSchema;
447
+ /** @deprecated use `ModelsListImage$outboundSchema` instead. */
448
+ export const outboundSchema = ModelsListImage$outboundSchema;
449
+ /** @deprecated use `ModelsListImage$Outbound` instead. */
450
+ export type Outbound = ModelsListImage$Outbound;
451
+ }
452
+
453
+ export function modelsListImageToJSON(
454
+ modelsListImage: ModelsListImage,
455
+ ): string {
456
+ return JSON.stringify(ModelsListImage$outboundSchema.parse(modelsListImage));
457
+ }
458
+
459
+ export function modelsListImageFromJSON(
460
+ jsonString: string,
461
+ ): SafeParseResult<ModelsListImage, SDKValidationError> {
462
+ return safeParse(
463
+ jsonString,
464
+ (x) => ModelsListImage$inboundSchema.parse(JSON.parse(x)),
465
+ `Failed to parse 'ModelsListImage' from JSON`,
466
+ );
467
+ }
468
+
469
+ /** @internal */
470
+ export const ModelsListImageOutput$inboundSchema: z.ZodType<
471
+ ModelsListImageOutput,
472
+ z.ZodTypeDef,
473
+ unknown
474
+ > = z.union([z.number(), z.string(), z.any()]);
475
+
476
+ /** @internal */
477
+ export type ModelsListImageOutput$Outbound = number | string | any;
478
+
479
+ /** @internal */
480
+ export const ModelsListImageOutput$outboundSchema: z.ZodType<
481
+ ModelsListImageOutput$Outbound,
482
+ z.ZodTypeDef,
483
+ ModelsListImageOutput
484
+ > = z.union([z.number(), z.string(), z.any()]);
485
+
486
+ /**
487
+ * @internal
488
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
489
+ */
490
+ export namespace ModelsListImageOutput$ {
491
+ /** @deprecated use `ModelsListImageOutput$inboundSchema` instead. */
492
+ export const inboundSchema = ModelsListImageOutput$inboundSchema;
493
+ /** @deprecated use `ModelsListImageOutput$outboundSchema` instead. */
494
+ export const outboundSchema = ModelsListImageOutput$outboundSchema;
495
+ /** @deprecated use `ModelsListImageOutput$Outbound` instead. */
496
+ export type Outbound = ModelsListImageOutput$Outbound;
497
+ }
498
+
499
+ export function modelsListImageOutputToJSON(
500
+ modelsListImageOutput: ModelsListImageOutput,
501
+ ): string {
502
+ return JSON.stringify(
503
+ ModelsListImageOutput$outboundSchema.parse(modelsListImageOutput),
504
+ );
505
+ }
506
+
507
+ export function modelsListImageOutputFromJSON(
508
+ jsonString: string,
509
+ ): SafeParseResult<ModelsListImageOutput, SDKValidationError> {
510
+ return safeParse(
511
+ jsonString,
512
+ (x) => ModelsListImageOutput$inboundSchema.parse(JSON.parse(x)),
513
+ `Failed to parse 'ModelsListImageOutput' from JSON`,
514
+ );
515
+ }
516
+
517
+ /** @internal */
518
+ export const ModelsListAudio$inboundSchema: z.ZodType<
519
+ ModelsListAudio,
520
+ z.ZodTypeDef,
521
+ unknown
522
+ > = z.union([z.number(), z.string(), z.any()]);
523
+
524
+ /** @internal */
525
+ export type ModelsListAudio$Outbound = number | string | any;
526
+
527
+ /** @internal */
528
+ export const ModelsListAudio$outboundSchema: z.ZodType<
529
+ ModelsListAudio$Outbound,
530
+ z.ZodTypeDef,
531
+ ModelsListAudio
532
+ > = z.union([z.number(), z.string(), z.any()]);
533
+
534
+ /**
535
+ * @internal
536
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
537
+ */
538
+ export namespace ModelsListAudio$ {
539
+ /** @deprecated use `ModelsListAudio$inboundSchema` instead. */
540
+ export const inboundSchema = ModelsListAudio$inboundSchema;
541
+ /** @deprecated use `ModelsListAudio$outboundSchema` instead. */
542
+ export const outboundSchema = ModelsListAudio$outboundSchema;
543
+ /** @deprecated use `ModelsListAudio$Outbound` instead. */
544
+ export type Outbound = ModelsListAudio$Outbound;
545
+ }
546
+
547
+ export function modelsListAudioToJSON(
548
+ modelsListAudio: ModelsListAudio,
549
+ ): string {
550
+ return JSON.stringify(ModelsListAudio$outboundSchema.parse(modelsListAudio));
551
+ }
552
+
553
+ export function modelsListAudioFromJSON(
554
+ jsonString: string,
555
+ ): SafeParseResult<ModelsListAudio, SDKValidationError> {
556
+ return safeParse(
557
+ jsonString,
558
+ (x) => ModelsListAudio$inboundSchema.parse(JSON.parse(x)),
559
+ `Failed to parse 'ModelsListAudio' from JSON`,
560
+ );
561
+ }
562
+
563
+ /** @internal */
564
+ export const ModelsListInputAudioCache$inboundSchema: z.ZodType<
565
+ ModelsListInputAudioCache,
566
+ z.ZodTypeDef,
567
+ unknown
568
+ > = z.union([z.number(), z.string(), z.any()]);
569
+
570
+ /** @internal */
571
+ export type ModelsListInputAudioCache$Outbound = number | string | any;
572
+
573
+ /** @internal */
574
+ export const ModelsListInputAudioCache$outboundSchema: z.ZodType<
575
+ ModelsListInputAudioCache$Outbound,
576
+ z.ZodTypeDef,
577
+ ModelsListInputAudioCache
578
+ > = z.union([z.number(), z.string(), z.any()]);
579
+
580
+ /**
581
+ * @internal
582
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
583
+ */
584
+ export namespace ModelsListInputAudioCache$ {
585
+ /** @deprecated use `ModelsListInputAudioCache$inboundSchema` instead. */
586
+ export const inboundSchema = ModelsListInputAudioCache$inboundSchema;
587
+ /** @deprecated use `ModelsListInputAudioCache$outboundSchema` instead. */
588
+ export const outboundSchema = ModelsListInputAudioCache$outboundSchema;
589
+ /** @deprecated use `ModelsListInputAudioCache$Outbound` instead. */
590
+ export type Outbound = ModelsListInputAudioCache$Outbound;
591
+ }
592
+
593
+ export function modelsListInputAudioCacheToJSON(
594
+ modelsListInputAudioCache: ModelsListInputAudioCache,
595
+ ): string {
596
+ return JSON.stringify(
597
+ ModelsListInputAudioCache$outboundSchema.parse(modelsListInputAudioCache),
598
+ );
599
+ }
600
+
601
+ export function modelsListInputAudioCacheFromJSON(
602
+ jsonString: string,
603
+ ): SafeParseResult<ModelsListInputAudioCache, SDKValidationError> {
604
+ return safeParse(
605
+ jsonString,
606
+ (x) => ModelsListInputAudioCache$inboundSchema.parse(JSON.parse(x)),
607
+ `Failed to parse 'ModelsListInputAudioCache' from JSON`,
608
+ );
609
+ }
610
+
611
+ /** @internal */
612
+ export const ModelsListWebSearch$inboundSchema: z.ZodType<
613
+ ModelsListWebSearch,
614
+ z.ZodTypeDef,
615
+ unknown
616
+ > = z.union([z.number(), z.string(), z.any()]);
617
+
618
+ /** @internal */
619
+ export type ModelsListWebSearch$Outbound = number | string | any;
620
+
621
+ /** @internal */
622
+ export const ModelsListWebSearch$outboundSchema: z.ZodType<
623
+ ModelsListWebSearch$Outbound,
624
+ z.ZodTypeDef,
625
+ ModelsListWebSearch
626
+ > = z.union([z.number(), z.string(), z.any()]);
627
+
628
+ /**
629
+ * @internal
630
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
631
+ */
632
+ export namespace ModelsListWebSearch$ {
633
+ /** @deprecated use `ModelsListWebSearch$inboundSchema` instead. */
634
+ export const inboundSchema = ModelsListWebSearch$inboundSchema;
635
+ /** @deprecated use `ModelsListWebSearch$outboundSchema` instead. */
636
+ export const outboundSchema = ModelsListWebSearch$outboundSchema;
637
+ /** @deprecated use `ModelsListWebSearch$Outbound` instead. */
638
+ export type Outbound = ModelsListWebSearch$Outbound;
639
+ }
640
+
641
+ export function modelsListWebSearchToJSON(
642
+ modelsListWebSearch: ModelsListWebSearch,
643
+ ): string {
644
+ return JSON.stringify(
645
+ ModelsListWebSearch$outboundSchema.parse(modelsListWebSearch),
646
+ );
647
+ }
648
+
649
+ export function modelsListWebSearchFromJSON(
650
+ jsonString: string,
651
+ ): SafeParseResult<ModelsListWebSearch, SDKValidationError> {
652
+ return safeParse(
653
+ jsonString,
654
+ (x) => ModelsListWebSearch$inboundSchema.parse(JSON.parse(x)),
655
+ `Failed to parse 'ModelsListWebSearch' from JSON`,
656
+ );
657
+ }
658
+
659
+ /** @internal */
660
+ export const ModelsListInternalReasoning$inboundSchema: z.ZodType<
661
+ ModelsListInternalReasoning,
662
+ z.ZodTypeDef,
663
+ unknown
664
+ > = z.union([z.number(), z.string(), z.any()]);
665
+
666
+ /** @internal */
667
+ export type ModelsListInternalReasoning$Outbound = number | string | any;
668
+
669
+ /** @internal */
670
+ export const ModelsListInternalReasoning$outboundSchema: z.ZodType<
671
+ ModelsListInternalReasoning$Outbound,
672
+ z.ZodTypeDef,
673
+ ModelsListInternalReasoning
674
+ > = z.union([z.number(), z.string(), z.any()]);
675
+
676
+ /**
677
+ * @internal
678
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
679
+ */
680
+ export namespace ModelsListInternalReasoning$ {
681
+ /** @deprecated use `ModelsListInternalReasoning$inboundSchema` instead. */
682
+ export const inboundSchema = ModelsListInternalReasoning$inboundSchema;
683
+ /** @deprecated use `ModelsListInternalReasoning$outboundSchema` instead. */
684
+ export const outboundSchema = ModelsListInternalReasoning$outboundSchema;
685
+ /** @deprecated use `ModelsListInternalReasoning$Outbound` instead. */
686
+ export type Outbound = ModelsListInternalReasoning$Outbound;
687
+ }
688
+
689
+ export function modelsListInternalReasoningToJSON(
690
+ modelsListInternalReasoning: ModelsListInternalReasoning,
691
+ ): string {
692
+ return JSON.stringify(
693
+ ModelsListInternalReasoning$outboundSchema.parse(
694
+ modelsListInternalReasoning,
695
+ ),
696
+ );
697
+ }
698
+
699
+ export function modelsListInternalReasoningFromJSON(
700
+ jsonString: string,
701
+ ): SafeParseResult<ModelsListInternalReasoning, SDKValidationError> {
702
+ return safeParse(
703
+ jsonString,
704
+ (x) => ModelsListInternalReasoning$inboundSchema.parse(JSON.parse(x)),
705
+ `Failed to parse 'ModelsListInternalReasoning' from JSON`,
706
+ );
707
+ }
708
+
709
+ /** @internal */
710
+ export const ModelsListInputCacheRead$inboundSchema: z.ZodType<
711
+ ModelsListInputCacheRead,
712
+ z.ZodTypeDef,
713
+ unknown
714
+ > = z.union([z.number(), z.string(), z.any()]);
715
+
716
+ /** @internal */
717
+ export type ModelsListInputCacheRead$Outbound = number | string | any;
718
+
719
+ /** @internal */
720
+ export const ModelsListInputCacheRead$outboundSchema: z.ZodType<
721
+ ModelsListInputCacheRead$Outbound,
722
+ z.ZodTypeDef,
723
+ ModelsListInputCacheRead
724
+ > = z.union([z.number(), z.string(), z.any()]);
725
+
726
+ /**
727
+ * @internal
728
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
729
+ */
730
+ export namespace ModelsListInputCacheRead$ {
731
+ /** @deprecated use `ModelsListInputCacheRead$inboundSchema` instead. */
732
+ export const inboundSchema = ModelsListInputCacheRead$inboundSchema;
733
+ /** @deprecated use `ModelsListInputCacheRead$outboundSchema` instead. */
734
+ export const outboundSchema = ModelsListInputCacheRead$outboundSchema;
735
+ /** @deprecated use `ModelsListInputCacheRead$Outbound` instead. */
736
+ export type Outbound = ModelsListInputCacheRead$Outbound;
737
+ }
738
+
739
+ export function modelsListInputCacheReadToJSON(
740
+ modelsListInputCacheRead: ModelsListInputCacheRead,
741
+ ): string {
742
+ return JSON.stringify(
743
+ ModelsListInputCacheRead$outboundSchema.parse(modelsListInputCacheRead),
744
+ );
745
+ }
746
+
747
+ export function modelsListInputCacheReadFromJSON(
748
+ jsonString: string,
749
+ ): SafeParseResult<ModelsListInputCacheRead, SDKValidationError> {
750
+ return safeParse(
751
+ jsonString,
752
+ (x) => ModelsListInputCacheRead$inboundSchema.parse(JSON.parse(x)),
753
+ `Failed to parse 'ModelsListInputCacheRead' from JSON`,
754
+ );
755
+ }
756
+
757
+ /** @internal */
758
+ export const ModelsListInputCacheWrite$inboundSchema: z.ZodType<
759
+ ModelsListInputCacheWrite,
760
+ z.ZodTypeDef,
761
+ unknown
762
+ > = z.union([z.number(), z.string(), z.any()]);
763
+
764
+ /** @internal */
765
+ export type ModelsListInputCacheWrite$Outbound = number | string | any;
766
+
767
+ /** @internal */
768
+ export const ModelsListInputCacheWrite$outboundSchema: z.ZodType<
769
+ ModelsListInputCacheWrite$Outbound,
770
+ z.ZodTypeDef,
771
+ ModelsListInputCacheWrite
772
+ > = z.union([z.number(), z.string(), z.any()]);
773
+
774
+ /**
775
+ * @internal
776
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
777
+ */
778
+ export namespace ModelsListInputCacheWrite$ {
779
+ /** @deprecated use `ModelsListInputCacheWrite$inboundSchema` instead. */
780
+ export const inboundSchema = ModelsListInputCacheWrite$inboundSchema;
781
+ /** @deprecated use `ModelsListInputCacheWrite$outboundSchema` instead. */
782
+ export const outboundSchema = ModelsListInputCacheWrite$outboundSchema;
783
+ /** @deprecated use `ModelsListInputCacheWrite$Outbound` instead. */
784
+ export type Outbound = ModelsListInputCacheWrite$Outbound;
785
+ }
786
+
787
+ export function modelsListInputCacheWriteToJSON(
788
+ modelsListInputCacheWrite: ModelsListInputCacheWrite,
789
+ ): string {
790
+ return JSON.stringify(
791
+ ModelsListInputCacheWrite$outboundSchema.parse(modelsListInputCacheWrite),
792
+ );
793
+ }
794
+
795
+ export function modelsListInputCacheWriteFromJSON(
796
+ jsonString: string,
797
+ ): SafeParseResult<ModelsListInputCacheWrite, SDKValidationError> {
798
+ return safeParse(
799
+ jsonString,
800
+ (x) => ModelsListInputCacheWrite$inboundSchema.parse(JSON.parse(x)),
801
+ `Failed to parse 'ModelsListInputCacheWrite' from JSON`,
802
+ );
803
+ }
804
+
805
+ /** @internal */
806
+ export const ModelsListPricing$inboundSchema: z.ZodType<
807
+ ModelsListPricing,
808
+ z.ZodTypeDef,
809
+ unknown
810
+ > = z.object({
811
+ prompt: z.union([z.number(), z.string(), z.any()]).optional(),
812
+ completion: z.union([z.number(), z.string(), z.any()]).optional(),
813
+ request: z.union([z.number(), z.string(), z.any()]).optional(),
814
+ image: z.union([z.number(), z.string(), z.any()]).optional(),
815
+ image_output: z.union([z.number(), z.string(), z.any()]).optional(),
816
+ audio: z.union([z.number(), z.string(), z.any()]).optional(),
817
+ input_audio_cache: z.union([z.number(), z.string(), z.any()]).optional(),
818
+ web_search: z.union([z.number(), z.string(), z.any()]).optional(),
819
+ internal_reasoning: z.union([z.number(), z.string(), z.any()]).optional(),
820
+ input_cache_read: z.union([z.number(), z.string(), z.any()]).optional(),
821
+ input_cache_write: z.union([z.number(), z.string(), z.any()]).optional(),
822
+ discount: z.number().optional(),
823
+ }).transform((v) => {
824
+ return remap$(v, {
825
+ "image_output": "imageOutput",
826
+ "input_audio_cache": "inputAudioCache",
827
+ "web_search": "webSearch",
828
+ "internal_reasoning": "internalReasoning",
829
+ "input_cache_read": "inputCacheRead",
830
+ "input_cache_write": "inputCacheWrite",
831
+ });
832
+ });
833
+
834
+ /** @internal */
835
+ export type ModelsListPricing$Outbound = {
836
+ prompt?: number | string | any | undefined;
837
+ completion?: number | string | any | undefined;
838
+ request?: number | string | any | undefined;
839
+ image?: number | string | any | undefined;
840
+ image_output?: number | string | any | undefined;
841
+ audio?: number | string | any | undefined;
842
+ input_audio_cache?: number | string | any | undefined;
843
+ web_search?: number | string | any | undefined;
844
+ internal_reasoning?: number | string | any | undefined;
845
+ input_cache_read?: number | string | any | undefined;
846
+ input_cache_write?: number | string | any | undefined;
847
+ discount?: number | undefined;
848
+ };
849
+
850
+ /** @internal */
851
+ export const ModelsListPricing$outboundSchema: z.ZodType<
852
+ ModelsListPricing$Outbound,
853
+ z.ZodTypeDef,
854
+ ModelsListPricing
855
+ > = z.object({
856
+ prompt: z.union([z.number(), z.string(), z.any()]).optional(),
857
+ completion: z.union([z.number(), z.string(), z.any()]).optional(),
858
+ request: z.union([z.number(), z.string(), z.any()]).optional(),
859
+ image: z.union([z.number(), z.string(), z.any()]).optional(),
860
+ imageOutput: z.union([z.number(), z.string(), z.any()]).optional(),
861
+ audio: z.union([z.number(), z.string(), z.any()]).optional(),
862
+ inputAudioCache: z.union([z.number(), z.string(), z.any()]).optional(),
863
+ webSearch: z.union([z.number(), z.string(), z.any()]).optional(),
864
+ internalReasoning: z.union([z.number(), z.string(), z.any()]).optional(),
865
+ inputCacheRead: z.union([z.number(), z.string(), z.any()]).optional(),
866
+ inputCacheWrite: z.union([z.number(), z.string(), z.any()]).optional(),
867
+ discount: z.number().optional(),
868
+ }).transform((v) => {
869
+ return remap$(v, {
870
+ imageOutput: "image_output",
871
+ inputAudioCache: "input_audio_cache",
872
+ webSearch: "web_search",
873
+ internalReasoning: "internal_reasoning",
874
+ inputCacheRead: "input_cache_read",
875
+ inputCacheWrite: "input_cache_write",
876
+ });
877
+ });
878
+
879
+ /**
880
+ * @internal
881
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
882
+ */
883
+ export namespace ModelsListPricing$ {
884
+ /** @deprecated use `ModelsListPricing$inboundSchema` instead. */
885
+ export const inboundSchema = ModelsListPricing$inboundSchema;
886
+ /** @deprecated use `ModelsListPricing$outboundSchema` instead. */
887
+ export const outboundSchema = ModelsListPricing$outboundSchema;
888
+ /** @deprecated use `ModelsListPricing$Outbound` instead. */
889
+ export type Outbound = ModelsListPricing$Outbound;
890
+ }
891
+
892
+ export function modelsListPricingToJSON(
893
+ modelsListPricing: ModelsListPricing,
894
+ ): string {
895
+ return JSON.stringify(
896
+ ModelsListPricing$outboundSchema.parse(modelsListPricing),
897
+ );
898
+ }
899
+
900
+ export function modelsListPricingFromJSON(
901
+ jsonString: string,
902
+ ): SafeParseResult<ModelsListPricing, SDKValidationError> {
903
+ return safeParse(
904
+ jsonString,
905
+ (x) => ModelsListPricing$inboundSchema.parse(JSON.parse(x)),
906
+ `Failed to parse 'ModelsListPricing' from JSON`,
907
+ );
908
+ }
909
+
910
+ /** @internal */
911
+ export const Tokenizer$inboundSchema: z.ZodNativeEnum<typeof Tokenizer> = z
912
+ .nativeEnum(Tokenizer);
913
+
914
+ /** @internal */
915
+ export const Tokenizer$outboundSchema: z.ZodNativeEnum<typeof Tokenizer> =
916
+ Tokenizer$inboundSchema;
917
+
918
+ /**
919
+ * @internal
920
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
921
+ */
922
+ export namespace Tokenizer$ {
923
+ /** @deprecated use `Tokenizer$inboundSchema` instead. */
924
+ export const inboundSchema = Tokenizer$inboundSchema;
925
+ /** @deprecated use `Tokenizer$outboundSchema` instead. */
926
+ export const outboundSchema = Tokenizer$outboundSchema;
927
+ }
928
+
929
+ /** @internal */
930
+ export const InstructType$inboundSchema: z.ZodNativeEnum<typeof InstructType> =
931
+ z.nativeEnum(InstructType);
932
+
933
+ /** @internal */
934
+ export const InstructType$outboundSchema: z.ZodNativeEnum<typeof InstructType> =
935
+ InstructType$inboundSchema;
936
+
937
+ /**
938
+ * @internal
939
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
940
+ */
941
+ export namespace InstructType$ {
942
+ /** @deprecated use `InstructType$inboundSchema` instead. */
943
+ export const inboundSchema = InstructType$inboundSchema;
944
+ /** @deprecated use `InstructType$outboundSchema` instead. */
945
+ export const outboundSchema = InstructType$outboundSchema;
946
+ }
947
+
948
+ /** @internal */
949
+ export const InputModality$inboundSchema: z.ZodNativeEnum<
950
+ typeof InputModality
951
+ > = z.nativeEnum(InputModality);
952
+
953
+ /** @internal */
954
+ export const InputModality$outboundSchema: z.ZodNativeEnum<
955
+ typeof InputModality
956
+ > = InputModality$inboundSchema;
957
+
958
+ /**
959
+ * @internal
960
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
961
+ */
962
+ export namespace InputModality$ {
963
+ /** @deprecated use `InputModality$inboundSchema` instead. */
964
+ export const inboundSchema = InputModality$inboundSchema;
965
+ /** @deprecated use `InputModality$outboundSchema` instead. */
966
+ export const outboundSchema = InputModality$outboundSchema;
967
+ }
968
+
969
+ /** @internal */
970
+ export const OutputModality$inboundSchema: z.ZodNativeEnum<
971
+ typeof OutputModality
972
+ > = z.nativeEnum(OutputModality);
973
+
974
+ /** @internal */
975
+ export const OutputModality$outboundSchema: z.ZodNativeEnum<
976
+ typeof OutputModality
977
+ > = OutputModality$inboundSchema;
978
+
979
+ /**
980
+ * @internal
981
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
982
+ */
983
+ export namespace OutputModality$ {
984
+ /** @deprecated use `OutputModality$inboundSchema` instead. */
985
+ export const inboundSchema = OutputModality$inboundSchema;
986
+ /** @deprecated use `OutputModality$outboundSchema` instead. */
987
+ export const outboundSchema = OutputModality$outboundSchema;
988
+ }
989
+
990
+ /** @internal */
991
+ export const Architecture$inboundSchema: z.ZodType<
992
+ Architecture,
993
+ z.ZodTypeDef,
994
+ unknown
995
+ > = z.object({
996
+ tokenizer: Tokenizer$inboundSchema.optional(),
997
+ instruct_type: z.nullable(InstructType$inboundSchema).optional(),
998
+ modality: z.nullable(z.string()),
999
+ input_modalities: z.array(InputModality$inboundSchema),
1000
+ output_modalities: z.array(OutputModality$inboundSchema),
1001
+ }).transform((v) => {
1002
+ return remap$(v, {
1003
+ "instruct_type": "instructType",
1004
+ "input_modalities": "inputModalities",
1005
+ "output_modalities": "outputModalities",
1006
+ });
1007
+ });
1008
+
1009
+ /** @internal */
1010
+ export type Architecture$Outbound = {
1011
+ tokenizer?: string | undefined;
1012
+ instruct_type?: string | null | undefined;
1013
+ modality: string | null;
1014
+ input_modalities: Array<string>;
1015
+ output_modalities: Array<string>;
1016
+ };
1017
+
1018
+ /** @internal */
1019
+ export const Architecture$outboundSchema: z.ZodType<
1020
+ Architecture$Outbound,
1021
+ z.ZodTypeDef,
1022
+ Architecture
1023
+ > = z.object({
1024
+ tokenizer: Tokenizer$outboundSchema.optional(),
1025
+ instructType: z.nullable(InstructType$outboundSchema).optional(),
1026
+ modality: z.nullable(z.string()),
1027
+ inputModalities: z.array(InputModality$outboundSchema),
1028
+ outputModalities: z.array(OutputModality$outboundSchema),
1029
+ }).transform((v) => {
1030
+ return remap$(v, {
1031
+ instructType: "instruct_type",
1032
+ inputModalities: "input_modalities",
1033
+ outputModalities: "output_modalities",
1034
+ });
1035
+ });
1036
+
1037
+ /**
1038
+ * @internal
1039
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1040
+ */
1041
+ export namespace Architecture$ {
1042
+ /** @deprecated use `Architecture$inboundSchema` instead. */
1043
+ export const inboundSchema = Architecture$inboundSchema;
1044
+ /** @deprecated use `Architecture$outboundSchema` instead. */
1045
+ export const outboundSchema = Architecture$outboundSchema;
1046
+ /** @deprecated use `Architecture$Outbound` instead. */
1047
+ export type Outbound = Architecture$Outbound;
1048
+ }
1049
+
1050
+ export function architectureToJSON(architecture: Architecture): string {
1051
+ return JSON.stringify(Architecture$outboundSchema.parse(architecture));
1052
+ }
1053
+
1054
+ export function architectureFromJSON(
1055
+ jsonString: string,
1056
+ ): SafeParseResult<Architecture, SDKValidationError> {
1057
+ return safeParse(
1058
+ jsonString,
1059
+ (x) => Architecture$inboundSchema.parse(JSON.parse(x)),
1060
+ `Failed to parse 'Architecture' from JSON`,
1061
+ );
1062
+ }
1063
+
1064
+ /** @internal */
1065
+ export const TopProvider$inboundSchema: z.ZodType<
1066
+ TopProvider,
1067
+ z.ZodTypeDef,
1068
+ unknown
1069
+ > = z.object({
1070
+ context_length: z.nullable(z.number()).optional(),
1071
+ max_completion_tokens: z.nullable(z.number()).optional(),
1072
+ is_moderated: z.boolean(),
1073
+ }).transform((v) => {
1074
+ return remap$(v, {
1075
+ "context_length": "contextLength",
1076
+ "max_completion_tokens": "maxCompletionTokens",
1077
+ "is_moderated": "isModerated",
1078
+ });
1079
+ });
1080
+
1081
+ /** @internal */
1082
+ export type TopProvider$Outbound = {
1083
+ context_length?: number | null | undefined;
1084
+ max_completion_tokens?: number | null | undefined;
1085
+ is_moderated: boolean;
1086
+ };
1087
+
1088
+ /** @internal */
1089
+ export const TopProvider$outboundSchema: z.ZodType<
1090
+ TopProvider$Outbound,
1091
+ z.ZodTypeDef,
1092
+ TopProvider
1093
+ > = z.object({
1094
+ contextLength: z.nullable(z.number()).optional(),
1095
+ maxCompletionTokens: z.nullable(z.number()).optional(),
1096
+ isModerated: z.boolean(),
1097
+ }).transform((v) => {
1098
+ return remap$(v, {
1099
+ contextLength: "context_length",
1100
+ maxCompletionTokens: "max_completion_tokens",
1101
+ isModerated: "is_moderated",
1102
+ });
1103
+ });
1104
+
1105
+ /**
1106
+ * @internal
1107
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1108
+ */
1109
+ export namespace TopProvider$ {
1110
+ /** @deprecated use `TopProvider$inboundSchema` instead. */
1111
+ export const inboundSchema = TopProvider$inboundSchema;
1112
+ /** @deprecated use `TopProvider$outboundSchema` instead. */
1113
+ export const outboundSchema = TopProvider$outboundSchema;
1114
+ /** @deprecated use `TopProvider$Outbound` instead. */
1115
+ export type Outbound = TopProvider$Outbound;
1116
+ }
1117
+
1118
+ export function topProviderToJSON(topProvider: TopProvider): string {
1119
+ return JSON.stringify(TopProvider$outboundSchema.parse(topProvider));
1120
+ }
1121
+
1122
+ export function topProviderFromJSON(
1123
+ jsonString: string,
1124
+ ): SafeParseResult<TopProvider, SDKValidationError> {
1125
+ return safeParse(
1126
+ jsonString,
1127
+ (x) => TopProvider$inboundSchema.parse(JSON.parse(x)),
1128
+ `Failed to parse 'TopProvider' from JSON`,
1129
+ );
1130
+ }
1131
+
1132
+ /** @internal */
1133
+ export const PerRequestLimits$inboundSchema: z.ZodType<
1134
+ PerRequestLimits,
1135
+ z.ZodTypeDef,
1136
+ unknown
1137
+ > = z.object({
1138
+ prompt_tokens: z.any().optional(),
1139
+ completion_tokens: z.any().optional(),
1140
+ }).transform((v) => {
1141
+ return remap$(v, {
1142
+ "prompt_tokens": "promptTokens",
1143
+ "completion_tokens": "completionTokens",
1144
+ });
1145
+ });
1146
+
1147
+ /** @internal */
1148
+ export type PerRequestLimits$Outbound = {
1149
+ prompt_tokens?: any | undefined;
1150
+ completion_tokens?: any | undefined;
1151
+ };
1152
+
1153
+ /** @internal */
1154
+ export const PerRequestLimits$outboundSchema: z.ZodType<
1155
+ PerRequestLimits$Outbound,
1156
+ z.ZodTypeDef,
1157
+ PerRequestLimits
1158
+ > = z.object({
1159
+ promptTokens: z.any().optional(),
1160
+ completionTokens: z.any().optional(),
1161
+ }).transform((v) => {
1162
+ return remap$(v, {
1163
+ promptTokens: "prompt_tokens",
1164
+ completionTokens: "completion_tokens",
1165
+ });
1166
+ });
1167
+
1168
+ /**
1169
+ * @internal
1170
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1171
+ */
1172
+ export namespace PerRequestLimits$ {
1173
+ /** @deprecated use `PerRequestLimits$inboundSchema` instead. */
1174
+ export const inboundSchema = PerRequestLimits$inboundSchema;
1175
+ /** @deprecated use `PerRequestLimits$outboundSchema` instead. */
1176
+ export const outboundSchema = PerRequestLimits$outboundSchema;
1177
+ /** @deprecated use `PerRequestLimits$Outbound` instead. */
1178
+ export type Outbound = PerRequestLimits$Outbound;
1179
+ }
1180
+
1181
+ export function perRequestLimitsToJSON(
1182
+ perRequestLimits: PerRequestLimits,
1183
+ ): string {
1184
+ return JSON.stringify(
1185
+ PerRequestLimits$outboundSchema.parse(perRequestLimits),
1186
+ );
1187
+ }
1188
+
1189
+ export function perRequestLimitsFromJSON(
1190
+ jsonString: string,
1191
+ ): SafeParseResult<PerRequestLimits, SDKValidationError> {
1192
+ return safeParse(
1193
+ jsonString,
1194
+ (x) => PerRequestLimits$inboundSchema.parse(JSON.parse(x)),
1195
+ `Failed to parse 'PerRequestLimits' from JSON`,
1196
+ );
1197
+ }
1198
+
1199
+ /** @internal */
1200
+ export const ModelsListSupportedParameter$inboundSchema: z.ZodNativeEnum<
1201
+ typeof ModelsListSupportedParameter
1202
+ > = z.nativeEnum(ModelsListSupportedParameter);
1203
+
1204
+ /** @internal */
1205
+ export const ModelsListSupportedParameter$outboundSchema: z.ZodNativeEnum<
1206
+ typeof ModelsListSupportedParameter
1207
+ > = ModelsListSupportedParameter$inboundSchema;
1208
+
1209
+ /**
1210
+ * @internal
1211
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1212
+ */
1213
+ export namespace ModelsListSupportedParameter$ {
1214
+ /** @deprecated use `ModelsListSupportedParameter$inboundSchema` instead. */
1215
+ export const inboundSchema = ModelsListSupportedParameter$inboundSchema;
1216
+ /** @deprecated use `ModelsListSupportedParameter$outboundSchema` instead. */
1217
+ export const outboundSchema = ModelsListSupportedParameter$outboundSchema;
1218
+ }
1219
+
1220
+ /** @internal */
1221
+ export const DefaultParameters$inboundSchema: z.ZodType<
1222
+ DefaultParameters,
1223
+ z.ZodTypeDef,
1224
+ unknown
1225
+ > = z.object({
1226
+ temperature: z.nullable(z.number()).optional(),
1227
+ top_p: z.nullable(z.number()).optional(),
1228
+ frequency_penalty: z.nullable(z.number()).optional(),
1229
+ }).transform((v) => {
1230
+ return remap$(v, {
1231
+ "top_p": "topP",
1232
+ "frequency_penalty": "frequencyPenalty",
1233
+ });
1234
+ });
1235
+
1236
+ /** @internal */
1237
+ export type DefaultParameters$Outbound = {
1238
+ temperature?: number | null | undefined;
1239
+ top_p?: number | null | undefined;
1240
+ frequency_penalty?: number | null | undefined;
1241
+ };
1242
+
1243
+ /** @internal */
1244
+ export const DefaultParameters$outboundSchema: z.ZodType<
1245
+ DefaultParameters$Outbound,
1246
+ z.ZodTypeDef,
1247
+ DefaultParameters
1248
+ > = z.object({
1249
+ temperature: z.nullable(z.number()).optional(),
1250
+ topP: z.nullable(z.number()).optional(),
1251
+ frequencyPenalty: z.nullable(z.number()).optional(),
1252
+ }).transform((v) => {
1253
+ return remap$(v, {
1254
+ topP: "top_p",
1255
+ frequencyPenalty: "frequency_penalty",
1256
+ });
1257
+ });
1258
+
1259
+ /**
1260
+ * @internal
1261
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1262
+ */
1263
+ export namespace DefaultParameters$ {
1264
+ /** @deprecated use `DefaultParameters$inboundSchema` instead. */
1265
+ export const inboundSchema = DefaultParameters$inboundSchema;
1266
+ /** @deprecated use `DefaultParameters$outboundSchema` instead. */
1267
+ export const outboundSchema = DefaultParameters$outboundSchema;
1268
+ /** @deprecated use `DefaultParameters$Outbound` instead. */
1269
+ export type Outbound = DefaultParameters$Outbound;
1270
+ }
1271
+
1272
+ export function defaultParametersToJSON(
1273
+ defaultParameters: DefaultParameters,
1274
+ ): string {
1275
+ return JSON.stringify(
1276
+ DefaultParameters$outboundSchema.parse(defaultParameters),
1277
+ );
1278
+ }
1279
+
1280
+ export function defaultParametersFromJSON(
1281
+ jsonString: string,
1282
+ ): SafeParseResult<DefaultParameters, SDKValidationError> {
1283
+ return safeParse(
1284
+ jsonString,
1285
+ (x) => DefaultParameters$inboundSchema.parse(JSON.parse(x)),
1286
+ `Failed to parse 'DefaultParameters' from JSON`,
1287
+ );
1288
+ }
1289
+
1290
+ /** @internal */
1291
+ export const ModelsList$inboundSchema: z.ZodType<
1292
+ ModelsList,
1293
+ z.ZodTypeDef,
1294
+ unknown
1295
+ > = z.object({
1296
+ id: z.string(),
1297
+ canonical_slug: z.string(),
1298
+ hugging_face_id: z.nullable(z.string()).optional(),
1299
+ name: z.string(),
1300
+ created: z.number(),
1301
+ description: z.string().optional(),
1302
+ pricing: z.lazy(() => ModelsListPricing$inboundSchema),
1303
+ context_length: z.nullable(z.number()),
1304
+ architecture: z.lazy(() => Architecture$inboundSchema),
1305
+ top_provider: z.lazy(() => TopProvider$inboundSchema),
1306
+ per_request_limits: z.nullable(z.lazy(() => PerRequestLimits$inboundSchema)),
1307
+ supported_parameters: z.array(ModelsListSupportedParameter$inboundSchema),
1308
+ default_parameters: z.nullable(z.lazy(() => DefaultParameters$inboundSchema)),
1309
+ }).transform((v) => {
1310
+ return remap$(v, {
1311
+ "canonical_slug": "canonicalSlug",
1312
+ "hugging_face_id": "huggingFaceId",
1313
+ "context_length": "contextLength",
1314
+ "top_provider": "topProvider",
1315
+ "per_request_limits": "perRequestLimits",
1316
+ "supported_parameters": "supportedParameters",
1317
+ "default_parameters": "defaultParameters",
1318
+ });
1319
+ });
1320
+
1321
+ /** @internal */
1322
+ export type ModelsList$Outbound = {
1323
+ id: string;
1324
+ canonical_slug: string;
1325
+ hugging_face_id?: string | null | undefined;
1326
+ name: string;
1327
+ created: number;
1328
+ description?: string | undefined;
1329
+ pricing: ModelsListPricing$Outbound;
1330
+ context_length: number | null;
1331
+ architecture: Architecture$Outbound;
1332
+ top_provider: TopProvider$Outbound;
1333
+ per_request_limits: PerRequestLimits$Outbound | null;
1334
+ supported_parameters: Array<string>;
1335
+ default_parameters: DefaultParameters$Outbound | null;
1336
+ };
1337
+
1338
+ /** @internal */
1339
+ export const ModelsList$outboundSchema: z.ZodType<
1340
+ ModelsList$Outbound,
1341
+ z.ZodTypeDef,
1342
+ ModelsList
1343
+ > = z.object({
1344
+ id: z.string(),
1345
+ canonicalSlug: z.string(),
1346
+ huggingFaceId: z.nullable(z.string()).optional(),
1347
+ name: z.string(),
1348
+ created: z.number(),
1349
+ description: z.string().optional(),
1350
+ pricing: z.lazy(() => ModelsListPricing$outboundSchema),
1351
+ contextLength: z.nullable(z.number()),
1352
+ architecture: z.lazy(() => Architecture$outboundSchema),
1353
+ topProvider: z.lazy(() => TopProvider$outboundSchema),
1354
+ perRequestLimits: z.nullable(z.lazy(() => PerRequestLimits$outboundSchema)),
1355
+ supportedParameters: z.array(ModelsListSupportedParameter$outboundSchema),
1356
+ defaultParameters: z.nullable(z.lazy(() => DefaultParameters$outboundSchema)),
1357
+ }).transform((v) => {
1358
+ return remap$(v, {
1359
+ canonicalSlug: "canonical_slug",
1360
+ huggingFaceId: "hugging_face_id",
1361
+ contextLength: "context_length",
1362
+ topProvider: "top_provider",
1363
+ perRequestLimits: "per_request_limits",
1364
+ supportedParameters: "supported_parameters",
1365
+ defaultParameters: "default_parameters",
1366
+ });
1367
+ });
1368
+
1369
+ /**
1370
+ * @internal
1371
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1372
+ */
1373
+ export namespace ModelsList$ {
1374
+ /** @deprecated use `ModelsList$inboundSchema` instead. */
1375
+ export const inboundSchema = ModelsList$inboundSchema;
1376
+ /** @deprecated use `ModelsList$outboundSchema` instead. */
1377
+ export const outboundSchema = ModelsList$outboundSchema;
1378
+ /** @deprecated use `ModelsList$Outbound` instead. */
1379
+ export type Outbound = ModelsList$Outbound;
1380
+ }
1381
+
1382
+ export function modelsListToJSON(modelsList: ModelsList): string {
1383
+ return JSON.stringify(ModelsList$outboundSchema.parse(modelsList));
1384
+ }
1385
+
1386
+ export function modelsListFromJSON(
1387
+ jsonString: string,
1388
+ ): SafeParseResult<ModelsList, SDKValidationError> {
1389
+ return safeParse(
1390
+ jsonString,
1391
+ (x) => ModelsList$inboundSchema.parse(JSON.parse(x)),
1392
+ `Failed to parse 'ModelsList' from JSON`,
1393
+ );
1394
+ }