@openrouter/sdk 0.1.10 → 0.1.13

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 (98) hide show
  1. package/esm/lib/config.d.ts +3 -3
  2. package/esm/lib/config.js +3 -3
  3. package/esm/models/chatgenerationparams.d.ts +2 -1
  4. package/esm/models/chatgenerationparams.js +4 -4
  5. package/esm/models/chatmessagecontentitem.d.ts +4 -0
  6. package/esm/models/chatmessagecontentitem.js +2 -0
  7. package/esm/models/chatmessagecontentitemaudio.d.ts +1 -1
  8. package/esm/models/chatmessagecontentitemaudio.js +3 -10
  9. package/esm/models/chatmessagecontentitemimage.d.ts +1 -1
  10. package/esm/models/chatmessagecontentitemimage.js +3 -10
  11. package/esm/models/chatmessagecontentitemvideo.d.ts +48 -11
  12. package/esm/models/chatmessagecontentitemvideo.js +64 -11
  13. package/esm/models/chatresponsechoice.d.ts +21 -1
  14. package/esm/models/chatresponsechoice.js +25 -1
  15. package/esm/models/chatstreamingresponsechunk.d.ts +1 -1
  16. package/esm/models/chatstreamingresponsechunk.js +1 -1
  17. package/esm/models/completionchoice.js +2 -6
  18. package/esm/models/createchargerequest.d.ts +1 -1
  19. package/esm/models/createchargerequest.js +3 -4
  20. package/esm/models/datacollection.d.ts +26 -0
  21. package/esm/models/datacollection.js +19 -0
  22. package/esm/models/endpointstatus.js +2 -7
  23. package/esm/models/imagegenerationstatus.d.ts +1 -1
  24. package/esm/models/imagegenerationstatus.js +3 -11
  25. package/esm/models/index.d.ts +2 -2
  26. package/esm/models/index.js +2 -2
  27. package/esm/models/inputmodality.js +2 -7
  28. package/esm/models/instructtype.js +2 -7
  29. package/esm/models/listendpointsresponse.js +3 -6
  30. package/esm/models/modelarchitecture.js +2 -6
  31. package/esm/models/modelgroup.js +2 -7
  32. package/esm/models/openairesponsesincludable.d.ts +1 -1
  33. package/esm/models/openairesponsesincludable.js +2 -5
  34. package/esm/models/openairesponsesincompletedetails.js +3 -6
  35. package/esm/models/openairesponsesreasoningeffort.d.ts +2 -1
  36. package/esm/models/openairesponsesreasoningeffort.js +4 -11
  37. package/esm/models/openairesponsesresponsestatus.js +2 -7
  38. package/esm/models/openairesponsesservicetier.js +2 -7
  39. package/esm/models/openairesponsestruncation.js +2 -7
  40. package/esm/models/openresponsesreasoning.d.ts +2 -1
  41. package/esm/models/openresponsesreasoning.js +3 -4
  42. package/esm/models/openresponsesrequest.d.ts +8 -40
  43. package/esm/models/openresponsesrequest.js +10 -49
  44. package/esm/models/openresponsesresponsetext.d.ts +1 -1
  45. package/esm/models/openresponsesresponsetext.js +2 -4
  46. package/esm/models/operations/createauthkeyscode.d.ts +1 -1
  47. package/esm/models/operations/createauthkeyscode.js +2 -4
  48. package/esm/models/operations/createembeddings.d.ts +82 -61
  49. package/esm/models/operations/createembeddings.js +72 -52
  50. package/esm/models/operations/createkeys.d.ts +2 -2
  51. package/esm/models/operations/createkeys.js +3 -5
  52. package/esm/models/operations/exchangeauthcodeforapikey.d.ts +1 -1
  53. package/esm/models/operations/exchangeauthcodeforapikey.js +3 -4
  54. package/esm/models/operations/getcurrentkey.d.ts +4 -0
  55. package/esm/models/operations/getcurrentkey.js +2 -0
  56. package/esm/models/operations/getgeneration.js +3 -6
  57. package/esm/models/operations/getkey.js +1 -1
  58. package/esm/models/operations/getparameters.d.ts +3 -9
  59. package/esm/models/operations/getparameters.js +5 -18
  60. package/esm/models/operations/list.js +1 -1
  61. package/esm/models/operations/updatekeys.d.ts +1 -1
  62. package/esm/models/operations/updatekeys.js +3 -5
  63. package/esm/models/outputmodality.js +2 -7
  64. package/esm/models/parameter.js +3 -7
  65. package/esm/models/providername.d.ts +3 -27
  66. package/esm/models/providername.js +5 -37
  67. package/esm/models/providersort.d.ts +17 -0
  68. package/esm/models/providersort.js +15 -0
  69. package/esm/models/publicendpoint.d.ts +4 -0
  70. package/esm/models/publicendpoint.js +4 -6
  71. package/esm/models/publicpricing.d.ts +4 -0
  72. package/esm/models/publicpricing.js +2 -0
  73. package/esm/models/quantization.d.ts +1 -1
  74. package/esm/models/quantization.js +2 -5
  75. package/esm/models/reasoningsummaryverbosity.d.ts +1 -1
  76. package/esm/models/reasoningsummaryverbosity.js +3 -11
  77. package/esm/models/responseinputaudio.d.ts +1 -1
  78. package/esm/models/responseinputaudio.js +3 -10
  79. package/esm/models/responseinputimage.d.ts +1 -1
  80. package/esm/models/responseinputimage.js +3 -10
  81. package/esm/models/responseserrorfield.js +3 -6
  82. package/esm/models/responsessearchcontextsize.d.ts +1 -1
  83. package/esm/models/responsessearchcontextsize.js +3 -11
  84. package/esm/models/responsetextconfig.js +2 -6
  85. package/esm/models/toolcallstatus.d.ts +1 -1
  86. package/esm/models/toolcallstatus.js +3 -11
  87. package/esm/models/websearchstatus.d.ts +1 -1
  88. package/esm/models/websearchstatus.js +3 -11
  89. package/esm/types/enums.d.ts +10 -6
  90. package/esm/types/enums.js +38 -1
  91. package/esm/types/index.d.ts +0 -1
  92. package/esm/types/index.js +0 -1
  93. package/jsr.json +1 -1
  94. package/package.json +1 -1
  95. package/esm/models/chatcompletionfinishreason.d.ts +0 -13
  96. package/esm/models/chatcompletionfinishreason.js +0 -19
  97. package/esm/models/chatstreamingchoice.d.ts +0 -16
  98. package/esm/models/chatstreamingchoice.js +0 -24
@@ -4,6 +4,7 @@
4
4
  import * as z from "zod/v4";
5
5
  import { remap as remap$ } from "../../lib/primitives.js";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
+ import * as openEnums from "../../types/enums.js";
7
8
  /**
8
9
  * The method used to generate the code challenge
9
10
  */
@@ -12,10 +13,7 @@ export const CreateAuthKeysCodeCodeChallengeMethod = {
12
13
  Plain: "plain",
13
14
  };
14
15
  /** @internal */
15
- export const CreateAuthKeysCodeCodeChallengeMethod$outboundSchema = z.union([
16
- z.enum(CreateAuthKeysCodeCodeChallengeMethod),
17
- z.string().and(z.custom()),
18
- ]);
16
+ export const CreateAuthKeysCodeCodeChallengeMethod$outboundSchema = openEnums.outboundSchema(CreateAuthKeysCodeCodeChallengeMethod);
19
17
  /** @internal */
20
18
  export const CreateAuthKeysCodeRequest$outboundSchema = z.object({
21
19
  callbackUrl: z.string(),
@@ -3,41 +3,38 @@ 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
5
  import * as models from "../index.js";
6
- export type Input = string | Array<string> | Array<number> | Array<Array<number>>;
7
- /**
8
- * Data collection setting. If no available model provider meets the requirement, your request will return an error.
9
- *
10
- * @remarks
11
- * - allow: (default) allow providers which store user data non-transiently and may train on it
12
- * - deny: use only providers which do not collect user data.
13
- */
14
- export declare const DataCollection: {
15
- readonly Deny: "deny";
16
- readonly Allow: "allow";
6
+ export declare const TypeImageURL: {
7
+ readonly ImageUrl: "image_url";
17
8
  };
18
- /**
19
- * Data collection setting. If no available model provider meets the requirement, your request will return an error.
20
- *
21
- * @remarks
22
- * - allow: (default) allow providers which store user data non-transiently and may train on it
23
- * - deny: use only providers which do not collect user data.
24
- */
25
- export type DataCollection = OpenEnum<typeof DataCollection>;
9
+ export type TypeImageURL = ClosedEnum<typeof TypeImageURL>;
10
+ export type ImageUrl = {
11
+ url: string;
12
+ };
13
+ export type ContentImageURL = {
14
+ type: TypeImageURL;
15
+ imageUrl: ImageUrl;
16
+ };
17
+ export declare const TypeText: {
18
+ readonly Text: "text";
19
+ };
20
+ export type TypeText = ClosedEnum<typeof TypeText>;
21
+ export type ContentText = {
22
+ type: TypeText;
23
+ text: string;
24
+ };
25
+ export type Content = ContentText | ContentImageURL;
26
+ export type Input = {
27
+ content: Array<ContentText | ContentImageURL>;
28
+ };
29
+ export type InputUnion = string | Array<string> | Array<number> | Array<Array<number>> | Array<Input>;
30
+ export declare const EncodingFormat: {
31
+ readonly Float: "float";
32
+ readonly Base64: "base64";
33
+ };
34
+ export type EncodingFormat = OpenEnum<typeof EncodingFormat>;
26
35
  export type Order = models.ProviderName | string;
27
36
  export type Only = models.ProviderName | string;
28
37
  export type Ignore = models.ProviderName | string;
29
- /**
30
- * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
31
- */
32
- export declare const Sort: {
33
- readonly Price: "price";
34
- readonly Throughput: "throughput";
35
- readonly Latency: "latency";
36
- };
37
- /**
38
- * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
39
- */
40
- export type Sort = OpenEnum<typeof Sort>;
41
38
  /**
42
39
  * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
43
40
  */
@@ -81,9 +78,10 @@ export type CreateEmbeddingsProvider = {
81
78
  *
82
79
  * @remarks
83
80
  * - allow: (default) allow providers which store user data non-transiently and may train on it
81
+ *
84
82
  * - deny: use only providers which do not collect user data.
85
83
  */
86
- dataCollection?: DataCollection | null | undefined;
84
+ dataCollection?: models.DataCollection | null | undefined;
87
85
  /**
88
86
  * Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.
89
87
  */
@@ -111,27 +109,20 @@ export type CreateEmbeddingsProvider = {
111
109
  /**
112
110
  * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
113
111
  */
114
- sort?: Sort | null | undefined;
112
+ sort?: models.ProviderSort | null | undefined;
115
113
  /**
116
114
  * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
117
115
  */
118
116
  maxPrice?: MaxPrice | undefined;
119
117
  };
120
- export declare const EncodingFormatBase64: {
121
- readonly Base64: "base64";
122
- };
123
- export type EncodingFormatBase64 = ClosedEnum<typeof EncodingFormatBase64>;
124
- export declare const EncodingFormatFloat: {
125
- readonly Float: "float";
126
- };
127
- export type EncodingFormatFloat = ClosedEnum<typeof EncodingFormatFloat>;
128
- export type EncodingFormat = EncodingFormatFloat | EncodingFormatBase64;
129
118
  export type CreateEmbeddingsRequest = {
130
- input: string | Array<string> | Array<number> | Array<Array<number>>;
119
+ input: string | Array<string> | Array<number> | Array<Array<number>> | Array<Input>;
131
120
  model: string;
132
- provider?: CreateEmbeddingsProvider | undefined;
133
- encodingFormat?: EncodingFormatFloat | EncodingFormatBase64 | undefined;
121
+ encodingFormat?: EncodingFormat | undefined;
122
+ dimensions?: number | undefined;
134
123
  user?: string | undefined;
124
+ provider?: CreateEmbeddingsProvider | undefined;
125
+ inputType?: string | undefined;
135
126
  };
136
127
  export declare const ObjectT: {
137
128
  readonly List: "list";
@@ -164,12 +155,51 @@ export type CreateEmbeddingsResponseBody = {
164
155
  };
165
156
  export type CreateEmbeddingsResponse = CreateEmbeddingsResponseBody | string;
166
157
  /** @internal */
167
- export type Input$Outbound = string | Array<string> | Array<number> | Array<Array<number>>;
158
+ export declare const TypeImageURL$outboundSchema: z.ZodEnum<typeof TypeImageURL>;
159
+ /** @internal */
160
+ export type ImageUrl$Outbound = {
161
+ url: string;
162
+ };
163
+ /** @internal */
164
+ export declare const ImageUrl$outboundSchema: z.ZodType<ImageUrl$Outbound, ImageUrl>;
165
+ export declare function imageUrlToJSON(imageUrl: ImageUrl): string;
166
+ /** @internal */
167
+ export type ContentImageURL$Outbound = {
168
+ type: string;
169
+ image_url: ImageUrl$Outbound;
170
+ };
171
+ /** @internal */
172
+ export declare const ContentImageURL$outboundSchema: z.ZodType<ContentImageURL$Outbound, ContentImageURL>;
173
+ export declare function contentImageURLToJSON(contentImageURL: ContentImageURL): string;
174
+ /** @internal */
175
+ export declare const TypeText$outboundSchema: z.ZodEnum<typeof TypeText>;
176
+ /** @internal */
177
+ export type ContentText$Outbound = {
178
+ type: string;
179
+ text: string;
180
+ };
181
+ /** @internal */
182
+ export declare const ContentText$outboundSchema: z.ZodType<ContentText$Outbound, ContentText>;
183
+ export declare function contentTextToJSON(contentText: ContentText): string;
184
+ /** @internal */
185
+ export type Content$Outbound = ContentText$Outbound | ContentImageURL$Outbound;
186
+ /** @internal */
187
+ export declare const Content$outboundSchema: z.ZodType<Content$Outbound, Content>;
188
+ export declare function contentToJSON(content: Content): string;
189
+ /** @internal */
190
+ export type Input$Outbound = {
191
+ content: Array<ContentText$Outbound | ContentImageURL$Outbound>;
192
+ };
168
193
  /** @internal */
169
194
  export declare const Input$outboundSchema: z.ZodType<Input$Outbound, Input>;
170
195
  export declare function inputToJSON(input: Input): string;
171
196
  /** @internal */
172
- export declare const DataCollection$outboundSchema: z.ZodType<DataCollection, DataCollection>;
197
+ export type InputUnion$Outbound = string | Array<string> | Array<number> | Array<Array<number>> | Array<Input$Outbound>;
198
+ /** @internal */
199
+ export declare const InputUnion$outboundSchema: z.ZodType<InputUnion$Outbound, InputUnion>;
200
+ export declare function inputUnionToJSON(inputUnion: InputUnion): string;
201
+ /** @internal */
202
+ export declare const EncodingFormat$outboundSchema: z.ZodType<string, EncodingFormat>;
173
203
  /** @internal */
174
204
  export type Order$Outbound = string | string;
175
205
  /** @internal */
@@ -186,8 +216,6 @@ export type Ignore$Outbound = string | string;
186
216
  export declare const Ignore$outboundSchema: z.ZodType<Ignore$Outbound, Ignore>;
187
217
  export declare function ignoreToJSON(ignore: Ignore): string;
188
218
  /** @internal */
189
- export declare const Sort$outboundSchema: z.ZodType<Sort, Sort>;
190
- /** @internal */
191
219
  export type MaxPrice$Outbound = {
192
220
  prompt?: any | undefined;
193
221
  completion?: any | undefined;
@@ -216,21 +244,14 @@ export type CreateEmbeddingsProvider$Outbound = {
216
244
  export declare const CreateEmbeddingsProvider$outboundSchema: z.ZodType<CreateEmbeddingsProvider$Outbound, CreateEmbeddingsProvider>;
217
245
  export declare function createEmbeddingsProviderToJSON(createEmbeddingsProvider: CreateEmbeddingsProvider): string;
218
246
  /** @internal */
219
- export declare const EncodingFormatBase64$outboundSchema: z.ZodEnum<typeof EncodingFormatBase64>;
220
- /** @internal */
221
- export declare const EncodingFormatFloat$outboundSchema: z.ZodEnum<typeof EncodingFormatFloat>;
222
- /** @internal */
223
- export type EncodingFormat$Outbound = string | string;
224
- /** @internal */
225
- export declare const EncodingFormat$outboundSchema: z.ZodType<EncodingFormat$Outbound, EncodingFormat>;
226
- export declare function encodingFormatToJSON(encodingFormat: EncodingFormat): string;
227
- /** @internal */
228
247
  export type CreateEmbeddingsRequest$Outbound = {
229
- input: string | Array<string> | Array<number> | Array<Array<number>>;
248
+ input: string | Array<string> | Array<number> | Array<Array<number>> | Array<Input$Outbound>;
230
249
  model: string;
231
- provider?: CreateEmbeddingsProvider$Outbound | undefined;
232
- encoding_format?: string | string | undefined;
250
+ encoding_format?: string | undefined;
251
+ dimensions?: number | undefined;
233
252
  user?: string | undefined;
253
+ provider?: CreateEmbeddingsProvider$Outbound | undefined;
254
+ input_type?: string | undefined;
234
255
  };
235
256
  /** @internal */
236
257
  export declare const CreateEmbeddingsRequest$outboundSchema: z.ZodType<CreateEmbeddingsRequest$Outbound, CreateEmbeddingsRequest>;
@@ -4,31 +4,17 @@
4
4
  import * as z from "zod/v4";
5
5
  import { remap as remap$ } from "../../lib/primitives.js";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
+ import * as openEnums from "../../types/enums.js";
7
8
  import * as models from "../index.js";
8
- /**
9
- * Data collection setting. If no available model provider meets the requirement, your request will return an error.
10
- *
11
- * @remarks
12
- * - allow: (default) allow providers which store user data non-transiently and may train on it
13
- * - deny: use only providers which do not collect user data.
14
- */
15
- export const DataCollection = {
16
- Deny: "deny",
17
- Allow: "allow",
9
+ export const TypeImageURL = {
10
+ ImageUrl: "image_url",
18
11
  };
19
- /**
20
- * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
21
- */
22
- export const Sort = {
23
- Price: "price",
24
- Throughput: "throughput",
25
- Latency: "latency",
12
+ export const TypeText = {
13
+ Text: "text",
26
14
  };
27
- export const EncodingFormatBase64 = {
28
- Base64: "base64",
29
- };
30
- export const EncodingFormatFloat = {
15
+ export const EncodingFormat = {
31
16
  Float: "float",
17
+ Base64: "base64",
32
18
  };
33
19
  export const ObjectT = {
34
20
  List: "list",
@@ -37,20 +23,70 @@ export const ObjectEmbedding = {
37
23
  Embedding: "embedding",
38
24
  };
39
25
  /** @internal */
40
- export const Input$outboundSchema = z.union([
26
+ export const TypeImageURL$outboundSchema = z
27
+ .enum(TypeImageURL);
28
+ /** @internal */
29
+ export const ImageUrl$outboundSchema = z
30
+ .object({
31
+ url: z.string(),
32
+ });
33
+ export function imageUrlToJSON(imageUrl) {
34
+ return JSON.stringify(ImageUrl$outboundSchema.parse(imageUrl));
35
+ }
36
+ /** @internal */
37
+ export const ContentImageURL$outboundSchema = z.object({
38
+ type: TypeImageURL$outboundSchema,
39
+ imageUrl: z.lazy(() => ImageUrl$outboundSchema),
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ imageUrl: "image_url",
43
+ });
44
+ });
45
+ export function contentImageURLToJSON(contentImageURL) {
46
+ return JSON.stringify(ContentImageURL$outboundSchema.parse(contentImageURL));
47
+ }
48
+ /** @internal */
49
+ export const TypeText$outboundSchema = z.enum(TypeText);
50
+ /** @internal */
51
+ export const ContentText$outboundSchema = z.object({
52
+ type: TypeText$outboundSchema,
53
+ text: z.string(),
54
+ });
55
+ export function contentTextToJSON(contentText) {
56
+ return JSON.stringify(ContentText$outboundSchema.parse(contentText));
57
+ }
58
+ /** @internal */
59
+ export const Content$outboundSchema = z
60
+ .union([
61
+ z.lazy(() => ContentText$outboundSchema),
62
+ z.lazy(() => ContentImageURL$outboundSchema),
63
+ ]);
64
+ export function contentToJSON(content) {
65
+ return JSON.stringify(Content$outboundSchema.parse(content));
66
+ }
67
+ /** @internal */
68
+ export const Input$outboundSchema = z.object({
69
+ content: z.array(z.union([
70
+ z.lazy(() => ContentText$outboundSchema),
71
+ z.lazy(() => ContentImageURL$outboundSchema),
72
+ ])),
73
+ });
74
+ export function inputToJSON(input) {
75
+ return JSON.stringify(Input$outboundSchema.parse(input));
76
+ }
77
+ /** @internal */
78
+ export const InputUnion$outboundSchema = z.union([
41
79
  z.string(),
42
80
  z.array(z.string()),
43
81
  z.array(z.number()),
44
82
  z.array(z.array(z.number())),
83
+ z.array(z.lazy(() => Input$outboundSchema)),
45
84
  ]);
46
- export function inputToJSON(input) {
47
- return JSON.stringify(Input$outboundSchema.parse(input));
85
+ export function inputUnionToJSON(inputUnion) {
86
+ return JSON.stringify(InputUnion$outboundSchema.parse(inputUnion));
48
87
  }
49
88
  /** @internal */
50
- export const DataCollection$outboundSchema = z.union([
51
- z.enum(DataCollection),
52
- z.string().and(z.custom()),
53
- ]);
89
+ export const EncodingFormat$outboundSchema = openEnums.outboundSchema(EncodingFormat);
54
90
  /** @internal */
55
91
  export const Order$outboundSchema = z.union([
56
92
  models.ProviderName$outboundSchema,
@@ -74,11 +110,6 @@ export function ignoreToJSON(ignore) {
74
110
  return JSON.stringify(Ignore$outboundSchema.parse(ignore));
75
111
  }
76
112
  /** @internal */
77
- export const Sort$outboundSchema = z.union([
78
- z.enum(Sort),
79
- z.string().and(z.custom()),
80
- ]);
81
- /** @internal */
82
113
  export const MaxPrice$outboundSchema = z
83
114
  .object({
84
115
  prompt: z.any().optional(),
@@ -94,7 +125,7 @@ export function maxPriceToJSON(maxPrice) {
94
125
  export const CreateEmbeddingsProvider$outboundSchema = z.object({
95
126
  allowFallbacks: z.nullable(z.boolean()).optional(),
96
127
  requireParameters: z.nullable(z.boolean()).optional(),
97
- dataCollection: z.nullable(DataCollection$outboundSchema).optional(),
128
+ dataCollection: z.nullable(models.DataCollection$outboundSchema).optional(),
98
129
  zdr: z.nullable(z.boolean()).optional(),
99
130
  enforceDistillableText: z.nullable(z.boolean()).optional(),
100
131
  order: z.nullable(z.array(z.union([models.ProviderName$outboundSchema, z.string()]))).optional(),
@@ -102,7 +133,7 @@ export const CreateEmbeddingsProvider$outboundSchema = z.object({
102
133
  ignore: z.nullable(z.array(z.union([models.ProviderName$outboundSchema, z.string()]))).optional(),
103
134
  quantizations: z.nullable(z.array(models.Quantization$outboundSchema))
104
135
  .optional(),
105
- sort: z.nullable(Sort$outboundSchema).optional(),
136
+ sort: z.nullable(models.ProviderSort$outboundSchema).optional(),
106
137
  maxPrice: z.lazy(() => MaxPrice$outboundSchema).optional(),
107
138
  }).transform((v) => {
108
139
  return remap$(v, {
@@ -117,35 +148,24 @@ export function createEmbeddingsProviderToJSON(createEmbeddingsProvider) {
117
148
  return JSON.stringify(CreateEmbeddingsProvider$outboundSchema.parse(createEmbeddingsProvider));
118
149
  }
119
150
  /** @internal */
120
- export const EncodingFormatBase64$outboundSchema = z.enum(EncodingFormatBase64);
121
- /** @internal */
122
- export const EncodingFormatFloat$outboundSchema = z.enum(EncodingFormatFloat);
123
- /** @internal */
124
- export const EncodingFormat$outboundSchema = z.union([
125
- EncodingFormatFloat$outboundSchema,
126
- EncodingFormatBase64$outboundSchema,
127
- ]);
128
- export function encodingFormatToJSON(encodingFormat) {
129
- return JSON.stringify(EncodingFormat$outboundSchema.parse(encodingFormat));
130
- }
131
- /** @internal */
132
151
  export const CreateEmbeddingsRequest$outboundSchema = z.object({
133
152
  input: z.union([
134
153
  z.string(),
135
154
  z.array(z.string()),
136
155
  z.array(z.number()),
137
156
  z.array(z.array(z.number())),
157
+ z.array(z.lazy(() => Input$outboundSchema)),
138
158
  ]),
139
159
  model: z.string(),
140
- provider: z.lazy(() => CreateEmbeddingsProvider$outboundSchema).optional(),
141
- encodingFormat: z.union([
142
- EncodingFormatFloat$outboundSchema,
143
- EncodingFormatBase64$outboundSchema,
144
- ]).optional(),
160
+ encodingFormat: EncodingFormat$outboundSchema.optional(),
161
+ dimensions: z.int().optional(),
145
162
  user: z.string().optional(),
163
+ provider: z.lazy(() => CreateEmbeddingsProvider$outboundSchema).optional(),
164
+ inputType: z.string().optional(),
146
165
  }).transform((v) => {
147
166
  return remap$(v, {
148
167
  encodingFormat: "encoding_format",
168
+ inputType: "input_type",
149
169
  });
150
170
  });
151
171
  export function createEmbeddingsRequestToJSON(createEmbeddingsRequest) {
@@ -32,7 +32,7 @@ export type CreateKeysRequest = {
32
32
  */
33
33
  includeByokInLimit?: boolean | undefined;
34
34
  /**
35
- * Optional ISO 8601 timestamp with timezone when the API key should expire
35
+ * Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected
36
36
  */
37
37
  expiresAt?: Date | null | undefined;
38
38
  };
@@ -131,7 +131,7 @@ export type CreateKeysResponse = {
131
131
  key: string;
132
132
  };
133
133
  /** @internal */
134
- export declare const CreateKeysLimitReset$outboundSchema: z.ZodType<CreateKeysLimitReset, CreateKeysLimitReset>;
134
+ export declare const CreateKeysLimitReset$outboundSchema: z.ZodType<string, CreateKeysLimitReset>;
135
135
  /** @internal */
136
136
  export type CreateKeysRequest$Outbound = {
137
137
  name: string;
@@ -4,6 +4,7 @@
4
4
  import * as z from "zod/v4";
5
5
  import { remap as remap$ } from "../../lib/primitives.js";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
+ import * as openEnums from "../../types/enums.js";
7
8
  /**
8
9
  * Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.
9
10
  */
@@ -13,10 +14,7 @@ export const CreateKeysLimitReset = {
13
14
  Monthly: "monthly",
14
15
  };
15
16
  /** @internal */
16
- export const CreateKeysLimitReset$outboundSchema = z.union([
17
- z.enum(CreateKeysLimitReset),
18
- z.string().and(z.custom()),
19
- ]);
17
+ export const CreateKeysLimitReset$outboundSchema = openEnums.outboundSchema(CreateKeysLimitReset);
20
18
  /** @internal */
21
19
  export const CreateKeysRequest$outboundSchema = z.object({
22
20
  name: z.string(),
@@ -54,7 +52,7 @@ export const CreateKeysData$inboundSchema = z.object({
54
52
  byok_usage_monthly: z.number(),
55
53
  created_at: z.string(),
56
54
  updated_at: z.nullable(z.string()),
57
- expires_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
55
+ expires_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))).optional(),
58
56
  }).transform((v) => {
59
57
  return remap$(v, {
60
58
  "limit_remaining": "limitRemaining",
@@ -41,7 +41,7 @@ export type ExchangeAuthCodeForAPIKeyResponse = {
41
41
  userId: string | null;
42
42
  };
43
43
  /** @internal */
44
- export declare const ExchangeAuthCodeForAPIKeyCodeChallengeMethod$outboundSchema: z.ZodType<ExchangeAuthCodeForAPIKeyCodeChallengeMethod, ExchangeAuthCodeForAPIKeyCodeChallengeMethod>;
44
+ export declare const ExchangeAuthCodeForAPIKeyCodeChallengeMethod$outboundSchema: z.ZodType<string, ExchangeAuthCodeForAPIKeyCodeChallengeMethod>;
45
45
  /** @internal */
46
46
  export type ExchangeAuthCodeForAPIKeyRequest$Outbound = {
47
47
  code: string;
@@ -4,6 +4,7 @@
4
4
  import * as z from "zod/v4";
5
5
  import { remap as remap$ } from "../../lib/primitives.js";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
+ import * as openEnums from "../../types/enums.js";
7
8
  /**
8
9
  * The method used to generate the code challenge
9
10
  */
@@ -12,10 +13,8 @@ export const ExchangeAuthCodeForAPIKeyCodeChallengeMethod = {
12
13
  Plain: "plain",
13
14
  };
14
15
  /** @internal */
15
- export const ExchangeAuthCodeForAPIKeyCodeChallengeMethod$outboundSchema = z.union([
16
- z.enum(ExchangeAuthCodeForAPIKeyCodeChallengeMethod),
17
- z.string().and(z.custom()),
18
- ]);
16
+ export const ExchangeAuthCodeForAPIKeyCodeChallengeMethod$outboundSchema = openEnums
17
+ .outboundSchema(ExchangeAuthCodeForAPIKeyCodeChallengeMethod);
19
18
  /** @internal */
20
19
  export const ExchangeAuthCodeForAPIKeyRequest$outboundSchema = z.object({
21
20
  code: z.string(),
@@ -84,6 +84,10 @@ export type GetCurrentKeyData = {
84
84
  * Whether to include external BYOK usage in the credit limit
85
85
  */
86
86
  includeByokInLimit: boolean;
87
+ /**
88
+ * ISO 8601 UTC timestamp when the API key expires, or null if no expiration
89
+ */
90
+ expiresAt?: Date | null | undefined;
87
91
  /**
88
92
  * Legacy rate limit information about a key. Will always return -1.
89
93
  *
@@ -30,6 +30,7 @@ export const GetCurrentKeyData$inboundSchema = z.object({
30
30
  limit_remaining: z.nullable(z.number()),
31
31
  limit_reset: z.nullable(z.string()),
32
32
  include_byok_in_limit: z.boolean(),
33
+ expires_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))).optional(),
33
34
  rate_limit: z.lazy(() => RateLimit$inboundSchema),
34
35
  }).transform((v) => {
35
36
  return remap$(v, {
@@ -45,6 +46,7 @@ export const GetCurrentKeyData$inboundSchema = z.object({
45
46
  "limit_remaining": "limitRemaining",
46
47
  "limit_reset": "limitReset",
47
48
  "include_byok_in_limit": "includeByokInLimit",
49
+ "expires_at": "expiresAt",
48
50
  "rate_limit": "rateLimit",
49
51
  });
50
52
  });
@@ -4,7 +4,7 @@
4
4
  import * as z from "zod/v4";
5
5
  import { remap as remap$ } from "../../lib/primitives.js";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
- import { catchUnrecognizedEnum } from "../../types/enums.js";
7
+ import * as openEnums from "../../types/enums.js";
8
8
  /**
9
9
  * Type of API used for the generation
10
10
  */
@@ -20,11 +20,8 @@ export function getGenerationRequestToJSON(getGenerationRequest) {
20
20
  return JSON.stringify(GetGenerationRequest$outboundSchema.parse(getGenerationRequest));
21
21
  }
22
22
  /** @internal */
23
- export const ApiType$inboundSchema = z
24
- .union([
25
- z.enum(ApiType),
26
- z.string().transform(catchUnrecognizedEnum),
27
- ]);
23
+ export const ApiType$inboundSchema = openEnums
24
+ .inboundSchema(ApiType);
28
25
  /** @internal */
29
26
  export const GetGenerationData$inboundSchema = z.object({
30
27
  id: z.string(),
@@ -32,7 +32,7 @@ export const GetKeyData$inboundSchema = z
32
32
  byok_usage_monthly: z.number(),
33
33
  created_at: z.string(),
34
34
  updated_at: z.nullable(z.string()),
35
- expires_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
35
+ expires_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))).optional(),
36
36
  }).transform((v) => {
37
37
  return remap$(v, {
38
38
  "limit_remaining": "limitRemaining",
@@ -11,22 +11,21 @@ export declare const GetParametersProvider: {
11
11
  readonly Alibaba: "Alibaba";
12
12
  readonly AmazonBedrock: "Amazon Bedrock";
13
13
  readonly Anthropic: "Anthropic";
14
+ readonly Arcee: "Arcee";
14
15
  readonly AtlasCloud: "AtlasCloud";
15
- readonly Atoma: "Atoma";
16
16
  readonly Avian: "Avian";
17
17
  readonly Azure: "Azure";
18
18
  readonly BaseTen: "BaseTen";
19
+ readonly BlackForestLabs: "Black Forest Labs";
19
20
  readonly Cerebras: "Cerebras";
20
21
  readonly Chutes: "Chutes";
21
22
  readonly Cirrascale: "Cirrascale";
22
23
  readonly Clarifai: "Clarifai";
23
24
  readonly Cloudflare: "Cloudflare";
24
25
  readonly Cohere: "Cohere";
25
- readonly CrofAI: "CrofAI";
26
26
  readonly Crusoe: "Crusoe";
27
27
  readonly DeepInfra: "DeepInfra";
28
28
  readonly DeepSeek: "DeepSeek";
29
- readonly Enfer: "Enfer";
30
29
  readonly Featherless: "Featherless";
31
30
  readonly Fireworks: "Fireworks";
32
31
  readonly Friendli: "Friendli";
@@ -39,11 +38,8 @@ export declare const GetParametersProvider: {
39
38
  readonly InferenceNet: "InferenceNet";
40
39
  readonly Infermatic: "Infermatic";
41
40
  readonly Inflection: "Inflection";
42
- readonly Kluster: "Kluster";
43
- readonly Lambda: "Lambda";
44
41
  readonly Liquid: "Liquid";
45
42
  readonly Mancer2: "Mancer 2";
46
- readonly Meta: "Meta";
47
43
  readonly Minimax: "Minimax";
48
44
  readonly ModelRun: "ModelRun";
49
45
  readonly Mistral: "Mistral";
@@ -53,7 +49,6 @@ export declare const GetParametersProvider: {
53
49
  readonly NCompass: "NCompass";
54
50
  readonly Nebius: "Nebius";
55
51
  readonly NextBit: "NextBit";
56
- readonly Nineteen: "Nineteen";
57
52
  readonly Novita: "Novita";
58
53
  readonly Nvidia: "Nvidia";
59
54
  readonly OpenAI: "OpenAI";
@@ -68,7 +63,6 @@ export declare const GetParametersProvider: {
68
63
  readonly Switchpoint: "Switchpoint";
69
64
  readonly Targon: "Targon";
70
65
  readonly Together: "Together";
71
- readonly Ubicloud: "Ubicloud";
72
66
  readonly Venice: "Venice";
73
67
  readonly WandB: "WandB";
74
68
  readonly XAI: "xAI";
@@ -137,7 +131,7 @@ export type GetParametersSecurity$Outbound = {
137
131
  export declare const GetParametersSecurity$outboundSchema: z.ZodType<GetParametersSecurity$Outbound, GetParametersSecurity>;
138
132
  export declare function getParametersSecurityToJSON(getParametersSecurity: GetParametersSecurity): string;
139
133
  /** @internal */
140
- export declare const GetParametersProvider$outboundSchema: z.ZodType<GetParametersProvider, GetParametersProvider>;
134
+ export declare const GetParametersProvider$outboundSchema: z.ZodType<string, GetParametersProvider>;
141
135
  /** @internal */
142
136
  export type GetParametersRequest$Outbound = {
143
137
  author: string;