@openrouter/sdk 0.13.7 → 0.13.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 (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 +3 -0
  45. package/esm/models/byokproviderslug.js +3 -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 +908 -0
  72. package/esm/models/imagegenerationrequest.js +266 -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 +3 -0
  128. package/esm/models/operations/listbyokkeys.js +3 -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 +3 -0
  142. package/esm/models/providername.js +3 -0
  143. package/esm/models/provideroptions.d.ts +19 -1
  144. package/esm/models/provideroptions.js +5 -0
  145. package/esm/models/providerresponse.d.ts +3 -0
  146. package/esm/models/providerresponse.js +3 -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 +33 -15
  182. package/esm/models/videogenerationrequest.js +16 -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 +5 -5
  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
@@ -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
  *
@@ -6,8 +6,11 @@ import { workspacesBulkAddMembers } from "../funcs/workspacesBulkAddMembers.js";
6
6
  import { workspacesBulkRemoveMembers } from "../funcs/workspacesBulkRemoveMembers.js";
7
7
  import { workspacesCreate } from "../funcs/workspacesCreate.js";
8
8
  import { workspacesDelete } from "../funcs/workspacesDelete.js";
9
+ import { workspacesDeleteBudget } from "../funcs/workspacesDeleteBudget.js";
9
10
  import { workspacesGet } from "../funcs/workspacesGet.js";
10
11
  import { workspacesList } from "../funcs/workspacesList.js";
12
+ import { workspacesListBudgets } from "../funcs/workspacesListBudgets.js";
13
+ import { workspacesSetBudget } from "../funcs/workspacesSetBudget.js";
11
14
  import { workspacesUpdate } from "../funcs/workspacesUpdate.js";
12
15
  import { ClientSDK } from "../lib/sdks.js";
13
16
  import { unwrapAsync } from "../types/fp.js";
@@ -58,6 +61,33 @@ export class Workspaces extends ClientSDK {
58
61
  async update(request, options) {
59
62
  return unwrapAsync(workspacesUpdate(this, request, options));
60
63
  }
64
+ /**
65
+ * List workspace budgets
66
+ *
67
+ * @remarks
68
+ * List all budgets configured for a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
69
+ */
70
+ async listBudgets(request, options) {
71
+ return unwrapAsync(workspacesListBudgets(this, request, options));
72
+ }
73
+ /**
74
+ * Delete a workspace budget
75
+ *
76
+ * @remarks
77
+ * Remove the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required.
78
+ */
79
+ async deleteBudget(request, options) {
80
+ return unwrapAsync(workspacesDeleteBudget(this, request, options));
81
+ }
82
+ /**
83
+ * Create or update a workspace budget
84
+ *
85
+ * @remarks
86
+ * 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.
87
+ */
88
+ async setBudget(request, options) {
89
+ return unwrapAsync(workspacesSetBudget(this, request, options));
90
+ }
61
91
  /**
62
92
  * Bulk add members to a workspace
63
93
  *
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.13.7",
5
+ "version": "0.13.13",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "0.13.7",
3
+ "version": "0.13.13",
4
4
  "author": "OpenRouter",
5
- "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
5
+ "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
6
6
  "keywords": [
7
7
  "openrouter",
8
8
  "sdk",
@@ -73,15 +73,15 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
- "test:watch": "vitest --watch --project unit",
77
76
  "typecheck": "tsc --noEmit",
77
+ "test:transit": "exit 0",
78
+ "test:watch": "vitest --watch --project unit",
78
79
  "typecheck:transit": "exit 0",
79
80
  "compile": "tsc",
80
81
  "postinstall": "node scripts/check-types.js || true",
81
82
  "prepare": "npm run build",
82
83
  "test": "vitest --run --project unit",
83
- "test:e2e": "vitest --run --project e2e",
84
- "test:transit": "exit 0"
84
+ "test:e2e": "vitest --run --project e2e"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {
@@ -1,19 +0,0 @@
1
- import { OpenRouterCore } from "../core.js";
2
- import { RequestOptions } from "../lib/sdks.js";
3
- import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
4
- import * as errors from "../models/errors/index.js";
5
- import { OpenRouterError } from "../models/errors/openroutererror.js";
6
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
7
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
- import * as models from "../models/index.js";
9
- import * as operations from "../models/operations/index.js";
10
- import { APIPromise } from "../types/async.js";
11
- import { Result } from "../types/fp.js";
12
- /**
13
- * Artificial Analysis Benchmark Indices
14
- *
15
- * @remarks
16
- * 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.
17
- */
18
- export declare function datasetsGetBenchmarksArtificialAnalysis(client: OpenRouterCore, request?: operations.GetBenchmarksArtificialAnalysisRequest | undefined, options?: RequestOptions): APIPromise<Result<models.BenchmarksAAResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
- //# sourceMappingURL=datasetsGetBenchmarksArtificialAnalysis.d.ts.map
@@ -1,15 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 74aab084b178
4
- */
5
- import * as z from "zod/v4";
6
- import { safeParse } from "../lib/schemas.js";
7
- /** @internal */
8
- export const BenchmarkPricing$inboundSchema = z.object({
9
- completion: z.string(),
10
- prompt: z.string(),
11
- });
12
- export function benchmarkPricingFromJSON(jsonString) {
13
- return safeParse(jsonString, (x) => BenchmarkPricing$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BenchmarkPricing' from JSON`);
14
- }
15
- //# sourceMappingURL=benchmarkpricing.js.map
@@ -1,29 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 82b5c9f01e00
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 { BenchmarkPricing$inboundSchema, } from "./benchmarkpricing.js";
9
- /** @internal */
10
- export const BenchmarksAAItem$inboundSchema = z.object({
11
- aa_name: z.string(),
12
- agentic_index: z.nullable(z.number()),
13
- coding_index: z.nullable(z.number()),
14
- intelligence_index: z.nullable(z.number()),
15
- model_permaslug: z.string(),
16
- pricing: z.nullable(BenchmarkPricing$inboundSchema),
17
- }).transform((v) => {
18
- return remap$(v, {
19
- "aa_name": "aaName",
20
- "agentic_index": "agenticIndex",
21
- "coding_index": "codingIndex",
22
- "intelligence_index": "intelligenceIndex",
23
- "model_permaslug": "modelPermaslug",
24
- });
25
- });
26
- export function benchmarksAAItemFromJSON(jsonString) {
27
- return safeParse(jsonString, (x) => BenchmarksAAItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BenchmarksAAItem' from JSON`);
28
- }
29
- //# sourceMappingURL=benchmarksaaitem.js.map
@@ -1,70 +0,0 @@
1
- import * as z from "zod/v4";
2
- import { ClosedEnum } from "../types/enums.js";
3
- import { Result as SafeParseResult } from "../types/fp.js";
4
- import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
- /**
6
- * Data source identifier.
7
- */
8
- export declare const BenchmarksAAMetaSource: {
9
- readonly ArtificialAnalysis: "artificial-analysis";
10
- };
11
- /**
12
- * Data source identifier.
13
- */
14
- export type BenchmarksAAMetaSource = ClosedEnum<typeof BenchmarksAAMetaSource>;
15
- /**
16
- * URL of the upstream data source.
17
- */
18
- export declare const BenchmarksAAMetaSourceUrl: {
19
- readonly HttpsArtificialanalysisAi: "https://artificialanalysis.ai";
20
- };
21
- /**
22
- * URL of the upstream data source.
23
- */
24
- export type BenchmarksAAMetaSourceUrl = ClosedEnum<typeof BenchmarksAAMetaSourceUrl>;
25
- /**
26
- * Dataset version.
27
- */
28
- export declare const BenchmarksAAMetaVersion: {
29
- readonly V1: "v1";
30
- };
31
- /**
32
- * Dataset version.
33
- */
34
- export type BenchmarksAAMetaVersion = ClosedEnum<typeof BenchmarksAAMetaVersion>;
35
- export type BenchmarksAAMeta = {
36
- /**
37
- * ISO-8601 timestamp of when this data was last updated.
38
- */
39
- asOf: string;
40
- /**
41
- * Required attribution when republishing this data.
42
- */
43
- citation: string;
44
- /**
45
- * Number of unique models in the response.
46
- */
47
- modelCount: number;
48
- /**
49
- * Data source identifier.
50
- */
51
- source: BenchmarksAAMetaSource;
52
- /**
53
- * URL of the upstream data source.
54
- */
55
- sourceUrl: BenchmarksAAMetaSourceUrl;
56
- /**
57
- * Dataset version.
58
- */
59
- version: BenchmarksAAMetaVersion;
60
- };
61
- /** @internal */
62
- export declare const BenchmarksAAMetaSource$inboundSchema: z.ZodEnum<typeof BenchmarksAAMetaSource>;
63
- /** @internal */
64
- export declare const BenchmarksAAMetaSourceUrl$inboundSchema: z.ZodEnum<typeof BenchmarksAAMetaSourceUrl>;
65
- /** @internal */
66
- export declare const BenchmarksAAMetaVersion$inboundSchema: z.ZodEnum<typeof BenchmarksAAMetaVersion>;
67
- /** @internal */
68
- export declare const BenchmarksAAMeta$inboundSchema: z.ZodType<BenchmarksAAMeta, unknown>;
69
- export declare function benchmarksAAMetaFromJSON(jsonString: string): SafeParseResult<BenchmarksAAMeta, SDKValidationError>;
70
- //# sourceMappingURL=benchmarksaameta.d.ts.map