@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
@@ -10,7 +10,7 @@ import { InputReference$outboundSchema, } from "./inputreference.js";
10
10
  /**
11
11
  * Aspect ratio of the generated video
12
12
  */
13
- export const AspectRatio = {
13
+ export const VideoGenerationRequestAspectRatio = {
14
14
  OneHundredAndSixtyNine: "16:9",
15
15
  NineHundredAndSixteen: "9:16",
16
16
  Eleven: "1:1",
@@ -24,7 +24,7 @@ export const AspectRatio = {
24
24
  /**
25
25
  * Resolution of the generated video
26
26
  */
27
- export const Resolution = {
27
+ export const VideoGenerationRequestResolution = {
28
28
  FourHundredAndEightyp: "480p",
29
29
  SevenHundredAndTwentyp: "720p",
30
30
  OneThousandAndEightyp: "1080p",
@@ -33,10 +33,9 @@ export const Resolution = {
33
33
  FourK: "4K",
34
34
  };
35
35
  /** @internal */
36
- export const AspectRatio$outboundSchema = openEnums.outboundSchema(AspectRatio);
36
+ export const VideoGenerationRequestAspectRatio$outboundSchema = openEnums.outboundSchema(VideoGenerationRequestAspectRatio);
37
37
  /** @internal */
38
- export const Options$outboundSchema = z
39
- .object({
38
+ export const VideoGenerationRequestOptions$outboundSchema = z.object({
40
39
  oneai: z.record(z.string(), z.nullable(z.any())).optional(),
41
40
  ai21: z.record(z.string(), z.nullable(z.any())).optional(),
42
41
  aionLabs: z.record(z.string(), z.nullable(z.any())).optional(),
@@ -82,11 +81,13 @@ export const Options$outboundSchema = z
82
81
  googleVertex: z.record(z.string(), z.nullable(z.any())).optional(),
83
82
  gopomelo: z.record(z.string(), z.nullable(z.any())).optional(),
84
83
  groq: z.record(z.string(), z.nullable(z.any())).optional(),
84
+ heygen: z.record(z.string(), z.nullable(z.any())).optional(),
85
85
  huggingface: z.record(z.string(), z.nullable(z.any())).optional(),
86
86
  hyperbolic: z.record(z.string(), z.nullable(z.any())).optional(),
87
87
  hyperbolicQuantized: z.record(z.string(), z.nullable(z.any())).optional(),
88
88
  inception: z.record(z.string(), z.nullable(z.any())).optional(),
89
89
  inceptron: z.record(z.string(), z.nullable(z.any())).optional(),
90
+ inferactVllm: z.record(z.string(), z.nullable(z.any())).optional(),
90
91
  inferenceNet: z.record(z.string(), z.nullable(z.any())).optional(),
91
92
  infermatic: z.record(z.string(), z.nullable(z.any())).optional(),
92
93
  inflection: z.record(z.string(), z.nullable(z.any())).optional(),
@@ -131,6 +132,7 @@ export const Options$outboundSchema = z
131
132
  reka: z.record(z.string(), z.nullable(z.any())).optional(),
132
133
  relace: z.record(z.string(), z.nullable(z.any())).optional(),
133
134
  replicate: z.record(z.string(), z.nullable(z.any())).optional(),
135
+ sakanaAi: z.record(z.string(), z.nullable(z.any())).optional(),
134
136
  sambanova: z.record(z.string(), z.nullable(z.any())).optional(),
135
137
  sambanovaCloaked: z.record(z.string(), z.nullable(z.any())).optional(),
136
138
  seed: z.record(z.string(), z.nullable(z.any())).optional(),
@@ -142,6 +144,7 @@ export const Options$outboundSchema = z
142
144
  streamlake: z.record(z.string(), z.nullable(z.any())).optional(),
143
145
  switchpoint: z.record(z.string(), z.nullable(z.any())).optional(),
144
146
  targon: z.record(z.string(), z.nullable(z.any())).optional(),
147
+ tenstorrent: z.record(z.string(), z.nullable(z.any())).optional(),
145
148
  together: z.record(z.string(), z.nullable(z.any())).optional(),
146
149
  togetherLite: z.record(z.string(), z.nullable(z.any())).optional(),
147
150
  ubicloud: z.record(z.string(), z.nullable(z.any())).optional(),
@@ -165,33 +168,36 @@ export const Options$outboundSchema = z
165
168
  googleAiStudio: "google-ai-studio",
166
169
  googleVertex: "google-vertex",
167
170
  hyperbolicQuantized: "hyperbolic-quantized",
171
+ inferactVllm: "inferact-vllm",
168
172
  inferenceNet: "inference-net",
169
173
  ioNet: "io-net",
170
174
  lynnPrivate: "lynn-private",
171
175
  mancerOld: "mancer-old",
172
176
  nexAgi: "nex-agi",
173
177
  openInference: "open-inference",
178
+ sakanaAi: "sakana-ai",
174
179
  sambanovaCloaked: "sambanova-cloaked",
175
180
  sfCompute: "sf-compute",
176
181
  togetherLite: "together-lite",
177
182
  zAi: "z-ai",
178
183
  });
179
184
  });
180
- export function optionsToJSON(options) {
181
- return JSON.stringify(Options$outboundSchema.parse(options));
185
+ export function videoGenerationRequestOptionsToJSON(videoGenerationRequestOptions) {
186
+ return JSON.stringify(VideoGenerationRequestOptions$outboundSchema.parse(videoGenerationRequestOptions));
182
187
  }
183
188
  /** @internal */
184
189
  export const VideoGenerationRequestProvider$outboundSchema = z.object({
185
- options: z.lazy(() => Options$outboundSchema).optional(),
190
+ options: z.lazy(() => VideoGenerationRequestOptions$outboundSchema)
191
+ .optional(),
186
192
  });
187
193
  export function videoGenerationRequestProviderToJSON(videoGenerationRequestProvider) {
188
194
  return JSON.stringify(VideoGenerationRequestProvider$outboundSchema.parse(videoGenerationRequestProvider));
189
195
  }
190
196
  /** @internal */
191
- export const Resolution$outboundSchema = openEnums.outboundSchema(Resolution);
197
+ export const VideoGenerationRequestResolution$outboundSchema = openEnums.outboundSchema(VideoGenerationRequestResolution);
192
198
  /** @internal */
193
199
  export const VideoGenerationRequest$outboundSchema = z.object({
194
- aspectRatio: AspectRatio$outboundSchema.optional(),
200
+ aspectRatio: VideoGenerationRequestAspectRatio$outboundSchema.optional(),
195
201
  callbackUrl: z.string().optional(),
196
202
  duration: z.int().optional(),
197
203
  frameImages: z.array(FrameImage$outboundSchema).optional(),
@@ -201,7 +207,7 @@ export const VideoGenerationRequest$outboundSchema = z.object({
201
207
  prompt: z.string(),
202
208
  provider: z.lazy(() => VideoGenerationRequestProvider$outboundSchema)
203
209
  .optional(),
204
- resolution: Resolution$outboundSchema.optional(),
210
+ resolution: VideoGenerationRequestResolution$outboundSchema.optional(),
205
211
  seed: z.int().optional(),
206
212
  size: z.string().optional(),
207
213
  }).transform((v) => {
@@ -20,7 +20,7 @@ export type WebSearchConfig = {
20
20
  */
21
21
  maxCharacters?: number | undefined;
22
22
  /**
23
- * Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search.
23
+ * Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped.
24
24
  */
25
25
  maxResults?: number | undefined;
26
26
  /**
@@ -15,7 +15,7 @@ export type WebSearchServerTool = {
15
15
  engine?: WebSearchEngineEnum | undefined;
16
16
  filters?: WebSearchDomainFilter | null | undefined;
17
17
  /**
18
- * Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search.
18
+ * Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped.
19
19
  */
20
20
  maxResults?: number | undefined;
21
21
  /**
@@ -23,7 +23,7 @@ export type WebSearchServerToolConfig = {
23
23
  */
24
24
  maxCharacters?: number | undefined;
25
25
  /**
26
- * Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search.
26
+ * Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped.
27
27
  */
28
28
  maxResults?: number | undefined;
29
29
  /**
@@ -0,0 +1,48 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ import { Result as SafeParseResult } from "../types/fp.js";
4
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ /**
6
+ * Interval at which spend resets. Null means a lifetime (one-time) budget.
7
+ */
8
+ export declare const ResetInterval: {
9
+ readonly Daily: "daily";
10
+ readonly Weekly: "weekly";
11
+ readonly Monthly: "monthly";
12
+ };
13
+ /**
14
+ * Interval at which spend resets. Null means a lifetime (one-time) budget.
15
+ */
16
+ export type ResetInterval = OpenEnum<typeof ResetInterval>;
17
+ export type WorkspaceBudget = {
18
+ /**
19
+ * ISO 8601 timestamp of when the budget was created
20
+ */
21
+ createdAt: string;
22
+ /**
23
+ * Unique identifier for the budget
24
+ */
25
+ id: string;
26
+ /**
27
+ * Spending limit in USD for this interval
28
+ */
29
+ limitUsd: number;
30
+ /**
31
+ * Interval at which spend resets. Null means a lifetime (one-time) budget.
32
+ */
33
+ resetInterval: ResetInterval | null;
34
+ /**
35
+ * ISO 8601 timestamp of when the budget was last updated
36
+ */
37
+ updatedAt: string;
38
+ /**
39
+ * ID of the workspace the budget belongs to
40
+ */
41
+ workspaceId: string;
42
+ };
43
+ /** @internal */
44
+ export declare const ResetInterval$inboundSchema: z.ZodType<ResetInterval, unknown>;
45
+ /** @internal */
46
+ export declare const WorkspaceBudget$inboundSchema: z.ZodType<WorkspaceBudget, unknown>;
47
+ export declare function workspaceBudgetFromJSON(jsonString: string): SafeParseResult<WorkspaceBudget, SDKValidationError>;
48
+ //# sourceMappingURL=workspacebudget.d.ts.map
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: ede50342c11d
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import * as openEnums from "../types/enums.js";
9
+ /**
10
+ * Interval at which spend resets. Null means a lifetime (one-time) budget.
11
+ */
12
+ export const ResetInterval = {
13
+ Daily: "daily",
14
+ Weekly: "weekly",
15
+ Monthly: "monthly",
16
+ };
17
+ /** @internal */
18
+ export const ResetInterval$inboundSchema = openEnums.inboundSchema(ResetInterval);
19
+ /** @internal */
20
+ export const WorkspaceBudget$inboundSchema = z.object({
21
+ created_at: z.string(),
22
+ id: z.string(),
23
+ limit_usd: z.number(),
24
+ reset_interval: z.nullable(ResetInterval$inboundSchema),
25
+ updated_at: z.string(),
26
+ workspace_id: z.string(),
27
+ }).transform((v) => {
28
+ return remap$(v, {
29
+ "created_at": "createdAt",
30
+ "limit_usd": "limitUsd",
31
+ "reset_interval": "resetInterval",
32
+ "updated_at": "updatedAt",
33
+ "workspace_id": "workspaceId",
34
+ });
35
+ });
36
+ export function workspaceBudgetFromJSON(jsonString) {
37
+ return safeParse(jsonString, (x) => WorkspaceBudget$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkspaceBudget' from JSON`);
38
+ }
39
+ //# sourceMappingURL=workspacebudget.js.map
@@ -0,0 +1,18 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ /**
4
+ * Budget reset interval. Use "lifetime" for a one-time budget that never resets.
5
+ */
6
+ export declare const WorkspaceBudgetInterval: {
7
+ readonly Daily: "daily";
8
+ readonly Weekly: "weekly";
9
+ readonly Monthly: "monthly";
10
+ readonly Lifetime: "lifetime";
11
+ };
12
+ /**
13
+ * Budget reset interval. Use "lifetime" for a one-time budget that never resets.
14
+ */
15
+ export type WorkspaceBudgetInterval = OpenEnum<typeof WorkspaceBudgetInterval>;
16
+ /** @internal */
17
+ export declare const WorkspaceBudgetInterval$outboundSchema: z.ZodType<string, WorkspaceBudgetInterval>;
18
+ //# sourceMappingURL=workspacebudgetinterval.d.ts.map
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b66734baba42
4
+ */
5
+ import * as openEnums from "../types/enums.js";
6
+ /**
7
+ * Budget reset interval. Use "lifetime" for a one-time budget that never resets.
8
+ */
9
+ export const WorkspaceBudgetInterval = {
10
+ Daily: "daily",
11
+ Weekly: "weekly",
12
+ Monthly: "monthly",
13
+ Lifetime: "lifetime",
14
+ };
15
+ /** @internal */
16
+ export const WorkspaceBudgetInterval$outboundSchema = openEnums.outboundSchema(WorkspaceBudgetInterval);
17
+ //# sourceMappingURL=workspacebudgetinterval.js.map
@@ -0,0 +1,13 @@
1
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
2
+ import * as models from "../models/index.js";
3
+ import * as operations from "../models/operations/index.js";
4
+ export declare class Benchmarks extends ClientSDK {
5
+ /**
6
+ * List Benchmarks
7
+ *
8
+ * @remarks
9
+ * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
10
+ */
11
+ getBenchmarks(request?: operations.GetBenchmarksRequest | undefined, options?: RequestOptions): Promise<models.UnifiedBenchmarksResponse>;
12
+ }
13
+ //# sourceMappingURL=benchmarks.d.ts.map
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 72ce7b70fba8
4
+ */
5
+ import { benchmarksGetBenchmarks } from "../funcs/benchmarksGetBenchmarks.js";
6
+ import { ClientSDK } from "../lib/sdks.js";
7
+ import { unwrapAsync } from "../types/fp.js";
8
+ export class Benchmarks extends ClientSDK {
9
+ /**
10
+ * List Benchmarks
11
+ *
12
+ * @remarks
13
+ * Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
14
+ */
15
+ async getBenchmarks(request, options) {
16
+ return unwrapAsync(benchmarksGetBenchmarks(this, request, options));
17
+ }
18
+ }
19
+ //# sourceMappingURL=benchmarks.js.map
@@ -0,0 +1,31 @@
1
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
2
+ import * as models from "../models/index.js";
3
+ import * as operations from "../models/operations/index.js";
4
+ export declare class Classifications extends ClientSDK {
5
+ /**
6
+ * Task classification market share
7
+ *
8
+ * @remarks
9
+ * Returns the market-share breakdown of OpenRouter traffic by task classification
10
+ * (e.g. code generation, web search, summarization) over a trailing time window.
11
+ *
12
+ * Each classification reports its share of classified sampled requests (`usage_share`)
13
+ * and classified sampled token volume (`token_share`) as fractions between 0 and 1.
14
+ * The unclassified `other` bucket is excluded. Absolute volumes are not exposed
15
+ * because the underlying data is sampled.
16
+ *
17
+ * Each classification also includes a `models` array listing the top models by
18
+ * request volume within that classification, with their within-tag usage and token shares.
19
+ *
20
+ * Classifications are grouped into macro-categories (Code, Data, Agent, General)
21
+ * with aggregate shares provided for each.
22
+ *
23
+ * Authenticate with any valid OpenRouter API key (same key used for inference).
24
+ * Rate-limited to 30 requests/minute per key and 500 requests/day per account.
25
+ *
26
+ * When republishing or quoting this data, cite as:
27
+ * "Source: OpenRouter (openrouter.ai/rankings), as of {as_of}."
28
+ */
29
+ getTaskClassifications(request?: operations.GetTaskClassificationsRequest | undefined, options?: RequestOptions): Promise<models.TaskClassificationResponse>;
30
+ }
31
+ //# sourceMappingURL=classifications.d.ts.map
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 2a28d7ad1729
4
+ */
5
+ import { classificationsGetTaskClassifications } from "../funcs/classificationsGetTaskClassifications.js";
6
+ import { ClientSDK } from "../lib/sdks.js";
7
+ import { unwrapAsync } from "../types/fp.js";
8
+ export class Classifications extends ClientSDK {
9
+ /**
10
+ * Task classification market share
11
+ *
12
+ * @remarks
13
+ * Returns the market-share breakdown of OpenRouter traffic by task classification
14
+ * (e.g. code generation, web search, summarization) over a trailing time window.
15
+ *
16
+ * Each classification reports its share of classified sampled requests (`usage_share`)
17
+ * and classified sampled token volume (`token_share`) as fractions between 0 and 1.
18
+ * The unclassified `other` bucket is excluded. Absolute volumes are not exposed
19
+ * because the underlying data is sampled.
20
+ *
21
+ * Each classification also includes a `models` array listing the top models by
22
+ * request volume within that classification, with their within-tag usage and token shares.
23
+ *
24
+ * Classifications are grouped into macro-categories (Code, Data, Agent, General)
25
+ * with aggregate shares provided for each.
26
+ *
27
+ * Authenticate with any valid OpenRouter API key (same key used for inference).
28
+ * Rate-limited to 30 requests/minute per key and 500 requests/day per account.
29
+ *
30
+ * When republishing or quoting this data, cite as:
31
+ * "Source: OpenRouter (openrouter.ai/rankings), as of {as_of}."
32
+ */
33
+ async getTaskClassifications(request, options) {
34
+ return unwrapAsync(classificationsGetTaskClassifications(this, request, options));
35
+ }
36
+ }
37
+ //# sourceMappingURL=classifications.js.map
@@ -34,20 +34,6 @@ export declare class Datasets extends ClientSDK {
34
34
  getAppRankings(request?: operations.GetAppRankingsRequest | undefined, options?: RequestOptions): Promise<PageIterator<operations.GetAppRankingsResponse, {
35
35
  offset: number;
36
36
  }>>;
37
- /**
38
- * Artificial Analysis Benchmark Indices
39
- *
40
- * @remarks
41
- * Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
42
- */
43
- getBenchmarksArtificialAnalysis(request?: operations.GetBenchmarksArtificialAnalysisRequest | undefined, options?: RequestOptions): Promise<models.BenchmarksAAResponse>;
44
- /**
45
- * Design Arena Benchmark Rankings
46
- *
47
- * @remarks
48
- * Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
49
- */
50
- getBenchmarksDesignArena(request?: operations.GetBenchmarksDesignArenaRequest | undefined, options?: RequestOptions): Promise<models.BenchmarksDAResponse>;
51
37
  /**
52
38
  * Daily token totals for top 50 models
53
39
  *
@@ -3,8 +3,6 @@
3
3
  * @generated-id: 2f1e89a21914
4
4
  */
5
5
  import { datasetsGetAppRankings } from "../funcs/datasetsGetAppRankings.js";
6
- import { datasetsGetBenchmarksArtificialAnalysis } from "../funcs/datasetsGetBenchmarksArtificialAnalysis.js";
7
- import { datasetsGetBenchmarksDesignArena } from "../funcs/datasetsGetBenchmarksDesignArena.js";
8
6
  import { datasetsGetRankingsDaily } from "../funcs/datasetsGetRankingsDaily.js";
9
7
  import { ClientSDK } from "../lib/sdks.js";
10
8
  import { unwrapAsync } from "../types/fp.js";
@@ -41,24 +39,6 @@ export class Datasets extends ClientSDK {
41
39
  async getAppRankings(request, options) {
42
40
  return unwrapResultIterator(datasetsGetAppRankings(this, request, options));
43
41
  }
44
- /**
45
- * Artificial Analysis Benchmark Indices
46
- *
47
- * @remarks
48
- * Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
49
- */
50
- async getBenchmarksArtificialAnalysis(request, options) {
51
- return unwrapAsync(datasetsGetBenchmarksArtificialAnalysis(this, request, options));
52
- }
53
- /**
54
- * Design Arena Benchmark Rankings
55
- *
56
- * @remarks
57
- * Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
58
- */
59
- async getBenchmarksDesignArena(request, options) {
60
- return unwrapAsync(datasetsGetBenchmarksDesignArena(this, request, options));
61
- }
62
42
  /**
63
43
  * Daily token totals for top 50 models
64
44
  *
@@ -0,0 +1,38 @@
1
+ import { EventStream } from "../lib/event-streams.js";
2
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
3
+ import * as models from "../models/index.js";
4
+ import * as operations from "../models/operations/index.js";
5
+ export declare class Images extends ClientSDK {
6
+ /**
7
+ * Generate an image
8
+ *
9
+ * @remarks
10
+ * Generates an image from a text prompt via the image generation router
11
+ */
12
+ generate(request: operations.CreateImagesRequest & {
13
+ imageGenerationRequest: {
14
+ stream?: false | undefined;
15
+ };
16
+ }, options?: RequestOptions): Promise<models.ImageGenerationResponse>;
17
+ generate(request: operations.CreateImagesRequest & {
18
+ imageGenerationRequest: {
19
+ stream: true;
20
+ };
21
+ }, options?: RequestOptions): Promise<EventStream<models.ImageStreamingResponseData>>;
22
+ generate(request: operations.CreateImagesRequest, options?: RequestOptions): Promise<operations.CreateImagesResponse>;
23
+ /**
24
+ * List image generation models
25
+ *
26
+ * @remarks
27
+ * Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records.
28
+ */
29
+ listModels(request?: operations.ListImageModelsRequest | undefined, options?: RequestOptions): Promise<models.ImageModelsListResponse>;
30
+ /**
31
+ * List endpoints for an image model
32
+ *
33
+ * @remarks
34
+ * Returns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist.
35
+ */
36
+ listModelEndpoints(request: operations.ListImageModelEndpointsRequest, options?: RequestOptions): Promise<models.ImageModelEndpointsResponse>;
37
+ }
38
+ //# sourceMappingURL=images.d.ts.map
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 5b5822276576
4
+ */
5
+ import { imagesGenerate } from "../funcs/imagesGenerate.js";
6
+ import { imagesListModelEndpoints } from "../funcs/imagesListModelEndpoints.js";
7
+ import { imagesListModels } from "../funcs/imagesListModels.js";
8
+ import { ClientSDK } from "../lib/sdks.js";
9
+ import { unwrapAsync } from "../types/fp.js";
10
+ export class Images extends ClientSDK {
11
+ async generate(request, options) {
12
+ return unwrapAsync(imagesGenerate(this, request, options));
13
+ }
14
+ /**
15
+ * List image generation models
16
+ *
17
+ * @remarks
18
+ * Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records.
19
+ */
20
+ async listModels(request, options) {
21
+ return unwrapAsync(imagesListModels(this, request, options));
22
+ }
23
+ /**
24
+ * List endpoints for an image model
25
+ *
26
+ * @remarks
27
+ * Returns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist.
28
+ */
29
+ async listModelEndpoints(request, options) {
30
+ return unwrapAsync(imagesListModelEndpoints(this, request, options));
31
+ }
32
+ }
33
+ //# sourceMappingURL=images.js.map
package/esm/sdk/sdk.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  import { ClientSDK } from "../lib/sdks.js";
2
2
  import { Analytics } from "./analytics.js";
3
3
  import { APIKeys } from "./apikeys.js";
4
+ import { Benchmarks } from "./benchmarks.js";
4
5
  import { Beta } from "./beta.js";
5
6
  import { Byok } from "./byok.js";
6
7
  import { Chat } from "./chat.js";
8
+ import { Classifications } from "./classifications.js";
7
9
  import { Credits } from "./credits.js";
8
10
  import { Datasets } from "./datasets.js";
9
11
  import { Embeddings } from "./embeddings.js";
@@ -11,6 +13,7 @@ import { Endpoints } from "./endpoints.js";
11
13
  import { Files } from "./files.js";
12
14
  import { Generations } from "./generations.js";
13
15
  import { Guardrails } from "./guardrails.js";
16
+ import { Images } from "./images.js";
14
17
  import { Models } from "./models.js";
15
18
  import { OAuth } from "./oauth.js";
16
19
  import { Observability } from "./observability.js";
@@ -39,10 +42,14 @@ export declare class OpenRouter extends ClientSDK {
39
42
  get stt(): Stt;
40
43
  private _oAuth?;
41
44
  get oAuth(): OAuth;
45
+ private _benchmarks?;
46
+ get benchmarks(): Benchmarks;
42
47
  private _byok?;
43
48
  get byok(): Byok;
44
49
  private _chat?;
45
50
  get chat(): Chat;
51
+ private _classifications?;
52
+ get classifications(): Classifications;
46
53
  private _credits?;
47
54
  get credits(): Credits;
48
55
  private _datasets?;
@@ -57,6 +64,8 @@ export declare class OpenRouter extends ClientSDK {
57
64
  get generations(): Generations;
58
65
  private _guardrails?;
59
66
  get guardrails(): Guardrails;
67
+ private _images?;
68
+ get images(): Images;
60
69
  private _apiKeys?;
61
70
  get apiKeys(): APIKeys;
62
71
  private _models?;
package/esm/sdk/sdk.js CHANGED
@@ -5,9 +5,11 @@
5
5
  import { ClientSDK } from "../lib/sdks.js";
6
6
  import { Analytics } from "./analytics.js";
7
7
  import { APIKeys } from "./apikeys.js";
8
+ import { Benchmarks } from "./benchmarks.js";
8
9
  import { Beta } from "./beta.js";
9
10
  import { Byok } from "./byok.js";
10
11
  import { Chat } from "./chat.js";
12
+ import { Classifications } from "./classifications.js";
11
13
  import { Credits } from "./credits.js";
12
14
  import { Datasets } from "./datasets.js";
13
15
  import { Embeddings } from "./embeddings.js";
@@ -15,6 +17,7 @@ import { Endpoints } from "./endpoints.js";
15
17
  import { Files } from "./files.js";
16
18
  import { Generations } from "./generations.js";
17
19
  import { Guardrails } from "./guardrails.js";
20
+ import { Images } from "./images.js";
18
21
  import { Models } from "./models.js";
19
22
  import { OAuth } from "./oauth.js";
20
23
  import { Observability } from "./observability.js";
@@ -46,12 +49,18 @@ export class OpenRouter extends ClientSDK {
46
49
  get oAuth() {
47
50
  return (this._oAuth ?? (this._oAuth = new OAuth(this._options)));
48
51
  }
52
+ get benchmarks() {
53
+ return (this._benchmarks ?? (this._benchmarks = new Benchmarks(this._options)));
54
+ }
49
55
  get byok() {
50
56
  return (this._byok ?? (this._byok = new Byok(this._options)));
51
57
  }
52
58
  get chat() {
53
59
  return (this._chat ?? (this._chat = new Chat(this._options)));
54
60
  }
61
+ get classifications() {
62
+ return (this._classifications ?? (this._classifications = new Classifications(this._options)));
63
+ }
55
64
  get credits() {
56
65
  return (this._credits ?? (this._credits = new Credits(this._options)));
57
66
  }
@@ -73,6 +82,9 @@ export class OpenRouter extends ClientSDK {
73
82
  get guardrails() {
74
83
  return (this._guardrails ?? (this._guardrails = new Guardrails(this._options)));
75
84
  }
85
+ get images() {
86
+ return (this._images ?? (this._images = new Images(this._options)));
87
+ }
76
88
  get apiKeys() {
77
89
  return (this._apiKeys ?? (this._apiKeys = new APIKeys(this._options)));
78
90
  }
@@ -40,6 +40,27 @@ export declare class Workspaces extends ClientSDK {
40
40
  * Update an existing workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required.
41
41
  */
42
42
  update(request: operations.UpdateWorkspaceRequest, options?: RequestOptions): Promise<models.UpdateWorkspaceResponse>;
43
+ /**
44
+ * List workspace budgets
45
+ *
46
+ * @remarks
47
+ * List all budgets configured for a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
48
+ */
49
+ listBudgets(request: operations.ListWorkspaceBudgetsRequest, options?: RequestOptions): Promise<models.ListWorkspaceBudgetsResponse>;
50
+ /**
51
+ * Delete a workspace budget
52
+ *
53
+ * @remarks
54
+ * Remove the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required.
55
+ */
56
+ deleteBudget(request: operations.DeleteWorkspaceBudgetRequest, options?: RequestOptions): Promise<models.DeleteWorkspaceBudgetResponse>;
57
+ /**
58
+ * Create or update a workspace budget
59
+ *
60
+ * @remarks
61
+ * Create or update the budget for a given interval. Budget limits must strictly decrease as the interval narrows (lifetime > monthly > weekly > daily). [Management key](/docs/guides/overview/auth/management-api-keys) required.
62
+ */
63
+ setBudget(request: operations.UpsertWorkspaceBudgetRequest, options?: RequestOptions): Promise<models.UpsertWorkspaceBudgetResponse>;
43
64
  /**
44
65
  * Bulk add members to a workspace
45
66
  *