@openrouter/sdk 1.3.29 → 1.3.30

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 (203) hide show
  1. package/README.md +1 -1
  2. package/esm/funcs/batchCreateBatches.d.ts +19 -0
  3. package/esm/funcs/batchCreateBatches.js +98 -0
  4. package/esm/funcs/batchDelete.d.ts +19 -0
  5. package/esm/funcs/batchDelete.js +103 -0
  6. package/esm/funcs/batchGetBatches.d.ts +19 -0
  7. package/esm/funcs/batchGetBatches.js +103 -0
  8. package/esm/funcs/batchList.d.ts +21 -0
  9. package/esm/funcs/batchList.js +134 -0
  10. package/esm/lib/config.d.ts +2 -2
  11. package/esm/lib/config.js +2 -2
  12. package/esm/models/anthropicadvisortoolresult.d.ts +14 -0
  13. package/esm/models/anthropicadvisortoolresult.js +21 -0
  14. package/esm/models/anthropicbase64pdfsource.d.ts +17 -2
  15. package/esm/models/anthropicbase64pdfsource.js +25 -2
  16. package/esm/models/anthropicbashcodeexecutioncontent.d.ts +11 -0
  17. package/esm/models/anthropicbashcodeexecutioncontent.js +17 -0
  18. package/esm/models/anthropicbashcodeexecutionoutput.d.ts +18 -0
  19. package/esm/models/anthropicbashcodeexecutionoutput.js +25 -0
  20. package/esm/models/anthropicbashcodeexecutionresult.d.ts +15 -0
  21. package/esm/models/anthropicbashcodeexecutionresult.js +24 -0
  22. package/esm/models/anthropicbashcodeexecutiontoolresult.d.ts +13 -0
  23. package/esm/models/anthropicbashcodeexecutiontoolresult.js +22 -0
  24. package/esm/models/anthropicbashcodeexecutiontoolresulterror.d.ts +22 -0
  25. package/esm/models/anthropicbashcodeexecutiontoolresulterror.js +30 -0
  26. package/esm/models/anthropiccaller.d.ts +12 -0
  27. package/esm/models/anthropiccaller.js +19 -0
  28. package/esm/models/anthropiccitationcharlocation.d.ts +16 -0
  29. package/esm/models/anthropiccitationcharlocation.js +30 -0
  30. package/esm/models/anthropiccitationcontentblocklocation.d.ts +16 -0
  31. package/esm/models/anthropiccitationcontentblocklocation.js +30 -0
  32. package/esm/models/anthropiccitationpagelocation.d.ts +16 -0
  33. package/esm/models/anthropiccitationpagelocation.js +30 -0
  34. package/esm/models/anthropiccitationsconfig.d.ts +10 -0
  35. package/esm/models/anthropiccitationsconfig.js +14 -0
  36. package/esm/models/anthropiccitationsearchresultlocation.d.ts +16 -0
  37. package/esm/models/anthropiccitationsearchresultlocation.js +28 -0
  38. package/esm/models/anthropiccitationwebsearchresultlocation.d.ts +14 -0
  39. package/esm/models/anthropiccitationwebsearchresultlocation.js +24 -0
  40. package/esm/models/anthropiccodeexecution20250825caller.d.ts +11 -0
  41. package/esm/models/anthropiccodeexecution20250825caller.js +20 -0
  42. package/esm/models/anthropiccodeexecution20260120caller.d.ts +11 -0
  43. package/esm/models/anthropiccodeexecution20260120caller.js +20 -0
  44. package/esm/models/anthropiccodeexecutioncontent.d.ts +12 -0
  45. package/esm/models/anthropiccodeexecutioncontent.js +19 -0
  46. package/esm/models/anthropiccodeexecutionoutput.d.ts +18 -0
  47. package/esm/models/anthropiccodeexecutionoutput.js +25 -0
  48. package/esm/models/anthropiccodeexecutionresult.d.ts +15 -0
  49. package/esm/models/anthropiccodeexecutionresult.js +24 -0
  50. package/esm/models/anthropiccodeexecutiontoolresult.d.ts +13 -0
  51. package/esm/models/anthropiccodeexecutiontoolresult.js +22 -0
  52. package/esm/models/anthropiccodeexecutiontoolresulterror.d.ts +12 -0
  53. package/esm/models/anthropiccodeexecutiontoolresulterror.js +21 -0
  54. package/esm/models/anthropiccompactionblock.d.ts +12 -0
  55. package/esm/models/anthropiccompactionblock.js +21 -0
  56. package/esm/models/anthropiccontainer.d.ts +13 -0
  57. package/esm/models/anthropiccontainer.js +22 -0
  58. package/esm/models/anthropiccontainerskill.d.ts +20 -0
  59. package/esm/models/anthropiccontainerskill.js +28 -0
  60. package/esm/models/anthropiccontainerupload.d.ts +11 -0
  61. package/esm/models/anthropiccontainerupload.js +20 -0
  62. package/esm/models/anthropicdirectcaller.d.ts +10 -0
  63. package/esm/models/anthropicdirectcaller.js +14 -0
  64. package/esm/models/anthropicdocumentblock.d.ts +36 -0
  65. package/esm/models/anthropicdocumentblock.js +45 -0
  66. package/esm/models/anthropicdocumentblockparam.d.ts +20 -4
  67. package/esm/models/anthropicdocumentblockparam.js +4 -4
  68. package/esm/models/anthropicencryptedcodeexecutionresult.d.ts +15 -0
  69. package/esm/models/anthropicencryptedcodeexecutionresult.js +25 -0
  70. package/esm/models/anthropicinputtransformation.d.ts +18 -0
  71. package/esm/models/anthropicinputtransformation.js +16 -0
  72. package/esm/models/anthropicoutputtokensdetails.d.ts +10 -0
  73. package/esm/models/anthropicoutputtokensdetails.js +19 -0
  74. package/esm/models/anthropicplaintextsource.d.ts +17 -2
  75. package/esm/models/anthropicplaintextsource.js +25 -2
  76. package/esm/models/anthropicredactedthinkingblock.d.ts +11 -0
  77. package/esm/models/anthropicredactedthinkingblock.js +15 -0
  78. package/esm/models/anthropicrefusalstopdetails.d.ts +32 -0
  79. package/esm/models/anthropicrefusalstopdetails.js +31 -0
  80. package/esm/models/anthropicservertoolerrorcode.d.ts +12 -0
  81. package/esm/models/anthropicservertoolerrorcode.js +14 -0
  82. package/esm/models/anthropicservertoolusage.d.ts +11 -0
  83. package/esm/models/anthropicservertoolusage.js +21 -0
  84. package/esm/models/anthropicservicetier.d.ts +11 -0
  85. package/esm/models/anthropicservicetier.js +13 -0
  86. package/esm/models/anthropictextblock.d.ts +13 -0
  87. package/esm/models/anthropictextblock.js +17 -0
  88. package/esm/models/anthropictextcitation.d.ts +14 -0
  89. package/esm/models/anthropictextcitation.js +23 -0
  90. package/esm/models/anthropictexteditorcodeexecutioncontent.d.ts +13 -0
  91. package/esm/models/anthropictexteditorcodeexecutioncontent.js +21 -0
  92. package/esm/models/anthropictexteditorcodeexecutioncreateresult.d.ts +11 -0
  93. package/esm/models/anthropictexteditorcodeexecutioncreateresult.js +20 -0
  94. package/esm/models/anthropictexteditorcodeexecutionstrreplaceresult.d.ts +15 -0
  95. package/esm/models/anthropictexteditorcodeexecutionstrreplaceresult.js +28 -0
  96. package/esm/models/anthropictexteditorcodeexecutiontoolresult.d.ts +13 -0
  97. package/esm/models/anthropictexteditorcodeexecutiontoolresult.js +22 -0
  98. package/esm/models/anthropictexteditorcodeexecutiontoolresulterror.d.ts +23 -0
  99. package/esm/models/anthropictexteditorcodeexecutiontoolresulterror.js +33 -0
  100. package/esm/models/anthropictexteditorcodeexecutionviewresult.d.ts +24 -0
  101. package/esm/models/anthropictexteditorcodeexecutionviewresult.js +36 -0
  102. package/esm/models/anthropicthinkingblock.d.ts +12 -0
  103. package/esm/models/anthropicthinkingblock.js +16 -0
  104. package/esm/models/anthropictoolreference.d.ts +18 -0
  105. package/esm/models/anthropictoolreference.js +25 -0
  106. package/esm/models/anthropictoolsearchcontent.d.ts +11 -0
  107. package/esm/models/anthropictoolsearchcontent.js +17 -0
  108. package/esm/models/anthropictoolsearchresult.d.ts +12 -0
  109. package/esm/models/anthropictoolsearchresult.js +21 -0
  110. package/esm/models/anthropictoolsearchresulterror.d.ts +13 -0
  111. package/esm/models/anthropictoolsearchresulterror.js +23 -0
  112. package/esm/models/anthropictoolsearchtoolresult.d.ts +13 -0
  113. package/esm/models/anthropictoolsearchtoolresult.js +22 -0
  114. package/esm/models/anthropictooluseblock.d.ts +15 -0
  115. package/esm/models/anthropictooluseblock.js +19 -0
  116. package/esm/models/anthropicwebfetchblock.d.ts +14 -0
  117. package/esm/models/anthropicwebfetchblock.js +23 -0
  118. package/esm/models/anthropicwebfetchcontent.d.ts +11 -0
  119. package/esm/models/anthropicwebfetchcontent.js +17 -0
  120. package/esm/models/anthropicwebfetchtoolresult.d.ts +15 -0
  121. package/esm/models/anthropicwebfetchtoolresult.js +24 -0
  122. package/esm/models/anthropicwebfetchtoolresulterror.d.ts +25 -0
  123. package/esm/models/anthropicwebfetchtoolresulterror.js +33 -0
  124. package/esm/models/anthropicwebsearchresult.d.ts +21 -0
  125. package/esm/models/anthropicwebsearchresult.js +29 -0
  126. package/esm/models/anthropicwebsearchtoolresult.d.ts +20 -0
  127. package/esm/models/anthropicwebsearchtoolresult.js +36 -0
  128. package/esm/models/anthropicwebsearchtoolresulterror.d.ts +29 -0
  129. package/esm/models/anthropicwebsearchtoolresulterror.js +37 -0
  130. package/esm/models/batchdeletedobject.d.ts +26 -0
  131. package/esm/models/batchdeletedobject.js +22 -0
  132. package/esm/models/batchdeletionoutcome.d.ts +17 -0
  133. package/esm/models/batchdeletionoutcome.js +16 -0
  134. package/esm/models/batchdeletiontargets.d.ts +50 -0
  135. package/esm/models/batchdeletiontargets.js +32 -0
  136. package/esm/models/batcherrorresponse.d.ts +11 -0
  137. package/esm/models/batcherrorresponse.js +15 -0
  138. package/esm/models/batchlistitem.d.ts +181 -0
  139. package/esm/models/batchlistitem.js +159 -0
  140. package/esm/models/batchlistresponse.d.ts +25 -0
  141. package/esm/models/batchlistresponse.js +31 -0
  142. package/esm/models/batchliststatus.d.ts +20 -0
  143. package/esm/models/batchliststatus.js +19 -0
  144. package/esm/models/batchlisttimestamp.d.ts +12 -0
  145. package/esm/models/batchlisttimestamp.js +15 -0
  146. package/esm/models/batchobject.d.ts +750 -0
  147. package/esm/models/batchobject.js +810 -0
  148. package/esm/models/batchpaymentrequiredresponseerror.d.ts +159 -0
  149. package/esm/models/batchpaymentrequiredresponseerror.js +136 -0
  150. package/esm/models/batchproviderpreferences.d.ts +25 -0
  151. package/esm/models/batchproviderpreferences.js +20 -0
  152. package/esm/models/batchsubmitbody.d.ts +62 -0
  153. package/esm/models/batchsubmitbody.js +51 -0
  154. package/esm/models/debugevent.d.ts +12 -12
  155. package/esm/models/debugevent.js +11 -12
  156. package/esm/models/errors/batcherrorresponse.d.ts +19 -0
  157. package/esm/models/errors/batcherrorresponse.js +32 -0
  158. package/esm/models/errors/batchpaymentrequiredresponseerror.d.ts +53 -0
  159. package/esm/models/errors/batchpaymentrequiredresponseerror.js +64 -0
  160. package/esm/models/errors/index.d.ts +2 -0
  161. package/esm/models/errors/index.js +2 -0
  162. package/esm/models/finishreason.d.ts +13 -0
  163. package/esm/models/finishreason.js +15 -0
  164. package/esm/models/imagegenerationusage.d.ts +4 -4
  165. package/esm/models/imagegenerationusage.js +4 -6
  166. package/esm/models/index.d.ts +75 -0
  167. package/esm/models/index.js +75 -0
  168. package/esm/models/internchatchoice.d.ts +4 -4
  169. package/esm/models/internchatchoice.js +3 -3
  170. package/esm/models/messagesmessageparam.d.ts +8 -8
  171. package/esm/models/messagesmessageparam.js +6 -7
  172. package/esm/models/operations/createbatches.d.ts +59 -0
  173. package/esm/models/operations/createbatches.js +23 -0
  174. package/esm/models/operations/deletebatch.d.ts +58 -0
  175. package/esm/models/operations/deletebatch.js +21 -0
  176. package/esm/models/operations/getbatches.d.ts +58 -0
  177. package/esm/models/operations/getbatches.js +21 -0
  178. package/esm/models/operations/index.d.ts +4 -0
  179. package/esm/models/operations/index.js +4 -0
  180. package/esm/models/operations/listbatches.d.ts +87 -0
  181. package/esm/models/operations/listbatches.js +40 -0
  182. package/esm/models/oranthropicbashtoolresult.d.ts +43 -0
  183. package/esm/models/oranthropicbashtoolresult.js +49 -0
  184. package/esm/models/oranthropiccontentblock.d.ts +25 -0
  185. package/esm/models/oranthropiccontentblock.js +45 -0
  186. package/esm/models/oranthropicnullablecaller.d.ts +12 -0
  187. package/esm/models/oranthropicnullablecaller.js +19 -0
  188. package/esm/models/oranthropicservertooluseblock.d.ts +15 -0
  189. package/esm/models/oranthropicservertooluseblock.js +19 -0
  190. package/esm/models/oranthropicshelltoolresult.d.ts +43 -0
  191. package/esm/models/oranthropicshelltoolresult.js +50 -0
  192. package/esm/models/oranthropicstopreason.d.ts +16 -0
  193. package/esm/models/oranthropicstopreason.js +18 -0
  194. package/esm/models/outputfusionservertoolitem.d.ts +8 -8
  195. package/esm/models/outputfusionservertoolitem.js +8 -8
  196. package/esm/models/submitgenerationfeedbackrequest.d.ts +4 -4
  197. package/esm/models/submitgenerationfeedbackrequest.js +3 -4
  198. package/esm/sdk/batch.d.ts +37 -0
  199. package/esm/sdk/batch.js +50 -0
  200. package/esm/sdk/sdk.d.ts +3 -0
  201. package/esm/sdk/sdk.js +4 -0
  202. package/jsr.json +1 -1
  203. package/package.json +6 -6
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 6dab967e4db6
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { ORAnthropicNullableCaller$inboundSchema, } from "./oranthropicnullablecaller.js";
8
+ /** @internal */
9
+ export const ORAnthropicServerToolUseBlock$inboundSchema = z.object({
10
+ caller: z.nullable(ORAnthropicNullableCaller$inboundSchema).optional(),
11
+ id: z.string(),
12
+ input: z.any().optional(),
13
+ name: z.string(),
14
+ type: z.literal("server_tool_use"),
15
+ });
16
+ export function orAnthropicServerToolUseBlockFromJSON(jsonString) {
17
+ return safeParse(jsonString, (x) => ORAnthropicServerToolUseBlock$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ORAnthropicServerToolUseBlock' from JSON`);
18
+ }
19
+ //# sourceMappingURL=oranthropicservertooluseblock.js.map
@@ -0,0 +1,43 @@
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
+ export declare const ORAnthropicShellToolResultTypeContainerFileCitation: {
6
+ readonly ContainerFileCitation: "container_file_citation";
7
+ };
8
+ export type ORAnthropicShellToolResultTypeContainerFileCitation = ClosedEnum<typeof ORAnthropicShellToolResultTypeContainerFileCitation>;
9
+ export type ORAnthropicShellToolResultFile = {
10
+ containerId: string;
11
+ endIndex: number;
12
+ fileId: string;
13
+ filename: string;
14
+ startIndex: number;
15
+ type: ORAnthropicShellToolResultTypeContainerFileCitation;
16
+ };
17
+ /**
18
+ * Output of an `openrouter:shell` call executed in the OpenRouter sandbox
19
+ */
20
+ export type ORAnthropicShellToolResult = {
21
+ /**
22
+ * The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.
23
+ */
24
+ containerId?: string | undefined;
25
+ content: {
26
+ [k: string]: any;
27
+ };
28
+ /**
29
+ * Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.
30
+ */
31
+ files?: Array<ORAnthropicShellToolResultFile> | undefined;
32
+ toolUseId: string;
33
+ type: "openrouter_shell_tool_result";
34
+ };
35
+ /** @internal */
36
+ export declare const ORAnthropicShellToolResultTypeContainerFileCitation$inboundSchema: z.ZodEnum<typeof ORAnthropicShellToolResultTypeContainerFileCitation>;
37
+ /** @internal */
38
+ export declare const ORAnthropicShellToolResultFile$inboundSchema: z.ZodType<ORAnthropicShellToolResultFile, unknown>;
39
+ export declare function orAnthropicShellToolResultFileFromJSON(jsonString: string): SafeParseResult<ORAnthropicShellToolResultFile, SDKValidationError>;
40
+ /** @internal */
41
+ export declare const ORAnthropicShellToolResult$inboundSchema: z.ZodType<ORAnthropicShellToolResult, unknown>;
42
+ export declare function orAnthropicShellToolResultFromJSON(jsonString: string): SafeParseResult<ORAnthropicShellToolResult, SDKValidationError>;
43
+ //# sourceMappingURL=oranthropicshelltoolresult.d.ts.map
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 6c0f19243a3e
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
+ export const ORAnthropicShellToolResultTypeContainerFileCitation = {
9
+ ContainerFileCitation: "container_file_citation",
10
+ };
11
+ /** @internal */
12
+ export const ORAnthropicShellToolResultTypeContainerFileCitation$inboundSchema = z
13
+ .enum(ORAnthropicShellToolResultTypeContainerFileCitation);
14
+ /** @internal */
15
+ export const ORAnthropicShellToolResultFile$inboundSchema = z.object({
16
+ container_id: z.string(),
17
+ end_index: z.int(),
18
+ file_id: z.string(),
19
+ filename: z.string(),
20
+ start_index: z.int(),
21
+ type: ORAnthropicShellToolResultTypeContainerFileCitation$inboundSchema,
22
+ }).transform((v) => {
23
+ return remap$(v, {
24
+ "container_id": "containerId",
25
+ "end_index": "endIndex",
26
+ "file_id": "fileId",
27
+ "start_index": "startIndex",
28
+ });
29
+ });
30
+ export function orAnthropicShellToolResultFileFromJSON(jsonString) {
31
+ return safeParse(jsonString, (x) => ORAnthropicShellToolResultFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ORAnthropicShellToolResultFile' from JSON`);
32
+ }
33
+ /** @internal */
34
+ export const ORAnthropicShellToolResult$inboundSchema = z.object({
35
+ container_id: z.string().optional(),
36
+ content: z.record(z.string(), z.any()),
37
+ files: z.array(z.lazy(() => ORAnthropicShellToolResultFile$inboundSchema))
38
+ .optional(),
39
+ tool_use_id: z.string(),
40
+ type: z.literal("openrouter_shell_tool_result"),
41
+ }).transform((v) => {
42
+ return remap$(v, {
43
+ "container_id": "containerId",
44
+ "tool_use_id": "toolUseId",
45
+ });
46
+ });
47
+ export function orAnthropicShellToolResultFromJSON(jsonString) {
48
+ return safeParse(jsonString, (x) => ORAnthropicShellToolResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ORAnthropicShellToolResult' from JSON`);
49
+ }
50
+ //# sourceMappingURL=oranthropicshelltoolresult.js.map
@@ -0,0 +1,16 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ export declare const ORAnthropicStopReason: {
4
+ readonly EndTurn: "end_turn";
5
+ readonly MaxTokens: "max_tokens";
6
+ readonly ModelContextWindowExceeded: "model_context_window_exceeded";
7
+ readonly StopSequence: "stop_sequence";
8
+ readonly ToolUse: "tool_use";
9
+ readonly PauseTurn: "pause_turn";
10
+ readonly Refusal: "refusal";
11
+ readonly Compaction: "compaction";
12
+ };
13
+ export type ORAnthropicStopReason = OpenEnum<typeof ORAnthropicStopReason>;
14
+ /** @internal */
15
+ export declare const ORAnthropicStopReason$inboundSchema: z.ZodType<ORAnthropicStopReason, unknown>;
16
+ //# sourceMappingURL=oranthropicstopreason.d.ts.map
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 2f8990149810
4
+ */
5
+ import * as openEnums from "../types/enums.js";
6
+ export const ORAnthropicStopReason = {
7
+ EndTurn: "end_turn",
8
+ MaxTokens: "max_tokens",
9
+ ModelContextWindowExceeded: "model_context_window_exceeded",
10
+ StopSequence: "stop_sequence",
11
+ ToolUse: "tool_use",
12
+ PauseTurn: "pause_turn",
13
+ Refusal: "refusal",
14
+ Compaction: "compaction",
15
+ };
16
+ /** @internal */
17
+ export const ORAnthropicStopReason$inboundSchema = openEnums.inboundSchema(ORAnthropicStopReason);
18
+ //# sourceMappingURL=oranthropicstopreason.js.map
@@ -19,7 +19,7 @@ export type FailedModel = {
19
19
  */
20
20
  statusCode?: number | undefined;
21
21
  };
22
- export type ResponseT = {
22
+ export type OutputFusionServerToolItemResponse = {
23
23
  content?: string | undefined;
24
24
  model: string;
25
25
  };
@@ -51,7 +51,7 @@ export type OutputFusionServerToolItem = {
51
51
  /**
52
52
  * Analysis models that produced a response in this fusion run, with each model's full panel content.
53
53
  */
54
- responses?: Array<ResponseT> | undefined;
54
+ responses?: Array<OutputFusionServerToolItemResponse> | undefined;
55
55
  /**
56
56
  * Web pages the analysis panels and analyst retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source.
57
57
  */
@@ -72,16 +72,16 @@ export declare const FailedModel$outboundSchema: z.ZodType<FailedModel$Outbound,
72
72
  export declare function failedModelToJSON(failedModel: FailedModel): string;
73
73
  export declare function failedModelFromJSON(jsonString: string): SafeParseResult<FailedModel, SDKValidationError>;
74
74
  /** @internal */
75
- export declare const ResponseT$inboundSchema: z.ZodType<ResponseT, unknown>;
75
+ export declare const OutputFusionServerToolItemResponse$inboundSchema: z.ZodType<OutputFusionServerToolItemResponse, unknown>;
76
76
  /** @internal */
77
- export type ResponseT$Outbound = {
77
+ export type OutputFusionServerToolItemResponse$Outbound = {
78
78
  content?: string | undefined;
79
79
  model: string;
80
80
  };
81
81
  /** @internal */
82
- export declare const ResponseT$outboundSchema: z.ZodType<ResponseT$Outbound, ResponseT>;
83
- export declare function responseToJSON(responseT: ResponseT): string;
84
- export declare function responseFromJSON(jsonString: string): SafeParseResult<ResponseT, SDKValidationError>;
82
+ export declare const OutputFusionServerToolItemResponse$outboundSchema: z.ZodType<OutputFusionServerToolItemResponse$Outbound, OutputFusionServerToolItemResponse>;
83
+ export declare function outputFusionServerToolItemResponseToJSON(outputFusionServerToolItemResponse: OutputFusionServerToolItemResponse): string;
84
+ export declare function outputFusionServerToolItemResponseFromJSON(jsonString: string): SafeParseResult<OutputFusionServerToolItemResponse, SDKValidationError>;
85
85
  /** @internal */
86
86
  export declare const OutputFusionServerToolItemType$inboundSchema: z.ZodEnum<typeof OutputFusionServerToolItemType>;
87
87
  /** @internal */
@@ -95,7 +95,7 @@ export type OutputFusionServerToolItem$Outbound = {
95
95
  failed_models?: Array<FailedModel$Outbound> | undefined;
96
96
  failure_reason?: string | undefined;
97
97
  id?: string | undefined;
98
- responses?: Array<ResponseT$Outbound> | undefined;
98
+ responses?: Array<OutputFusionServerToolItemResponse$Outbound> | undefined;
99
99
  sources?: Array<FusionSource$Outbound> | undefined;
100
100
  status: string;
101
101
  type: string;
@@ -39,20 +39,20 @@ export function failedModelFromJSON(jsonString) {
39
39
  return safeParse(jsonString, (x) => FailedModel$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FailedModel' from JSON`);
40
40
  }
41
41
  /** @internal */
42
- export const ResponseT$inboundSchema = z.object({
42
+ export const OutputFusionServerToolItemResponse$inboundSchema = z.object({
43
43
  content: z.string().optional(),
44
44
  model: z.string(),
45
45
  });
46
46
  /** @internal */
47
- export const ResponseT$outboundSchema = z.object({
47
+ export const OutputFusionServerToolItemResponse$outboundSchema = z.object({
48
48
  content: z.string().optional(),
49
49
  model: z.string(),
50
50
  });
51
- export function responseToJSON(responseT) {
52
- return JSON.stringify(ResponseT$outboundSchema.parse(responseT));
51
+ export function outputFusionServerToolItemResponseToJSON(outputFusionServerToolItemResponse) {
52
+ return JSON.stringify(OutputFusionServerToolItemResponse$outboundSchema.parse(outputFusionServerToolItemResponse));
53
53
  }
54
- export function responseFromJSON(jsonString) {
55
- return safeParse(jsonString, (x) => ResponseT$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseT' from JSON`);
54
+ export function outputFusionServerToolItemResponseFromJSON(jsonString) {
55
+ return safeParse(jsonString, (x) => OutputFusionServerToolItemResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputFusionServerToolItemResponse' from JSON`);
56
56
  }
57
57
  /** @internal */
58
58
  export const OutputFusionServerToolItemType$inboundSchema = z.enum(OutputFusionServerToolItemType);
@@ -65,7 +65,7 @@ export const OutputFusionServerToolItem$inboundSchema = z.object({
65
65
  failed_models: z.array(z.lazy(() => FailedModel$inboundSchema)).optional(),
66
66
  failure_reason: z.string().optional(),
67
67
  id: z.string().optional(),
68
- responses: z.array(z.lazy(() => ResponseT$inboundSchema)).optional(),
68
+ responses: z.array(z.lazy(() => OutputFusionServerToolItemResponse$inboundSchema)).optional(),
69
69
  sources: z.array(FusionSource$inboundSchema).optional(),
70
70
  status: ToolCallStatus$inboundSchema,
71
71
  type: OutputFusionServerToolItemType$inboundSchema,
@@ -82,7 +82,7 @@ export const OutputFusionServerToolItem$outboundSchema = z.object({
82
82
  failedModels: z.array(z.lazy(() => FailedModel$outboundSchema)).optional(),
83
83
  failureReason: z.string().optional(),
84
84
  id: z.string().optional(),
85
- responses: z.array(z.lazy(() => ResponseT$outboundSchema)).optional(),
85
+ responses: z.array(z.lazy(() => OutputFusionServerToolItemResponse$outboundSchema)).optional(),
86
86
  sources: z.array(FusionSource$outboundSchema).optional(),
87
87
  status: ToolCallStatus$outboundSchema,
88
88
  type: OutputFusionServerToolItemType$outboundSchema,
@@ -3,7 +3,7 @@ import { OpenEnum } from "../types/enums.js";
3
3
  /**
4
4
  * The category of feedback being reported
5
5
  */
6
- export declare const Category: {
6
+ export declare const SubmitGenerationFeedbackRequestCategory: {
7
7
  readonly Latency: "latency";
8
8
  readonly Incoherence: "incoherence";
9
9
  readonly IncorrectResponse: "incorrect_response";
@@ -15,7 +15,7 @@ export declare const Category: {
15
15
  /**
16
16
  * The category of feedback being reported
17
17
  */
18
- export type Category = OpenEnum<typeof Category>;
18
+ export type SubmitGenerationFeedbackRequestCategory = OpenEnum<typeof SubmitGenerationFeedbackRequestCategory>;
19
19
  /**
20
20
  * Structured feedback about a specific generation
21
21
  */
@@ -23,7 +23,7 @@ export type SubmitGenerationFeedbackRequest = {
23
23
  /**
24
24
  * The category of feedback being reported
25
25
  */
26
- category: Category;
26
+ category: SubmitGenerationFeedbackRequestCategory;
27
27
  /**
28
28
  * An optional free-text comment describing the feedback
29
29
  */
@@ -34,7 +34,7 @@ export type SubmitGenerationFeedbackRequest = {
34
34
  generationId: string;
35
35
  };
36
36
  /** @internal */
37
- export declare const Category$outboundSchema: z.ZodType<string, Category>;
37
+ export declare const SubmitGenerationFeedbackRequestCategory$outboundSchema: z.ZodType<string, SubmitGenerationFeedbackRequestCategory>;
38
38
  /** @internal */
39
39
  export type SubmitGenerationFeedbackRequest$Outbound = {
40
40
  category: string;
@@ -8,7 +8,7 @@ import * as openEnums from "../types/enums.js";
8
8
  /**
9
9
  * The category of feedback being reported
10
10
  */
11
- export const Category = {
11
+ export const SubmitGenerationFeedbackRequestCategory = {
12
12
  Latency: "latency",
13
13
  Incoherence: "incoherence",
14
14
  IncorrectResponse: "incorrect_response",
@@ -18,11 +18,10 @@ export const Category = {
18
18
  Other: "other",
19
19
  };
20
20
  /** @internal */
21
- export const Category$outboundSchema = openEnums
22
- .outboundSchema(Category);
21
+ export const SubmitGenerationFeedbackRequestCategory$outboundSchema = openEnums.outboundSchema(SubmitGenerationFeedbackRequestCategory);
23
22
  /** @internal */
24
23
  export const SubmitGenerationFeedbackRequest$outboundSchema = z.object({
25
- category: Category$outboundSchema,
24
+ category: SubmitGenerationFeedbackRequestCategory$outboundSchema,
26
25
  comment: z.string().optional(),
27
26
  generationId: z.string(),
28
27
  }).transform((v) => {
@@ -0,0 +1,37 @@
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
+ import { PageIterator } from "../types/operations.js";
5
+ export declare class Batch extends ClientSDK {
6
+ /**
7
+ * List batches
8
+ *
9
+ * @remarks
10
+ * Lists batches in the workspace of the authenticating API key, newest first. To fetch the next page, pass the previous page's `last_id` as `after`. List items omit `results`. Use `GET /batches/{id}` to get them. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).
11
+ */
12
+ list(request?: operations.ListBatchesRequest | undefined, options?: RequestOptions): Promise<PageIterator<operations.ListBatchesResponse, {
13
+ cursor: string;
14
+ }>>;
15
+ /**
16
+ * Create a batch
17
+ *
18
+ * @remarks
19
+ * Creates a batch of requests that run asynchronously against a single endpoint (`/v1/chat/completions`, `/v1/responses`, `/v1/messages`, `/v1/embeddings`). Returns `202` with `status: "validating"`. Poll `GET /batches/{id}` for progress and results. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).
20
+ */
21
+ createBatches(request: operations.CreateBatchesRequest, options?: RequestOptions): Promise<models.BatchObject>;
22
+ /**
23
+ * Delete a batch
24
+ *
25
+ * @remarks
26
+ * Deletes a batch in a terminal status (`completed`, `failed`, `expired`, or `cancelled`) and its stored requests and results. Batches still in progress return `409`. Billing and usage records are kept. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).
27
+ */
28
+ delete(request: operations.DeleteBatchRequest, options?: RequestOptions): Promise<models.BatchDeletedObject>;
29
+ /**
30
+ * Get a batch
31
+ *
32
+ * @remarks
33
+ * Returns a batch with its status and request counts. Batches in a terminal status include `results`. Failed batches report the reason in `error.message`. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).
34
+ */
35
+ getBatches(request: operations.GetBatchesRequest, options?: RequestOptions): Promise<models.BatchObject>;
36
+ }
37
+ //# sourceMappingURL=batch.d.ts.map
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 254a218f7d6b
4
+ */
5
+ import { batchCreateBatches } from "../funcs/batchCreateBatches.js";
6
+ import { batchDelete } from "../funcs/batchDelete.js";
7
+ import { batchGetBatches } from "../funcs/batchGetBatches.js";
8
+ import { batchList } from "../funcs/batchList.js";
9
+ import { ClientSDK } from "../lib/sdks.js";
10
+ import { unwrapAsync } from "../types/fp.js";
11
+ import { unwrapResultIterator } from "../types/operations.js";
12
+ export class Batch extends ClientSDK {
13
+ /**
14
+ * List batches
15
+ *
16
+ * @remarks
17
+ * Lists batches in the workspace of the authenticating API key, newest first. To fetch the next page, pass the previous page's `last_id` as `after`. List items omit `results`. Use `GET /batches/{id}` to get them. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).
18
+ */
19
+ async list(request, options) {
20
+ return unwrapResultIterator(batchList(this, request, options));
21
+ }
22
+ /**
23
+ * Create a batch
24
+ *
25
+ * @remarks
26
+ * Creates a batch of requests that run asynchronously against a single endpoint (`/v1/chat/completions`, `/v1/responses`, `/v1/messages`, `/v1/embeddings`). Returns `202` with `status: "validating"`. Poll `GET /batches/{id}` for progress and results. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).
27
+ */
28
+ async createBatches(request, options) {
29
+ return unwrapAsync(batchCreateBatches(this, request, options));
30
+ }
31
+ /**
32
+ * Delete a batch
33
+ *
34
+ * @remarks
35
+ * Deletes a batch in a terminal status (`completed`, `failed`, `expired`, or `cancelled`) and its stored requests and results. Batches still in progress return `409`. Billing and usage records are kept. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).
36
+ */
37
+ async delete(request, options) {
38
+ return unwrapAsync(batchDelete(this, request, options));
39
+ }
40
+ /**
41
+ * Get a batch
42
+ *
43
+ * @remarks
44
+ * Returns a batch with its status and request counts. Batches in a terminal status include `results`. Failed batches report the reason in `error.message`. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).
45
+ */
46
+ async getBatches(request, options) {
47
+ return unwrapAsync(batchGetBatches(this, request, options));
48
+ }
49
+ }
50
+ //# sourceMappingURL=batch.js.map
package/esm/sdk/sdk.d.ts CHANGED
@@ -2,6 +2,7 @@ import { ClientSDK } from "../lib/sdks.js";
2
2
  import { Alpha } from "./alpha.js";
3
3
  import { Analytics } from "./analytics.js";
4
4
  import { APIKeys } from "./apikeys.js";
5
+ import { Batch } from "./batch.js";
5
6
  import { Benchmarks } from "./benchmarks.js";
6
7
  import { Beta } from "./beta.js";
7
8
  import { BYOK } from "./byok.js";
@@ -49,6 +50,8 @@ export declare class OpenRouter extends ClientSDK {
49
50
  get stt(): STT;
50
51
  private _oAuth?;
51
52
  get oAuth(): OAuth;
53
+ private _batch?;
54
+ get batch(): Batch;
52
55
  private _benchmarks?;
53
56
  get benchmarks(): Benchmarks;
54
57
  private _byok?;
package/esm/sdk/sdk.js CHANGED
@@ -6,6 +6,7 @@ import { ClientSDK } from "../lib/sdks.js";
6
6
  import { Alpha } from "./alpha.js";
7
7
  import { Analytics } from "./analytics.js";
8
8
  import { APIKeys } from "./apikeys.js";
9
+ import { Batch } from "./batch.js";
9
10
  import { Benchmarks } from "./benchmarks.js";
10
11
  import { Beta } from "./beta.js";
11
12
  import { BYOK } from "./byok.js";
@@ -56,6 +57,9 @@ export class OpenRouter extends ClientSDK {
56
57
  get oAuth() {
57
58
  return (this._oAuth ?? (this._oAuth = new OAuth(this._options)));
58
59
  }
60
+ get batch() {
61
+ return (this._batch ?? (this._batch = new Batch(this._options)));
62
+ }
59
63
  get benchmarks() {
60
64
  return (this._benchmarks ?? (this._benchmarks = new Benchmarks(this._options)));
61
65
  }
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.3.29",
5
+ "version": "1.3.30",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "1.3.29",
3
+ "version": "1.3.30",
4
4
  "author": "OpenRouter",
5
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": [
@@ -73,15 +73,15 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
- "prepare": "npm run build",
76
+ "typecheck:transit": "exit 0",
77
+ "compile": "tsc && node scripts/unbarrel-imports.js",
78
+ "postinstall": "node scripts/check-types.js || true",
77
79
  "test:e2e": "vitest --run --project e2e",
78
80
  "test:transit": "exit 0",
79
81
  "test:watch": "vitest --watch --project unit",
80
- "typecheck:transit": "exit 0",
81
- "test": "vitest --run --project unit",
82
82
  "typecheck": "tsc --noEmit",
83
- "compile": "tsc && node scripts/unbarrel-imports.js",
84
- "postinstall": "node scripts/check-types.js || true"
83
+ "prepare": "npm run build",
84
+ "test": "vitest --run --project unit"
85
85
  },
86
86
  "peerDependencies": {
87
87