@openrouter/sdk 0.13.7 → 0.13.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/README.md +3 -9
  2. package/esm/funcs/benchmarksGetBenchmarks.d.ts +19 -0
  3. package/esm/funcs/{datasetsGetBenchmarksDesignArena.js → benchmarksGetBenchmarks.js} +11 -10
  4. package/esm/funcs/classificationsGetTaskClassifications.d.ts +37 -0
  5. package/esm/funcs/classificationsGetTaskClassifications.js +119 -0
  6. package/esm/funcs/imagesGenerate.d.ts +30 -0
  7. package/esm/funcs/imagesGenerate.js +95 -0
  8. package/esm/funcs/imagesListModelEndpoints.d.ts +19 -0
  9. package/esm/funcs/imagesListModelEndpoints.js +107 -0
  10. package/esm/funcs/{datasetsGetBenchmarksDesignArena.d.ts → imagesListModels.d.ts} +4 -4
  11. package/esm/funcs/{datasetsGetBenchmarksArtificialAnalysis.js → imagesListModels.js} +10 -15
  12. package/esm/funcs/workspacesDeleteBudget.d.ts +19 -0
  13. package/esm/funcs/workspacesDeleteBudget.js +107 -0
  14. package/esm/funcs/workspacesListBudgets.d.ts +19 -0
  15. package/esm/funcs/workspacesListBudgets.js +103 -0
  16. package/esm/funcs/workspacesSetBudget.d.ts +19 -0
  17. package/esm/funcs/workspacesSetBudget.js +110 -0
  18. package/esm/lib/config.d.ts +2 -2
  19. package/esm/lib/config.js +2 -2
  20. package/esm/models/advisorreasoning.d.ts +1 -0
  21. package/esm/models/advisorreasoning.js +1 -0
  22. package/esm/models/anthropicadvisormessageusageiteration.d.ts +24 -0
  23. package/esm/models/anthropicadvisormessageusageiteration.js +36 -0
  24. package/esm/models/anthropiccompactionusageiteration.d.ts +23 -0
  25. package/esm/models/anthropiccompactionusageiteration.js +35 -0
  26. package/esm/models/anthropicdocumentblockparam.d.ts +5 -4
  27. package/esm/models/anthropicdocumentblockparam.js +3 -0
  28. package/esm/models/anthropicfiledocumentsource.d.ts +14 -0
  29. package/esm/models/anthropicfiledocumentsource.js +19 -0
  30. package/esm/models/anthropiciterationcachecreation.d.ts +11 -0
  31. package/esm/models/anthropiciterationcachecreation.js +21 -0
  32. package/esm/models/anthropicmessageusageiteration.d.ts +24 -0
  33. package/esm/models/anthropicmessageusageiteration.js +36 -0
  34. package/esm/models/anthropicspeed.d.ts +10 -0
  35. package/esm/models/anthropicspeed.js +12 -0
  36. package/esm/models/anthropicunknownusageiteration.d.ts +16 -0
  37. package/esm/models/anthropicunknownusageiteration.js +30 -0
  38. package/esm/models/anthropicusageiteration.d.ts +12 -0
  39. package/esm/models/anthropicusageiteration.js +21 -0
  40. package/esm/models/apierrortype.d.ts +41 -0
  41. package/esm/models/apierrortype.js +40 -0
  42. package/esm/models/booleancapability.d.ts +13 -0
  43. package/esm/models/booleancapability.js +14 -0
  44. package/esm/models/byokproviderslug.d.ts +4 -0
  45. package/esm/models/byokproviderslug.js +4 -0
  46. package/esm/models/capabilitydescriptor.d.ts +15 -0
  47. package/esm/models/capabilitydescriptor.js +19 -0
  48. package/esm/models/chatrequest.d.ts +2 -0
  49. package/esm/models/chatrequest.js +2 -0
  50. package/esm/models/chatstreamchunk.d.ts +25 -4
  51. package/esm/models/chatstreamchunk.js +19 -4
  52. package/esm/models/chatusage.d.ts +32 -8
  53. package/esm/models/chatusage.js +25 -8
  54. package/esm/models/chatwebsearchshorthand.d.ts +1 -1
  55. package/esm/models/contentpartimage.d.ts +9 -2
  56. package/esm/models/contentpartimage.js +6 -1
  57. package/esm/models/debugevent.d.ts +42 -0
  58. package/esm/models/debugevent.js +58 -0
  59. package/esm/models/deleteworkspacebudgetresponse.d.ts +13 -0
  60. package/esm/models/deleteworkspacebudgetresponse.js +14 -0
  61. package/esm/models/enumcapability.d.ts +14 -0
  62. package/esm/models/enumcapability.js +15 -0
  63. package/esm/models/fusionplugin.d.ts +1 -0
  64. package/esm/models/fusionplugin.js +1 -0
  65. package/esm/models/fusionservertoolconfig.d.ts +8 -1
  66. package/esm/models/fusionservertoolconfig.js +4 -0
  67. package/esm/models/imageendpoint.d.ts +41 -0
  68. package/esm/models/imageendpoint.js +33 -0
  69. package/esm/models/imagegencompletedevent.d.ts +29 -0
  70. package/esm/models/imagegencompletedevent.js +23 -0
  71. package/esm/models/imagegenerationrequest.d.ts +914 -0
  72. package/esm/models/imagegenerationrequest.js +267 -0
  73. package/esm/models/imagegenerationresponse.d.ts +34 -0
  74. package/esm/models/imagegenerationresponse.js +29 -0
  75. package/esm/models/imagegenerationservertool.d.ts +15 -15
  76. package/esm/models/imagegenerationservertool.js +15 -17
  77. package/esm/models/imagegenerationusage.d.ts +119 -0
  78. package/esm/models/imagegenerationusage.js +93 -0
  79. package/esm/models/imagegenpartialimageevent.d.ts +24 -0
  80. package/esm/models/imagegenpartialimageevent.js +22 -0
  81. package/esm/models/imagegenstreamerrorevent.d.ts +44 -0
  82. package/esm/models/imagegenstreamerrorevent.js +25 -0
  83. package/esm/models/imagemodelarchitecture.d.ts +19 -0
  84. package/esm/models/imagemodelarchitecture.js +23 -0
  85. package/esm/models/imagemodelendpointsresponse.d.ts +18 -0
  86. package/esm/models/imagemodelendpointsresponse.js +16 -0
  87. package/esm/models/imagemodellistitem.d.ts +42 -0
  88. package/esm/models/imagemodellistitem.js +29 -0
  89. package/esm/models/imagemodelslistresponse.d.ts +14 -0
  90. package/esm/models/imagemodelslistresponse.js +15 -0
  91. package/esm/models/imageoutputmodality.d.ts +16 -0
  92. package/esm/models/imageoutputmodality.js +18 -0
  93. package/esm/models/imagepricingentry.d.ts +35 -0
  94. package/esm/models/imagepricingentry.js +41 -0
  95. package/esm/models/imagestreamingresponse.d.ts +18 -0
  96. package/esm/models/imagestreamingresponse.js +43 -0
  97. package/esm/models/index.d.ts +44 -7
  98. package/esm/models/index.js +44 -7
  99. package/esm/models/inputreference.d.ts +6 -2
  100. package/esm/models/inputreference.js +1 -1
  101. package/esm/models/legacywebsearchservertool.d.ts +1 -1
  102. package/esm/models/listworkspacebudgetsresponse.d.ts +14 -0
  103. package/esm/models/listworkspacebudgetsresponse.js +15 -0
  104. package/esm/models/messagesrequest.d.ts +6 -6
  105. package/esm/models/messagesrequest.js +4 -5
  106. package/esm/models/model.d.ts +5 -0
  107. package/esm/models/model.js +2 -0
  108. package/esm/models/modelreasoning.d.ts +49 -0
  109. package/esm/models/modelreasoning.js +42 -0
  110. package/esm/models/observabilityarizedestination.d.ts +3 -0
  111. package/esm/models/openresponsesresult.d.ts +5 -0
  112. package/esm/models/openresponsesresult.js +3 -0
  113. package/esm/models/operations/createembeddings.d.ts +19 -0
  114. package/esm/models/operations/createembeddings.js +20 -0
  115. package/esm/models/operations/createimages.d.ts +63 -0
  116. package/esm/models/operations/createimages.js +44 -0
  117. package/esm/models/operations/{getbenchmarksartificialanalysis.d.ts → deleteworkspacebudget.d.ts} +15 -9
  118. package/esm/models/operations/deleteworkspacebudget.js +23 -0
  119. package/esm/models/operations/getbenchmarks.d.ts +120 -0
  120. package/esm/models/operations/getbenchmarks.js +60 -0
  121. package/esm/models/operations/getmodels.d.ts +5 -3
  122. package/esm/models/operations/getmodels.js +3 -1
  123. package/esm/models/operations/{getbenchmarksdesignarena.d.ts → gettaskclassifications.d.ts} +16 -28
  124. package/esm/models/operations/gettaskclassifications.js +29 -0
  125. package/esm/models/operations/index.d.ts +8 -2
  126. package/esm/models/operations/index.js +8 -2
  127. package/esm/models/operations/listbyokkeys.d.ts +4 -0
  128. package/esm/models/operations/listbyokkeys.js +4 -0
  129. package/esm/models/operations/listimagemodelendpoints.d.ts +63 -0
  130. package/esm/models/operations/listimagemodelendpoints.js +22 -0
  131. package/esm/models/operations/listimagemodels.d.ts +53 -0
  132. package/esm/models/operations/listimagemodels.js +20 -0
  133. package/esm/models/operations/listworkspacebudgets.d.ts +58 -0
  134. package/esm/models/operations/listworkspacebudgets.js +21 -0
  135. package/esm/models/operations/queryanalytics.d.ts +7 -3
  136. package/esm/models/operations/queryanalytics.js +1 -0
  137. package/esm/models/operations/upsertworkspacebudget.d.ts +66 -0
  138. package/esm/models/operations/upsertworkspacebudget.js +25 -0
  139. package/esm/models/preview20250311websearchservertool.d.ts +1 -1
  140. package/esm/models/previewwebsearchservertool.d.ts +1 -1
  141. package/esm/models/providername.d.ts +4 -0
  142. package/esm/models/providername.js +4 -0
  143. package/esm/models/provideroptions.d.ts +25 -1
  144. package/esm/models/provideroptions.js +6 -0
  145. package/esm/models/providerresponse.d.ts +4 -0
  146. package/esm/models/providerresponse.js +4 -0
  147. package/esm/models/rangecapability.d.ts +15 -0
  148. package/esm/models/rangecapability.js +16 -0
  149. package/esm/models/reasoningeffort.d.ts +1 -0
  150. package/esm/models/reasoningeffort.js +1 -0
  151. package/esm/models/responsesrequest.d.ts +6 -0
  152. package/esm/models/responsesrequest.js +2 -0
  153. package/esm/models/speechrequest.d.ts +1 -1
  154. package/esm/models/streamevents.d.ts +2 -1
  155. package/esm/models/streamevents.js +2 -0
  156. package/esm/models/sttrequest.d.ts +1 -1
  157. package/esm/models/subagentreasoning.d.ts +1 -0
  158. package/esm/models/subagentreasoning.js +1 -0
  159. package/esm/models/taskclassificationitem.d.ts +42 -0
  160. package/esm/models/taskclassificationitem.js +32 -0
  161. package/esm/models/taskclassificationmacrocategory.d.ts +25 -0
  162. package/esm/models/taskclassificationmacrocategory.js +23 -0
  163. package/esm/models/taskclassificationmodel.d.ts +21 -0
  164. package/esm/models/taskclassificationmodel.js +22 -0
  165. package/esm/models/taskclassificationresponse.d.ts +33 -0
  166. package/esm/models/taskclassificationresponse.js +33 -0
  167. package/esm/models/{benchmarkpricing.d.ts → unifiedbenchmarkpricing.d.ts} +4 -4
  168. package/esm/models/unifiedbenchmarkpricing.js +15 -0
  169. package/esm/models/{benchmarksaaitem.d.ts → unifiedbenchmarksaaitem.d.ts} +14 -10
  170. package/esm/models/unifiedbenchmarksaaitem.js +30 -0
  171. package/esm/models/{benchmarksdaitem.d.ts → unifiedbenchmarksdaitem.d.ts} +11 -7
  172. package/esm/models/{benchmarksdaitem.js → unifiedbenchmarksdaitem.js} +8 -7
  173. package/esm/models/unifiedbenchmarksmeta.d.ts +63 -0
  174. package/esm/models/unifiedbenchmarksmeta.js +46 -0
  175. package/esm/models/unifiedbenchmarksresponse.d.ts +19 -0
  176. package/esm/models/unifiedbenchmarksresponse.js +30 -0
  177. package/esm/models/upsertworkspacebudgetrequest.d.ts +15 -0
  178. package/esm/models/upsertworkspacebudgetrequest.js +18 -0
  179. package/esm/models/upsertworkspacebudgetresponse.d.ts +11 -0
  180. package/esm/models/upsertworkspacebudgetresponse.js +15 -0
  181. package/esm/models/videogenerationrequest.d.ts +39 -15
  182. package/esm/models/videogenerationrequest.js +17 -11
  183. package/esm/models/websearchconfig.d.ts +1 -1
  184. package/esm/models/websearchservertool.d.ts +1 -1
  185. package/esm/models/websearchservertoolconfig.d.ts +1 -1
  186. package/esm/models/workspacebudget.d.ts +48 -0
  187. package/esm/models/workspacebudget.js +39 -0
  188. package/esm/models/workspacebudgetinterval.d.ts +18 -0
  189. package/esm/models/workspacebudgetinterval.js +17 -0
  190. package/esm/sdk/benchmarks.d.ts +13 -0
  191. package/esm/sdk/benchmarks.js +19 -0
  192. package/esm/sdk/classifications.d.ts +31 -0
  193. package/esm/sdk/classifications.js +37 -0
  194. package/esm/sdk/datasets.d.ts +0 -14
  195. package/esm/sdk/datasets.js +0 -20
  196. package/esm/sdk/images.d.ts +38 -0
  197. package/esm/sdk/images.js +33 -0
  198. package/esm/sdk/sdk.d.ts +9 -0
  199. package/esm/sdk/sdk.js +12 -0
  200. package/esm/sdk/workspaces.d.ts +21 -0
  201. package/esm/sdk/workspaces.js +30 -0
  202. package/jsr.json +1 -1
  203. package/package.json +7 -7
  204. package/esm/funcs/datasetsGetBenchmarksArtificialAnalysis.d.ts +0 -19
  205. package/esm/models/benchmarkpricing.js +0 -15
  206. package/esm/models/benchmarksaaitem.js +0 -29
  207. package/esm/models/benchmarksaameta.d.ts +0 -70
  208. package/esm/models/benchmarksaameta.js +0 -50
  209. package/esm/models/benchmarksaaresponse.d.ts +0 -13
  210. package/esm/models/benchmarksaaresponse.js +0 -17
  211. package/esm/models/benchmarksdameta.d.ts +0 -98
  212. package/esm/models/benchmarksdameta.js +0 -62
  213. package/esm/models/benchmarksdaresponse.d.ts +0 -13
  214. package/esm/models/benchmarksdaresponse.js +0 -17
  215. package/esm/models/operations/getbenchmarksartificialanalysis.js +0 -22
  216. package/esm/models/operations/getbenchmarksdesignarena.js +0 -36
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import { discriminatedUnion } from "../types/discriminatedUnion.js";
9
+ import { ApiErrorType$inboundSchema } from "./apierrortype.js";
9
10
  import { ApplyPatchServerTool$inboundSchema, } from "./applypatchservertool.js";
10
11
  import { BaseInputsUnion$inboundSchema, } from "./baseinputsunion.js";
11
12
  import { BaseReasoningConfig$inboundSchema, } from "./basereasoningconfig.js";
@@ -118,6 +119,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
118
119
  truncation: z.nullable(Truncation$inboundSchema).optional(),
119
120
  usage: z.nullable(Usage$inboundSchema).optional(),
120
121
  user: z.nullable(z.string()).optional(),
122
+ error_type: ApiErrorType$inboundSchema.optional(),
121
123
  openrouter_metadata: OpenRouterMetadata$inboundSchema.optional(),
122
124
  }).transform((v) => {
123
125
  return remap$(v, {
@@ -137,6 +139,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
137
139
  "tool_choice": "toolChoice",
138
140
  "top_logprobs": "topLogprobs",
139
141
  "top_p": "topP",
142
+ "error_type": "errorType",
140
143
  "openrouter_metadata": "openrouterMetadata",
141
144
  });
142
145
  });
@@ -132,6 +132,14 @@ export declare const ObjectT: {
132
132
  readonly List: "list";
133
133
  };
134
134
  export type ObjectT = ClosedEnum<typeof ObjectT>;
135
+ /**
136
+ * Breakdown of upstream inference costs
137
+ */
138
+ export type CostDetails = {
139
+ upstreamInferenceCompletionsCost: number;
140
+ upstreamInferenceCost?: number | null | undefined;
141
+ upstreamInferencePromptCost: number;
142
+ };
135
143
  /**
136
144
  * Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included.
137
145
  */
@@ -165,6 +173,14 @@ export type CreateEmbeddingsUsage = {
165
173
  * Cost of the request in credits
166
174
  */
167
175
  cost?: number | undefined;
176
+ /**
177
+ * Breakdown of upstream inference costs
178
+ */
179
+ costDetails?: CostDetails | null | undefined;
180
+ /**
181
+ * Whether a request was made using a Bring Your Own Key configuration
182
+ */
183
+ isByok?: boolean | undefined;
168
184
  /**
169
185
  * Number of tokens in the input
170
186
  */
@@ -277,6 +293,9 @@ export declare function createEmbeddingsDataFromJSON(jsonString: string): SafePa
277
293
  /** @internal */
278
294
  export declare const ObjectT$inboundSchema: z.ZodEnum<typeof ObjectT>;
279
295
  /** @internal */
296
+ export declare const CostDetails$inboundSchema: z.ZodType<CostDetails, unknown>;
297
+ export declare function costDetailsFromJSON(jsonString: string): SafeParseResult<CostDetails, SDKValidationError>;
298
+ /** @internal */
280
299
  export declare const PromptTokensDetails$inboundSchema: z.ZodType<PromptTokensDetails, unknown>;
281
300
  export declare function promptTokensDetailsFromJSON(jsonString: string): SafeParseResult<PromptTokensDetails, SDKValidationError>;
282
301
  /** @internal */
@@ -147,6 +147,22 @@ export function createEmbeddingsDataFromJSON(jsonString) {
147
147
  /** @internal */
148
148
  export const ObjectT$inboundSchema = z.enum(ObjectT);
149
149
  /** @internal */
150
+ export const CostDetails$inboundSchema = z
151
+ .object({
152
+ upstream_inference_completions_cost: z.number(),
153
+ upstream_inference_cost: z.nullable(z.number()).optional(),
154
+ upstream_inference_prompt_cost: z.number(),
155
+ }).transform((v) => {
156
+ return remap$(v, {
157
+ "upstream_inference_completions_cost": "upstreamInferenceCompletionsCost",
158
+ "upstream_inference_cost": "upstreamInferenceCost",
159
+ "upstream_inference_prompt_cost": "upstreamInferencePromptCost",
160
+ });
161
+ });
162
+ export function costDetailsFromJSON(jsonString) {
163
+ return safeParse(jsonString, (x) => CostDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CostDetails' from JSON`);
164
+ }
165
+ /** @internal */
150
166
  export const PromptTokensDetails$inboundSchema = z.object({
151
167
  audio_tokens: z.int().optional(),
152
168
  file_tokens: z.int().optional(),
@@ -168,12 +184,16 @@ export function promptTokensDetailsFromJSON(jsonString) {
168
184
  /** @internal */
169
185
  export const CreateEmbeddingsUsage$inboundSchema = z.object({
170
186
  cost: z.number().optional(),
187
+ cost_details: z.nullable(z.lazy(() => CostDetails$inboundSchema)).optional(),
188
+ is_byok: z.boolean().optional(),
171
189
  prompt_tokens: z.int(),
172
190
  prompt_tokens_details: z.lazy(() => PromptTokensDetails$inboundSchema)
173
191
  .optional(),
174
192
  total_tokens: z.int(),
175
193
  }).transform((v) => {
176
194
  return remap$(v, {
195
+ "cost_details": "costDetails",
196
+ "is_byok": "isByok",
177
197
  "prompt_tokens": "promptTokens",
178
198
  "prompt_tokens_details": "promptTokensDetails",
179
199
  "total_tokens": "totalTokens",
@@ -0,0 +1,63 @@
1
+ import * as z from "zod/v4";
2
+ import { EventStream } from "../../lib/event-streams.js";
3
+ import { Result as SafeParseResult } from "../../types/fp.js";
4
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
5
+ import * as models from "../index.js";
6
+ export type CreateImagesGlobals = {
7
+ /**
8
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
9
+ *
10
+ * @remarks
11
+ * This is used to track API usage per application.
12
+ */
13
+ httpReferer?: string | undefined;
14
+ /**
15
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
16
+ *
17
+ * @remarks
18
+ */
19
+ appTitle?: string | undefined;
20
+ /**
21
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
22
+ *
23
+ * @remarks
24
+ */
25
+ appCategories?: string | undefined;
26
+ };
27
+ export type CreateImagesRequest = {
28
+ /**
29
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
30
+ *
31
+ * @remarks
32
+ * This is used to track API usage per application.
33
+ */
34
+ httpReferer?: string | undefined;
35
+ /**
36
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
37
+ *
38
+ * @remarks
39
+ */
40
+ appTitle?: string | undefined;
41
+ /**
42
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
43
+ *
44
+ * @remarks
45
+ */
46
+ appCategories?: string | undefined;
47
+ imageGenerationRequest: models.ImageGenerationRequest;
48
+ };
49
+ export type CreateImagesResponse = models.ImageGenerationResponse | EventStream<models.ImageStreamingResponseData>;
50
+ /** @internal */
51
+ export type CreateImagesRequest$Outbound = {
52
+ "HTTP-Referer"?: string | undefined;
53
+ appTitle?: string | undefined;
54
+ appCategories?: string | undefined;
55
+ ImageGenerationRequest: models.ImageGenerationRequest$Outbound;
56
+ };
57
+ /** @internal */
58
+ export declare const CreateImagesRequest$outboundSchema: z.ZodType<CreateImagesRequest$Outbound, CreateImagesRequest>;
59
+ export declare function createImagesRequestToJSON(createImagesRequest: CreateImagesRequest): string;
60
+ /** @internal */
61
+ export declare const CreateImagesResponse$inboundSchema: z.ZodType<CreateImagesResponse, unknown>;
62
+ export declare function createImagesResponseFromJSON(jsonString: string): SafeParseResult<CreateImagesResponse, SDKValidationError>;
63
+ //# sourceMappingURL=createimages.d.ts.map
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 0a478467f700
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { EventStream } from "../../lib/event-streams.js";
7
+ import { remap as remap$ } from "../../lib/primitives.js";
8
+ import { safeParse } from "../../lib/schemas.js";
9
+ import * as models from "../index.js";
10
+ /** @internal */
11
+ export const CreateImagesRequest$outboundSchema = z.object({
12
+ httpReferer: z.string().optional(),
13
+ appTitle: z.string().optional(),
14
+ appCategories: z.string().optional(),
15
+ imageGenerationRequest: models.ImageGenerationRequest$outboundSchema,
16
+ }).transform((v) => {
17
+ return remap$(v, {
18
+ httpReferer: "HTTP-Referer",
19
+ imageGenerationRequest: "ImageGenerationRequest",
20
+ });
21
+ });
22
+ export function createImagesRequestToJSON(createImagesRequest) {
23
+ return JSON.stringify(CreateImagesRequest$outboundSchema.parse(createImagesRequest));
24
+ }
25
+ /** @internal */
26
+ export const CreateImagesResponse$inboundSchema = z.union([
27
+ models.ImageGenerationResponse$inboundSchema,
28
+ z.custom(x => x instanceof ReadableStream)
29
+ .transform(stream => {
30
+ return new EventStream(stream, rawEvent => {
31
+ if (rawEvent.data === "[DONE]")
32
+ return { done: true, value: undefined };
33
+ return {
34
+ done: false,
35
+ value: models.ImageStreamingResponse$inboundSchema.parse(rawEvent)
36
+ ?.data,
37
+ };
38
+ });
39
+ }),
40
+ ]);
41
+ export function createImagesResponseFromJSON(jsonString) {
42
+ return safeParse(jsonString, (x) => CreateImagesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateImagesResponse' from JSON`);
43
+ }
44
+ //# sourceMappingURL=createimages.js.map
@@ -1,5 +1,6 @@
1
1
  import * as z from "zod/v4";
2
- export type GetBenchmarksArtificialAnalysisGlobals = {
2
+ import * as models from "../index.js";
3
+ export type DeleteWorkspaceBudgetGlobals = {
3
4
  /**
4
5
  * The app identifier should be your app's URL and is used as the primary identifier for rankings.
5
6
  *
@@ -20,7 +21,7 @@ export type GetBenchmarksArtificialAnalysisGlobals = {
20
21
  */
21
22
  appCategories?: string | undefined;
22
23
  };
23
- export type GetBenchmarksArtificialAnalysisRequest = {
24
+ export type DeleteWorkspaceBudgetRequest = {
24
25
  /**
25
26
  * The app identifier should be your app's URL and is used as the primary identifier for rankings.
26
27
  *
@@ -41,18 +42,23 @@ export type GetBenchmarksArtificialAnalysisRequest = {
41
42
  */
42
43
  appCategories?: string | undefined;
43
44
  /**
44
- * Max results to return (1–100, default 50).
45
+ * The workspace ID (UUID) or slug
45
46
  */
46
- maxResults?: number | undefined;
47
+ id: string;
48
+ /**
49
+ * Budget reset interval. Use "lifetime" for a one-time budget that never resets.
50
+ */
51
+ interval: models.WorkspaceBudgetInterval;
47
52
  };
48
53
  /** @internal */
49
- export type GetBenchmarksArtificialAnalysisRequest$Outbound = {
54
+ export type DeleteWorkspaceBudgetRequest$Outbound = {
50
55
  "HTTP-Referer"?: string | undefined;
51
56
  appTitle?: string | undefined;
52
57
  appCategories?: string | undefined;
53
- max_results: number;
58
+ id: string;
59
+ interval: string;
54
60
  };
55
61
  /** @internal */
56
- export declare const GetBenchmarksArtificialAnalysisRequest$outboundSchema: z.ZodType<GetBenchmarksArtificialAnalysisRequest$Outbound, GetBenchmarksArtificialAnalysisRequest>;
57
- export declare function getBenchmarksArtificialAnalysisRequestToJSON(getBenchmarksArtificialAnalysisRequest: GetBenchmarksArtificialAnalysisRequest): string;
58
- //# sourceMappingURL=getbenchmarksartificialanalysis.d.ts.map
62
+ export declare const DeleteWorkspaceBudgetRequest$outboundSchema: z.ZodType<DeleteWorkspaceBudgetRequest$Outbound, DeleteWorkspaceBudgetRequest>;
63
+ export declare function deleteWorkspaceBudgetRequestToJSON(deleteWorkspaceBudgetRequest: DeleteWorkspaceBudgetRequest): string;
64
+ //# sourceMappingURL=deleteworkspacebudget.d.ts.map
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: f9fd25ea4948
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import * as models from "../index.js";
8
+ /** @internal */
9
+ export const DeleteWorkspaceBudgetRequest$outboundSchema = z.object({
10
+ httpReferer: z.string().optional(),
11
+ appTitle: z.string().optional(),
12
+ appCategories: z.string().optional(),
13
+ id: z.string(),
14
+ interval: models.WorkspaceBudgetInterval$outboundSchema,
15
+ }).transform((v) => {
16
+ return remap$(v, {
17
+ httpReferer: "HTTP-Referer",
18
+ });
19
+ });
20
+ export function deleteWorkspaceBudgetRequestToJSON(deleteWorkspaceBudgetRequest) {
21
+ return JSON.stringify(DeleteWorkspaceBudgetRequest$outboundSchema.parse(deleteWorkspaceBudgetRequest));
22
+ }
23
+ //# sourceMappingURL=deleteworkspacebudget.js.map
@@ -0,0 +1,120 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../../types/enums.js";
3
+ export type GetBenchmarksGlobals = {
4
+ /**
5
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
6
+ *
7
+ * @remarks
8
+ * This is used to track API usage per application.
9
+ */
10
+ httpReferer?: string | undefined;
11
+ /**
12
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
13
+ *
14
+ * @remarks
15
+ */
16
+ appTitle?: string | undefined;
17
+ /**
18
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
19
+ *
20
+ * @remarks
21
+ */
22
+ appCategories?: string | undefined;
23
+ };
24
+ /**
25
+ * Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.
26
+ */
27
+ export declare const Source: {
28
+ readonly ArtificialAnalysis: "artificial-analysis";
29
+ readonly DesignArena: "design-arena";
30
+ };
31
+ /**
32
+ * Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.
33
+ */
34
+ export type Source = OpenEnum<typeof Source>;
35
+ /**
36
+ * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.
37
+ */
38
+ export declare const TaskType: {
39
+ readonly Coding: "coding";
40
+ readonly Intelligence: "intelligence";
41
+ readonly Agentic: "agentic";
42
+ };
43
+ /**
44
+ * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.
45
+ */
46
+ export type TaskType = OpenEnum<typeof TaskType>;
47
+ /**
48
+ * Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.
49
+ */
50
+ export declare const Arena: {
51
+ readonly Models: "models";
52
+ readonly Builders: "builders";
53
+ readonly Agents: "agents";
54
+ };
55
+ /**
56
+ * Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.
57
+ */
58
+ export type Arena = OpenEnum<typeof Arena>;
59
+ export type GetBenchmarksRequest = {
60
+ /**
61
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
62
+ *
63
+ * @remarks
64
+ * This is used to track API usage per application.
65
+ */
66
+ httpReferer?: string | undefined;
67
+ /**
68
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
69
+ *
70
+ * @remarks
71
+ */
72
+ appTitle?: string | undefined;
73
+ /**
74
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
75
+ *
76
+ * @remarks
77
+ */
78
+ appCategories?: string | undefined;
79
+ /**
80
+ * Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.
81
+ */
82
+ source?: Source | undefined;
83
+ /**
84
+ * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.
85
+ */
86
+ taskType?: TaskType | undefined;
87
+ /**
88
+ * Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.
89
+ */
90
+ arena?: Arena | undefined;
91
+ /**
92
+ * Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.
93
+ */
94
+ category?: string | undefined;
95
+ /**
96
+ * Maximum number of items to return. When omitted, all matching results are returned.
97
+ */
98
+ maxResults?: number | undefined;
99
+ };
100
+ /** @internal */
101
+ export declare const Source$outboundSchema: z.ZodType<string, Source>;
102
+ /** @internal */
103
+ export declare const TaskType$outboundSchema: z.ZodType<string, TaskType>;
104
+ /** @internal */
105
+ export declare const Arena$outboundSchema: z.ZodType<string, Arena>;
106
+ /** @internal */
107
+ export type GetBenchmarksRequest$Outbound = {
108
+ "HTTP-Referer"?: string | undefined;
109
+ appTitle?: string | undefined;
110
+ appCategories?: string | undefined;
111
+ source?: string | undefined;
112
+ task_type?: string | undefined;
113
+ arena?: string | undefined;
114
+ category?: string | undefined;
115
+ max_results?: number | undefined;
116
+ };
117
+ /** @internal */
118
+ export declare const GetBenchmarksRequest$outboundSchema: z.ZodType<GetBenchmarksRequest$Outbound, GetBenchmarksRequest>;
119
+ export declare function getBenchmarksRequestToJSON(getBenchmarksRequest: GetBenchmarksRequest): string;
120
+ //# sourceMappingURL=getbenchmarks.d.ts.map
@@ -0,0 +1,60 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 52eb1eb063ae
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import * as openEnums from "../../types/enums.js";
8
+ /**
9
+ * Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.
10
+ */
11
+ export const Source = {
12
+ ArtificialAnalysis: "artificial-analysis",
13
+ DesignArena: "design-arena",
14
+ };
15
+ /**
16
+ * Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.
17
+ */
18
+ export const TaskType = {
19
+ Coding: "coding",
20
+ Intelligence: "intelligence",
21
+ Agentic: "agentic",
22
+ };
23
+ /**
24
+ * Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.
25
+ */
26
+ export const Arena = {
27
+ Models: "models",
28
+ Builders: "builders",
29
+ Agents: "agents",
30
+ };
31
+ /** @internal */
32
+ export const Source$outboundSchema = openEnums
33
+ .outboundSchema(Source);
34
+ /** @internal */
35
+ export const TaskType$outboundSchema = openEnums
36
+ .outboundSchema(TaskType);
37
+ /** @internal */
38
+ export const Arena$outboundSchema = openEnums
39
+ .outboundSchema(Arena);
40
+ /** @internal */
41
+ export const GetBenchmarksRequest$outboundSchema = z.object({
42
+ httpReferer: z.string().optional(),
43
+ appTitle: z.string().optional(),
44
+ appCategories: z.string().optional(),
45
+ source: Source$outboundSchema.optional(),
46
+ taskType: TaskType$outboundSchema.optional(),
47
+ arena: Arena$outboundSchema.optional(),
48
+ category: z.string().optional(),
49
+ maxResults: z.int().optional(),
50
+ }).transform((v) => {
51
+ return remap$(v, {
52
+ httpReferer: "HTTP-Referer",
53
+ taskType: "task_type",
54
+ maxResults: "max_results",
55
+ });
56
+ });
57
+ export function getBenchmarksRequestToJSON(getBenchmarksRequest) {
58
+ return JSON.stringify(GetBenchmarksRequest$outboundSchema.parse(getBenchmarksRequest));
59
+ }
60
+ //# sourceMappingURL=getbenchmarks.js.map
@@ -43,7 +43,7 @@ export declare const GetModelsCategory: {
43
43
  */
44
44
  export type GetModelsCategory = OpenEnum<typeof GetModelsCategory>;
45
45
  /**
46
- * Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved.
46
+ * Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
47
47
  */
48
48
  export declare const GetModelsSort: {
49
49
  readonly MostPopular: "most-popular";
@@ -54,9 +54,11 @@ export declare const GetModelsSort: {
54
54
  readonly ContextHighToLow: "context-high-to-low";
55
55
  readonly ThroughputHighToLow: "throughput-high-to-low";
56
56
  readonly LatencyLowToHigh: "latency-low-to-high";
57
+ readonly IntelligenceHighToLow: "intelligence-high-to-low";
58
+ readonly DesignArenaEloHighToLow: "design-arena-elo-high-to-low";
57
59
  };
58
60
  /**
59
- * Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved.
61
+ * Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
60
62
  */
61
63
  export type GetModelsSort = OpenEnum<typeof GetModelsSort>;
62
64
  /**
@@ -123,7 +125,7 @@ export type GetModelsRequest = {
123
125
  */
124
126
  outputModalities?: string | undefined;
125
127
  /**
126
- * Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved.
128
+ * Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
127
129
  */
128
130
  sort?: GetModelsSort | undefined;
129
131
  /**
@@ -23,7 +23,7 @@ export const GetModelsCategory = {
23
23
  Academia: "academia",
24
24
  };
25
25
  /**
26
- * Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved.
26
+ * Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
27
27
  */
28
28
  export const GetModelsSort = {
29
29
  MostPopular: "most-popular",
@@ -34,6 +34,8 @@ export const GetModelsSort = {
34
34
  ContextHighToLow: "context-high-to-low",
35
35
  ThroughputHighToLow: "throughput-high-to-low",
36
36
  LatencyLowToHigh: "latency-low-to-high",
37
+ IntelligenceHighToLow: "intelligence-high-to-low",
38
+ DesignArenaEloHighToLow: "design-arena-elo-high-to-low",
37
39
  };
38
40
  /**
39
41
  * Filter by distillation capability. "true" returns only distillable models, "false" excludes them.
@@ -1,6 +1,6 @@
1
1
  import * as z from "zod/v4";
2
- import { OpenEnum } from "../../types/enums.js";
3
- export type GetBenchmarksDesignArenaGlobals = {
2
+ import { ClosedEnum } from "../../types/enums.js";
3
+ export type GetTaskClassificationsGlobals = {
4
4
  /**
5
5
  * The app identifier should be your app's URL and is used as the primary identifier for rankings.
6
6
  *
@@ -22,18 +22,16 @@ export type GetBenchmarksDesignArenaGlobals = {
22
22
  appCategories?: string | undefined;
23
23
  };
24
24
  /**
25
- * Arena to query. Defaults to `models`.
25
+ * Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.
26
26
  */
27
- export declare const Arena: {
28
- readonly Models: "models";
29
- readonly Builders: "builders";
30
- readonly Agents: "agents";
27
+ export declare const Window: {
28
+ readonly Sevend: "7d";
31
29
  };
32
30
  /**
33
- * Arena to query. Defaults to `models`.
31
+ * Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.
34
32
  */
35
- export type Arena = OpenEnum<typeof Arena>;
36
- export type GetBenchmarksDesignArenaRequest = {
33
+ export type Window = ClosedEnum<typeof Window>;
34
+ export type GetTaskClassificationsRequest = {
37
35
  /**
38
36
  * The app identifier should be your app's URL and is used as the primary identifier for rankings.
39
37
  *
@@ -54,30 +52,20 @@ export type GetBenchmarksDesignArenaRequest = {
54
52
  */
55
53
  appCategories?: string | undefined;
56
54
  /**
57
- * Arena to query. Defaults to `models`.
55
+ * Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.
58
56
  */
59
- arena?: Arena | undefined;
60
- /**
61
- * Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.
62
- */
63
- category?: string | undefined;
64
- /**
65
- * Max results to return: per category when no category filter is applied (1–100, default 50).
66
- */
67
- maxResults?: number | undefined;
57
+ window?: Window | undefined;
68
58
  };
69
59
  /** @internal */
70
- export declare const Arena$outboundSchema: z.ZodType<string, Arena>;
60
+ export declare const Window$outboundSchema: z.ZodEnum<typeof Window>;
71
61
  /** @internal */
72
- export type GetBenchmarksDesignArenaRequest$Outbound = {
62
+ export type GetTaskClassificationsRequest$Outbound = {
73
63
  "HTTP-Referer"?: string | undefined;
74
64
  appTitle?: string | undefined;
75
65
  appCategories?: string | undefined;
76
- arena: string;
77
- category?: string | undefined;
78
- max_results: number;
66
+ window: string;
79
67
  };
80
68
  /** @internal */
81
- export declare const GetBenchmarksDesignArenaRequest$outboundSchema: z.ZodType<GetBenchmarksDesignArenaRequest$Outbound, GetBenchmarksDesignArenaRequest>;
82
- export declare function getBenchmarksDesignArenaRequestToJSON(getBenchmarksDesignArenaRequest: GetBenchmarksDesignArenaRequest): string;
83
- //# sourceMappingURL=getbenchmarksdesignarena.d.ts.map
69
+ export declare const GetTaskClassificationsRequest$outboundSchema: z.ZodType<GetTaskClassificationsRequest$Outbound, GetTaskClassificationsRequest>;
70
+ export declare function getTaskClassificationsRequestToJSON(getTaskClassificationsRequest: GetTaskClassificationsRequest): string;
71
+ //# sourceMappingURL=gettaskclassifications.d.ts.map
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 8482753ddd33
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ /**
8
+ * Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.
9
+ */
10
+ export const Window = {
11
+ Sevend: "7d",
12
+ };
13
+ /** @internal */
14
+ export const Window$outboundSchema = z.enum(Window);
15
+ /** @internal */
16
+ export const GetTaskClassificationsRequest$outboundSchema = z.object({
17
+ httpReferer: z.string().optional(),
18
+ appTitle: z.string().optional(),
19
+ appCategories: z.string().optional(),
20
+ window: Window$outboundSchema.default("7d"),
21
+ }).transform((v) => {
22
+ return remap$(v, {
23
+ httpReferer: "HTTP-Referer",
24
+ });
25
+ });
26
+ export function getTaskClassificationsRequestToJSON(getTaskClassificationsRequest) {
27
+ return JSON.stringify(GetTaskClassificationsRequest$outboundSchema.parse(getTaskClassificationsRequest));
28
+ }
29
+ //# sourceMappingURL=gettaskclassifications.js.map