@openrouter/sdk 0.12.20 → 0.12.22

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 (66) hide show
  1. package/esm/lib/config.d.ts +2 -2
  2. package/esm/lib/config.js +2 -2
  3. package/esm/models/chatusage.d.ts +13 -0
  4. package/esm/models/chatusage.js +6 -0
  5. package/esm/models/costdetails.d.ts +15 -0
  6. package/esm/models/costdetails.js +24 -0
  7. package/esm/models/createworkspacerequest.d.ts +10 -0
  8. package/esm/models/createworkspacerequest.js +4 -0
  9. package/esm/models/generationresponse.d.ts +5 -0
  10. package/esm/models/generationresponse.js +3 -0
  11. package/esm/models/index.d.ts +1 -0
  12. package/esm/models/index.js +1 -0
  13. package/esm/models/inputsunion.d.ts +18 -4
  14. package/esm/models/inputsunion.js +42 -0
  15. package/esm/models/outputapplypatchservertoolitem.d.ts +21 -1
  16. package/esm/models/outputapplypatchservertoolitem.js +20 -2
  17. package/esm/models/outputbashservertoolitem.d.ts +23 -1
  18. package/esm/models/outputbashservertoolitem.js +22 -2
  19. package/esm/models/outputbrowseruseservertoolitem.d.ts +21 -1
  20. package/esm/models/outputbrowseruseservertoolitem.js +20 -2
  21. package/esm/models/outputcodeinterpretercallitem.d.ts +43 -1
  22. package/esm/models/outputcodeinterpretercallitem.js +52 -2
  23. package/esm/models/outputcodeinterpreterservertoolitem.d.ts +24 -1
  24. package/esm/models/outputcodeinterpreterservertoolitem.js +23 -2
  25. package/esm/models/outputcomputercallitem.d.ts +33 -2
  26. package/esm/models/outputcomputercallitem.js +36 -1
  27. package/esm/models/outputfilesearchservertoolitem.d.ts +20 -1
  28. package/esm/models/outputfilesearchservertoolitem.js +19 -2
  29. package/esm/models/outputimagegenerationservertoolitem.d.ts +23 -1
  30. package/esm/models/outputimagegenerationservertoolitem.js +22 -2
  31. package/esm/models/outputitems.d.ts +31 -3
  32. package/esm/models/outputitems.js +19 -14
  33. package/esm/models/outputmcpservertoolitem.d.ts +21 -1
  34. package/esm/models/outputmcpservertoolitem.js +20 -2
  35. package/esm/models/outputmemoryservertoolitem.d.ts +24 -2
  36. package/esm/models/outputmemoryservertoolitem.js +23 -2
  37. package/esm/models/outputmodality.d.ts +1 -0
  38. package/esm/models/outputmodality.js +1 -0
  39. package/esm/models/outputsearchmodelsservertoolitem.d.ts +21 -1
  40. package/esm/models/outputsearchmodelsservertoolitem.js +20 -2
  41. package/esm/models/outputtexteditorservertoolitem.d.ts +23 -2
  42. package/esm/models/outputtexteditorservertoolitem.js +23 -2
  43. package/esm/models/outputtoolsearchservertoolitem.d.ts +20 -1
  44. package/esm/models/outputtoolsearchservertoolitem.js +19 -2
  45. package/esm/models/outputwebfetchservertoolitem.d.ts +22 -1
  46. package/esm/models/outputwebfetchservertoolitem.js +21 -2
  47. package/esm/models/providername.d.ts +1 -0
  48. package/esm/models/providername.js +1 -0
  49. package/esm/models/providerresponse.d.ts +1 -0
  50. package/esm/models/providerresponse.js +1 -0
  51. package/esm/models/speechrequest.d.ts +6 -0
  52. package/esm/models/speechrequest.js +1 -0
  53. package/esm/models/updateworkspacerequest.d.ts +10 -0
  54. package/esm/models/updateworkspacerequest.js +4 -0
  55. package/esm/models/usage.d.ts +4 -4
  56. package/esm/models/usage.js +4 -5
  57. package/esm/models/videogenerationrequest.d.ts +11 -0
  58. package/esm/models/videogenerationrequest.js +3 -0
  59. package/esm/models/websearchplugin.d.ts +35 -0
  60. package/esm/models/websearchplugin.js +21 -0
  61. package/esm/models/websearchuserlocationservertool.d.ts +8 -8
  62. package/esm/models/websearchuserlocationservertool.js +4 -4
  63. package/esm/models/workspace.d.ts +8 -0
  64. package/esm/models/workspace.js +4 -0
  65. package/jsr.json +1 -1
  66. package/package.json +5 -5
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
49
49
  export declare const SDK_METADATA: {
50
50
  readonly language: "typescript";
51
51
  readonly openapiDocVersion: "1.0.0";
52
- readonly sdkVersion: "0.12.20";
52
+ readonly sdkVersion: "0.12.22";
53
53
  readonly genVersion: "2.879.1";
54
- readonly userAgent: "speakeasy-sdk/typescript 0.12.20 2.879.1 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 0.12.22 2.879.1 1.0.0 @openrouter/sdk";
55
55
  };
56
56
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
26
26
  export const SDK_METADATA = {
27
27
  language: "typescript",
28
28
  openapiDocVersion: "1.0.0",
29
- sdkVersion: "0.12.20",
29
+ sdkVersion: "0.12.22",
30
30
  genVersion: "2.879.1",
31
- userAgent: "speakeasy-sdk/typescript 0.12.20 2.879.1 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 0.12.22 2.879.1 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -1,5 +1,6 @@
1
1
  import * as z from "zod/v4";
2
2
  import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { CostDetails } from "./costdetails.js";
3
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
5
  /**
5
6
  * Detailed completion token usage
@@ -55,6 +56,18 @@ export type ChatUsage = {
55
56
  * Detailed completion token usage
56
57
  */
57
58
  completionTokensDetails?: CompletionTokensDetails | null | undefined;
59
+ /**
60
+ * Cost of the completion
61
+ */
62
+ cost?: number | null | undefined;
63
+ /**
64
+ * Breakdown of upstream inference costs
65
+ */
66
+ costDetails?: CostDetails | null | undefined;
67
+ /**
68
+ * Whether a request was made using a Bring Your Own Key configuration
69
+ */
70
+ isByok?: boolean | undefined;
58
71
  /**
59
72
  * Number of tokens in the prompt
60
73
  */
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
+ import { CostDetails$inboundSchema } from "./costdetails.js";
8
9
  /** @internal */
9
10
  export const CompletionTokensDetails$inboundSchema = z.object({
10
11
  accepted_prediction_tokens: z.nullable(z.int()).optional(),
@@ -43,6 +44,9 @@ export function promptTokensDetailsFromJSON(jsonString) {
43
44
  export const ChatUsage$inboundSchema = z.object({
44
45
  completion_tokens: z.int(),
45
46
  completion_tokens_details: z.nullable(z.lazy(() => CompletionTokensDetails$inboundSchema)).optional(),
47
+ cost: z.nullable(z.number()).optional(),
48
+ cost_details: z.nullable(CostDetails$inboundSchema).optional(),
49
+ is_byok: z.boolean().optional(),
46
50
  prompt_tokens: z.int(),
47
51
  prompt_tokens_details: z.nullable(z.lazy(() => PromptTokensDetails$inboundSchema)).optional(),
48
52
  total_tokens: z.int(),
@@ -50,6 +54,8 @@ export const ChatUsage$inboundSchema = z.object({
50
54
  return remap$(v, {
51
55
  "completion_tokens": "completionTokens",
52
56
  "completion_tokens_details": "completionTokensDetails",
57
+ "cost_details": "costDetails",
58
+ "is_byok": "isByok",
53
59
  "prompt_tokens": "promptTokens",
54
60
  "prompt_tokens_details": "promptTokensDetails",
55
61
  "total_tokens": "totalTokens",
@@ -0,0 +1,15 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ /**
5
+ * Breakdown of upstream inference costs
6
+ */
7
+ export type CostDetails = {
8
+ upstreamInferenceCompletionsCost: number;
9
+ upstreamInferenceCost?: number | null | undefined;
10
+ upstreamInferencePromptCost: number;
11
+ };
12
+ /** @internal */
13
+ export declare const CostDetails$inboundSchema: z.ZodType<CostDetails, unknown>;
14
+ export declare function costDetailsFromJSON(jsonString: string): SafeParseResult<CostDetails, SDKValidationError>;
15
+ //# sourceMappingURL=costdetails.d.ts.map
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: a9138bf3f716
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
+ /** @internal */
9
+ export const CostDetails$inboundSchema = z
10
+ .object({
11
+ upstream_inference_completions_cost: z.number(),
12
+ upstream_inference_cost: z.nullable(z.number()).optional(),
13
+ upstream_inference_prompt_cost: z.number(),
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ "upstream_inference_completions_cost": "upstreamInferenceCompletionsCost",
17
+ "upstream_inference_cost": "upstreamInferenceCost",
18
+ "upstream_inference_prompt_cost": "upstreamInferencePromptCost",
19
+ });
20
+ });
21
+ export function costDetailsFromJSON(jsonString) {
22
+ return safeParse(jsonString, (x) => CostDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CostDetails' from JSON`);
23
+ }
24
+ //# sourceMappingURL=costdetails.js.map
@@ -16,6 +16,14 @@ export type CreateWorkspaceRequest = {
16
16
  * Description of the workspace
17
17
  */
18
18
  description?: string | null | undefined;
19
+ /**
20
+ * Optional array of API key IDs to filter I/O logging
21
+ */
22
+ ioLoggingApiKeyIds?: Array<number> | null | undefined;
23
+ /**
24
+ * Sampling rate for I/O logging (0.0001-1)
25
+ */
26
+ ioLoggingSamplingRate?: number | undefined;
19
27
  /**
20
28
  * Whether data discount logging is enabled
21
29
  */
@@ -43,6 +51,8 @@ export type CreateWorkspaceRequest$Outbound = {
43
51
  default_provider_sort?: string | null | undefined;
44
52
  default_text_model?: string | null | undefined;
45
53
  description?: string | null | undefined;
54
+ io_logging_api_key_ids?: Array<number> | null | undefined;
55
+ io_logging_sampling_rate?: number | undefined;
46
56
  is_data_discount_logging_enabled?: boolean | undefined;
47
57
  is_observability_broadcast_enabled?: boolean | undefined;
48
58
  is_observability_io_logging_enabled?: boolean | undefined;
@@ -10,6 +10,8 @@ export const CreateWorkspaceRequest$outboundSchema = z.object({
10
10
  defaultProviderSort: z.nullable(z.string()).optional(),
11
11
  defaultTextModel: z.nullable(z.string()).optional(),
12
12
  description: z.nullable(z.string()).optional(),
13
+ ioLoggingApiKeyIds: z.nullable(z.array(z.int())).optional(),
14
+ ioLoggingSamplingRate: z.number().optional(),
13
15
  isDataDiscountLoggingEnabled: z.boolean().optional(),
14
16
  isObservabilityBroadcastEnabled: z.boolean().optional(),
15
17
  isObservabilityIoLoggingEnabled: z.boolean().optional(),
@@ -20,6 +22,8 @@ export const CreateWorkspaceRequest$outboundSchema = z.object({
20
22
  defaultImageModel: "default_image_model",
21
23
  defaultProviderSort: "default_provider_sort",
22
24
  defaultTextModel: "default_text_model",
25
+ ioLoggingApiKeyIds: "io_logging_api_key_ids",
26
+ ioLoggingSamplingRate: "io_logging_sampling_rate",
23
27
  isDataDiscountLoggingEnabled: "is_data_discount_logging_enabled",
24
28
  isObservabilityBroadcastEnabled: "is_observability_broadcast_enabled",
25
29
  isObservabilityIoLoggingEnabled: "is_observability_io_logging_enabled",
@@ -11,6 +11,7 @@ export declare const ApiType: {
11
11
  readonly Embeddings: "embeddings";
12
12
  readonly Rerank: "rerank";
13
13
  readonly Tts: "tts";
14
+ readonly Stt: "stt";
14
15
  readonly Video: "video";
15
16
  };
16
17
  /**
@@ -137,6 +138,10 @@ export type GenerationResponseData = {
137
138
  * Unique identifier grouping all generations from a single API request
138
139
  */
139
140
  requestId?: string | null | undefined;
141
+ /**
142
+ * If this generation was served from response cache, contains the original generation ID. Null otherwise.
143
+ */
144
+ responseCacheSourceId?: string | null | undefined;
140
145
  /**
141
146
  * Router used for the request (e.g., openrouter/auto)
142
147
  */
@@ -15,6 +15,7 @@ export const ApiType = {
15
15
  Embeddings: "embeddings",
16
16
  Rerank: "rerank",
17
17
  Tts: "tts",
18
+ Stt: "stt",
18
19
  Video: "video",
19
20
  };
20
21
  /** @internal */
@@ -51,6 +52,7 @@ export const GenerationResponseData$inboundSchema = z.object({
51
52
  provider_name: z.nullable(z.string()),
52
53
  provider_responses: z.nullable(z.array(ProviderResponse$inboundSchema)),
53
54
  request_id: z.nullable(z.string()).optional(),
55
+ response_cache_source_id: z.nullable(z.string()).optional(),
54
56
  router: z.nullable(z.string()),
55
57
  session_id: z.nullable(z.string()).optional(),
56
58
  streamed: z.nullable(z.boolean()),
@@ -88,6 +90,7 @@ export const GenerationResponseData$inboundSchema = z.object({
88
90
  "provider_name": "providerName",
89
91
  "provider_responses": "providerResponses",
90
92
  "request_id": "requestId",
93
+ "response_cache_source_id": "responseCacheSourceId",
91
94
  "session_id": "sessionId",
92
95
  "tokens_completion": "tokensCompletion",
93
96
  "tokens_prompt": "tokensPrompt",
@@ -72,6 +72,7 @@ export * from "./contentpartdoneevent.js";
72
72
  export * from "./contentpartimage.js";
73
73
  export * from "./contextcompressionengine.js";
74
74
  export * from "./contextcompressionplugin.js";
75
+ export * from "./costdetails.js";
75
76
  export * from "./createguardrailrequest.js";
76
77
  export * from "./createguardrailresponse.js";
77
78
  export * from "./createworkspacerequest.js";
@@ -76,6 +76,7 @@ export * from "./contentpartdoneevent.js";
76
76
  export * from "./contentpartimage.js";
77
77
  export * from "./contextcompressionengine.js";
78
78
  export * from "./contextcompressionplugin.js";
79
+ export * from "./costdetails.js";
79
80
  export * from "./createguardrailrequest.js";
80
81
  export * from "./createguardrailresponse.js";
81
82
  export * from "./createworkspacerequest.js";
@@ -5,10 +5,24 @@ import { FunctionCallItem, FunctionCallItem$Outbound } from "./functioncallitem.
5
5
  import { FunctionCallOutputItem, FunctionCallOutputItem$Outbound } from "./functioncalloutputitem.js";
6
6
  import { InputMessageItem, InputMessageItem$Outbound } from "./inputmessageitem.js";
7
7
  import { OpenAIResponsesRefusalContent, OpenAIResponsesRefusalContent$Outbound } from "./openairesponsesrefusalcontent.js";
8
+ import { OutputApplyPatchServerToolItem, OutputApplyPatchServerToolItem$Outbound } from "./outputapplypatchservertoolitem.js";
9
+ import { OutputBashServerToolItem, OutputBashServerToolItem$Outbound } from "./outputbashservertoolitem.js";
10
+ import { OutputBrowserUseServerToolItem, OutputBrowserUseServerToolItem$Outbound } from "./outputbrowseruseservertoolitem.js";
11
+ import { OutputCodeInterpreterCallItem, OutputCodeInterpreterCallItem$Outbound } from "./outputcodeinterpretercallitem.js";
12
+ import { OutputCodeInterpreterServerToolItem, OutputCodeInterpreterServerToolItem$Outbound } from "./outputcodeinterpreterservertoolitem.js";
13
+ import { OutputComputerCallItem, OutputComputerCallItem$Outbound } from "./outputcomputercallitem.js";
8
14
  import { OutputDatetimeItem, OutputDatetimeItem$Outbound } from "./outputdatetimeitem.js";
9
15
  import { OutputFileSearchCallItem, OutputFileSearchCallItem$Outbound } from "./outputfilesearchcallitem.js";
16
+ import { OutputFileSearchServerToolItem, OutputFileSearchServerToolItem$Outbound } from "./outputfilesearchservertoolitem.js";
10
17
  import { OutputFunctionCallItem, OutputFunctionCallItem$Outbound } from "./outputfunctioncallitem.js";
11
18
  import { OutputImageGenerationCallItem, OutputImageGenerationCallItem$Outbound } from "./outputimagegenerationcallitem.js";
19
+ import { OutputImageGenerationServerToolItem, OutputImageGenerationServerToolItem$Outbound } from "./outputimagegenerationservertoolitem.js";
20
+ import { OutputMcpServerToolItem, OutputMcpServerToolItem$Outbound } from "./outputmcpservertoolitem.js";
21
+ import { OutputMemoryServerToolItem, OutputMemoryServerToolItem$Outbound } from "./outputmemoryservertoolitem.js";
22
+ import { OutputSearchModelsServerToolItem, OutputSearchModelsServerToolItem$Outbound } from "./outputsearchmodelsservertoolitem.js";
23
+ import { OutputTextEditorServerToolItem, OutputTextEditorServerToolItem$Outbound } from "./outputtexteditorservertoolitem.js";
24
+ import { OutputToolSearchServerToolItem, OutputToolSearchServerToolItem$Outbound } from "./outputtoolsearchservertoolitem.js";
25
+ import { OutputWebFetchServerToolItem, OutputWebFetchServerToolItem$Outbound } from "./outputwebfetchservertoolitem.js";
12
26
  import { OutputWebSearchCallItem, OutputWebSearchCallItem$Outbound } from "./outputwebsearchcallitem.js";
13
27
  import { OutputWebSearchServerToolItem, OutputWebSearchServerToolItem$Outbound } from "./outputwebsearchservertoolitem.js";
14
28
  import { ReasoningFormat } from "./reasoningformat.js";
@@ -98,11 +112,11 @@ export type InputsMessage = {
98
112
  status?: InputsStatusCompleted1 | InputsStatusIncomplete1 | InputsStatusInProgress1 | undefined;
99
113
  type: InputsTypeMessage;
100
114
  };
101
- export type InputsUnion1 = FunctionCallItem | InputsMessage | OutputFunctionCallItem | OutputWebSearchCallItem | OutputFileSearchCallItem | OutputDatetimeItem | ReasoningItem | FunctionCallOutputItem | InputsReasoning | OutputImageGenerationCallItem | OutputWebSearchServerToolItem | EasyInputMessage | InputMessageItem;
115
+ export type InputsUnion1 = OutputCodeInterpreterCallItem | FunctionCallItem | InputsMessage | OutputFunctionCallItem | OutputWebSearchCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | ReasoningItem | FunctionCallOutputItem | InputsReasoning | OutputImageGenerationCallItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | EasyInputMessage | InputMessageItem;
102
116
  /**
103
117
  * Input for a response request - can be a string or array of items
104
118
  */
105
- export type InputsUnion = string | Array<FunctionCallItem | InputsMessage | OutputFunctionCallItem | OutputWebSearchCallItem | OutputFileSearchCallItem | OutputDatetimeItem | ReasoningItem | FunctionCallOutputItem | InputsReasoning | OutputImageGenerationCallItem | OutputWebSearchServerToolItem | EasyInputMessage | InputMessageItem>;
119
+ export type InputsUnion = string | Array<OutputCodeInterpreterCallItem | FunctionCallItem | InputsMessage | OutputFunctionCallItem | OutputWebSearchCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | ReasoningItem | FunctionCallOutputItem | InputsReasoning | OutputImageGenerationCallItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | EasyInputMessage | InputMessageItem>;
106
120
  /** @internal */
107
121
  export declare const InputsStatusInProgress2$outboundSchema: z.ZodEnum<typeof InputsStatusInProgress2>;
108
122
  /** @internal */
@@ -177,12 +191,12 @@ export type InputsMessage$Outbound = {
177
191
  export declare const InputsMessage$outboundSchema: z.ZodType<InputsMessage$Outbound, InputsMessage>;
178
192
  export declare function inputsMessageToJSON(inputsMessage: InputsMessage): string;
179
193
  /** @internal */
180
- export type InputsUnion1$Outbound = FunctionCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputWebSearchCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputDatetimeItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | InputsReasoning$Outbound | OutputImageGenerationCallItem$Outbound | OutputWebSearchServerToolItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound;
194
+ export type InputsUnion1$Outbound = OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputWebSearchCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | InputsReasoning$Outbound | OutputImageGenerationCallItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound;
181
195
  /** @internal */
182
196
  export declare const InputsUnion1$outboundSchema: z.ZodType<InputsUnion1$Outbound, InputsUnion1>;
183
197
  export declare function inputsUnion1ToJSON(inputsUnion1: InputsUnion1): string;
184
198
  /** @internal */
185
- export type InputsUnion$Outbound = string | Array<FunctionCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputWebSearchCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputDatetimeItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | InputsReasoning$Outbound | OutputImageGenerationCallItem$Outbound | OutputWebSearchServerToolItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound>;
199
+ export type InputsUnion$Outbound = string | Array<OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputWebSearchCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | InputsReasoning$Outbound | OutputImageGenerationCallItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound>;
186
200
  /** @internal */
187
201
  export declare const InputsUnion$outboundSchema: z.ZodType<InputsUnion$Outbound, InputsUnion>;
188
202
  export declare function inputsUnionToJSON(inputsUnion: InputsUnion): string;
@@ -9,10 +9,24 @@ import { FunctionCallItem$outboundSchema, } from "./functioncallitem.js";
9
9
  import { FunctionCallOutputItem$outboundSchema, } from "./functioncalloutputitem.js";
10
10
  import { InputMessageItem$outboundSchema, } from "./inputmessageitem.js";
11
11
  import { OpenAIResponsesRefusalContent$outboundSchema, } from "./openairesponsesrefusalcontent.js";
12
+ import { OutputApplyPatchServerToolItem$outboundSchema, } from "./outputapplypatchservertoolitem.js";
13
+ import { OutputBashServerToolItem$outboundSchema, } from "./outputbashservertoolitem.js";
14
+ import { OutputBrowserUseServerToolItem$outboundSchema, } from "./outputbrowseruseservertoolitem.js";
15
+ import { OutputCodeInterpreterCallItem$outboundSchema, } from "./outputcodeinterpretercallitem.js";
16
+ import { OutputCodeInterpreterServerToolItem$outboundSchema, } from "./outputcodeinterpreterservertoolitem.js";
17
+ import { OutputComputerCallItem$outboundSchema, } from "./outputcomputercallitem.js";
12
18
  import { OutputDatetimeItem$outboundSchema, } from "./outputdatetimeitem.js";
13
19
  import { OutputFileSearchCallItem$outboundSchema, } from "./outputfilesearchcallitem.js";
20
+ import { OutputFileSearchServerToolItem$outboundSchema, } from "./outputfilesearchservertoolitem.js";
14
21
  import { OutputFunctionCallItem$outboundSchema, } from "./outputfunctioncallitem.js";
15
22
  import { OutputImageGenerationCallItem$outboundSchema, } from "./outputimagegenerationcallitem.js";
23
+ import { OutputImageGenerationServerToolItem$outboundSchema, } from "./outputimagegenerationservertoolitem.js";
24
+ import { OutputMcpServerToolItem$outboundSchema, } from "./outputmcpservertoolitem.js";
25
+ import { OutputMemoryServerToolItem$outboundSchema, } from "./outputmemoryservertoolitem.js";
26
+ import { OutputSearchModelsServerToolItem$outboundSchema, } from "./outputsearchmodelsservertoolitem.js";
27
+ import { OutputTextEditorServerToolItem$outboundSchema, } from "./outputtexteditorservertoolitem.js";
28
+ import { OutputToolSearchServerToolItem$outboundSchema, } from "./outputtoolsearchservertoolitem.js";
29
+ import { OutputWebFetchServerToolItem$outboundSchema, } from "./outputwebfetchservertoolitem.js";
16
30
  import { OutputWebSearchCallItem$outboundSchema, } from "./outputwebsearchcallitem.js";
17
31
  import { OutputWebSearchServerToolItem$outboundSchema, } from "./outputwebsearchservertoolitem.js";
18
32
  import { ReasoningFormat$outboundSchema, } from "./reasoningformat.js";
@@ -173,17 +187,31 @@ export function inputsMessageToJSON(inputsMessage) {
173
187
  }
174
188
  /** @internal */
175
189
  export const InputsUnion1$outboundSchema = z.union([
190
+ OutputCodeInterpreterCallItem$outboundSchema,
176
191
  FunctionCallItem$outboundSchema,
177
192
  z.lazy(() => InputsMessage$outboundSchema),
178
193
  OutputFunctionCallItem$outboundSchema,
179
194
  OutputWebSearchCallItem$outboundSchema,
180
195
  OutputFileSearchCallItem$outboundSchema,
196
+ OutputComputerCallItem$outboundSchema,
181
197
  OutputDatetimeItem$outboundSchema,
182
198
  ReasoningItem$outboundSchema,
183
199
  FunctionCallOutputItem$outboundSchema,
184
200
  z.lazy(() => InputsReasoning$outboundSchema),
185
201
  OutputImageGenerationCallItem$outboundSchema,
186
202
  OutputWebSearchServerToolItem$outboundSchema,
203
+ OutputCodeInterpreterServerToolItem$outboundSchema,
204
+ OutputFileSearchServerToolItem$outboundSchema,
205
+ OutputImageGenerationServerToolItem$outboundSchema,
206
+ OutputBrowserUseServerToolItem$outboundSchema,
207
+ OutputBashServerToolItem$outboundSchema,
208
+ OutputTextEditorServerToolItem$outboundSchema,
209
+ OutputApplyPatchServerToolItem$outboundSchema,
210
+ OutputWebFetchServerToolItem$outboundSchema,
211
+ OutputToolSearchServerToolItem$outboundSchema,
212
+ OutputMemoryServerToolItem$outboundSchema,
213
+ OutputMcpServerToolItem$outboundSchema,
214
+ OutputSearchModelsServerToolItem$outboundSchema,
187
215
  EasyInputMessage$outboundSchema,
188
216
  InputMessageItem$outboundSchema,
189
217
  ]);
@@ -194,17 +222,31 @@ export function inputsUnion1ToJSON(inputsUnion1) {
194
222
  export const InputsUnion$outboundSchema = z.union([
195
223
  z.string(),
196
224
  z.array(z.union([
225
+ OutputCodeInterpreterCallItem$outboundSchema,
197
226
  FunctionCallItem$outboundSchema,
198
227
  z.lazy(() => InputsMessage$outboundSchema),
199
228
  OutputFunctionCallItem$outboundSchema,
200
229
  OutputWebSearchCallItem$outboundSchema,
201
230
  OutputFileSearchCallItem$outboundSchema,
231
+ OutputComputerCallItem$outboundSchema,
202
232
  OutputDatetimeItem$outboundSchema,
203
233
  ReasoningItem$outboundSchema,
204
234
  FunctionCallOutputItem$outboundSchema,
205
235
  z.lazy(() => InputsReasoning$outboundSchema),
206
236
  OutputImageGenerationCallItem$outboundSchema,
207
237
  OutputWebSearchServerToolItem$outboundSchema,
238
+ OutputCodeInterpreterServerToolItem$outboundSchema,
239
+ OutputFileSearchServerToolItem$outboundSchema,
240
+ OutputImageGenerationServerToolItem$outboundSchema,
241
+ OutputBrowserUseServerToolItem$outboundSchema,
242
+ OutputBashServerToolItem$outboundSchema,
243
+ OutputTextEditorServerToolItem$outboundSchema,
244
+ OutputApplyPatchServerToolItem$outboundSchema,
245
+ OutputWebFetchServerToolItem$outboundSchema,
246
+ OutputToolSearchServerToolItem$outboundSchema,
247
+ OutputMemoryServerToolItem$outboundSchema,
248
+ OutputMcpServerToolItem$outboundSchema,
249
+ OutputSearchModelsServerToolItem$outboundSchema,
208
250
  EasyInputMessage$outboundSchema,
209
251
  InputMessageItem$outboundSchema,
210
252
  ])),
@@ -1,7 +1,12 @@
1
1
  import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../types/enums.js";
2
3
  import { Result as SafeParseResult } from "../types/fp.js";
3
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
5
  import { ToolCallStatus } from "./toolcallstatus.js";
6
+ export declare const OutputApplyPatchServerToolItemType: {
7
+ readonly OpenrouterApplyPatch: "openrouter:apply_patch";
8
+ };
9
+ export type OutputApplyPatchServerToolItemType = ClosedEnum<typeof OutputApplyPatchServerToolItemType>;
5
10
  /**
6
11
  * An openrouter:apply_patch server tool output item
7
12
  */
@@ -10,9 +15,24 @@ export type OutputApplyPatchServerToolItem = {
10
15
  id?: string | undefined;
11
16
  patch?: string | undefined;
12
17
  status: ToolCallStatus;
13
- type: "openrouter:apply_patch";
18
+ type: OutputApplyPatchServerToolItemType;
14
19
  };
15
20
  /** @internal */
21
+ export declare const OutputApplyPatchServerToolItemType$inboundSchema: z.ZodEnum<typeof OutputApplyPatchServerToolItemType>;
22
+ /** @internal */
23
+ export declare const OutputApplyPatchServerToolItemType$outboundSchema: z.ZodEnum<typeof OutputApplyPatchServerToolItemType>;
24
+ /** @internal */
16
25
  export declare const OutputApplyPatchServerToolItem$inboundSchema: z.ZodType<OutputApplyPatchServerToolItem, unknown>;
26
+ /** @internal */
27
+ export type OutputApplyPatchServerToolItem$Outbound = {
28
+ filePath?: string | undefined;
29
+ id?: string | undefined;
30
+ patch?: string | undefined;
31
+ status: string;
32
+ type: string;
33
+ };
34
+ /** @internal */
35
+ export declare const OutputApplyPatchServerToolItem$outboundSchema: z.ZodType<OutputApplyPatchServerToolItem$Outbound, OutputApplyPatchServerToolItem>;
36
+ export declare function outputApplyPatchServerToolItemToJSON(outputApplyPatchServerToolItem: OutputApplyPatchServerToolItem): string;
17
37
  export declare function outputApplyPatchServerToolItemFromJSON(jsonString: string): SafeParseResult<OutputApplyPatchServerToolItem, SDKValidationError>;
18
38
  //# sourceMappingURL=outputapplypatchservertoolitem.d.ts.map
@@ -4,15 +4,33 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { safeParse } from "../lib/schemas.js";
7
- import { ToolCallStatus$inboundSchema, } from "./toolcallstatus.js";
7
+ import { ToolCallStatus$inboundSchema, ToolCallStatus$outboundSchema, } from "./toolcallstatus.js";
8
+ export const OutputApplyPatchServerToolItemType = {
9
+ OpenrouterApplyPatch: "openrouter:apply_patch",
10
+ };
11
+ /** @internal */
12
+ export const OutputApplyPatchServerToolItemType$inboundSchema = z.enum(OutputApplyPatchServerToolItemType);
13
+ /** @internal */
14
+ export const OutputApplyPatchServerToolItemType$outboundSchema = OutputApplyPatchServerToolItemType$inboundSchema;
8
15
  /** @internal */
9
16
  export const OutputApplyPatchServerToolItem$inboundSchema = z.object({
10
17
  filePath: z.string().optional(),
11
18
  id: z.string().optional(),
12
19
  patch: z.string().optional(),
13
20
  status: ToolCallStatus$inboundSchema,
14
- type: z.literal("openrouter:apply_patch"),
21
+ type: OutputApplyPatchServerToolItemType$inboundSchema,
22
+ });
23
+ /** @internal */
24
+ export const OutputApplyPatchServerToolItem$outboundSchema = z.object({
25
+ filePath: z.string().optional(),
26
+ id: z.string().optional(),
27
+ patch: z.string().optional(),
28
+ status: ToolCallStatus$outboundSchema,
29
+ type: OutputApplyPatchServerToolItemType$outboundSchema,
15
30
  });
31
+ export function outputApplyPatchServerToolItemToJSON(outputApplyPatchServerToolItem) {
32
+ return JSON.stringify(OutputApplyPatchServerToolItem$outboundSchema.parse(outputApplyPatchServerToolItem));
33
+ }
16
34
  export function outputApplyPatchServerToolItemFromJSON(jsonString) {
17
35
  return safeParse(jsonString, (x) => OutputApplyPatchServerToolItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputApplyPatchServerToolItem' from JSON`);
18
36
  }
@@ -1,7 +1,12 @@
1
1
  import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../types/enums.js";
2
3
  import { Result as SafeParseResult } from "../types/fp.js";
3
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
5
  import { ToolCallStatus } from "./toolcallstatus.js";
6
+ export declare const OutputBashServerToolItemType: {
7
+ readonly OpenrouterBash: "openrouter:bash";
8
+ };
9
+ export type OutputBashServerToolItemType = ClosedEnum<typeof OutputBashServerToolItemType>;
5
10
  /**
6
11
  * An openrouter:bash server tool output item
7
12
  */
@@ -12,9 +17,26 @@ export type OutputBashServerToolItem = {
12
17
  status: ToolCallStatus;
13
18
  stderr?: string | undefined;
14
19
  stdout?: string | undefined;
15
- type: "openrouter:bash";
20
+ type: OutputBashServerToolItemType;
16
21
  };
17
22
  /** @internal */
23
+ export declare const OutputBashServerToolItemType$inboundSchema: z.ZodEnum<typeof OutputBashServerToolItemType>;
24
+ /** @internal */
25
+ export declare const OutputBashServerToolItemType$outboundSchema: z.ZodEnum<typeof OutputBashServerToolItemType>;
26
+ /** @internal */
18
27
  export declare const OutputBashServerToolItem$inboundSchema: z.ZodType<OutputBashServerToolItem, unknown>;
28
+ /** @internal */
29
+ export type OutputBashServerToolItem$Outbound = {
30
+ command?: string | undefined;
31
+ exitCode?: number | undefined;
32
+ id?: string | undefined;
33
+ status: string;
34
+ stderr?: string | undefined;
35
+ stdout?: string | undefined;
36
+ type: string;
37
+ };
38
+ /** @internal */
39
+ export declare const OutputBashServerToolItem$outboundSchema: z.ZodType<OutputBashServerToolItem$Outbound, OutputBashServerToolItem>;
40
+ export declare function outputBashServerToolItemToJSON(outputBashServerToolItem: OutputBashServerToolItem): string;
19
41
  export declare function outputBashServerToolItemFromJSON(jsonString: string): SafeParseResult<OutputBashServerToolItem, SDKValidationError>;
20
42
  //# sourceMappingURL=outputbashservertoolitem.d.ts.map
@@ -4,7 +4,14 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { safeParse } from "../lib/schemas.js";
7
- import { ToolCallStatus$inboundSchema, } from "./toolcallstatus.js";
7
+ import { ToolCallStatus$inboundSchema, ToolCallStatus$outboundSchema, } from "./toolcallstatus.js";
8
+ export const OutputBashServerToolItemType = {
9
+ OpenrouterBash: "openrouter:bash",
10
+ };
11
+ /** @internal */
12
+ export const OutputBashServerToolItemType$inboundSchema = z.enum(OutputBashServerToolItemType);
13
+ /** @internal */
14
+ export const OutputBashServerToolItemType$outboundSchema = OutputBashServerToolItemType$inboundSchema;
8
15
  /** @internal */
9
16
  export const OutputBashServerToolItem$inboundSchema = z.object({
10
17
  command: z.string().optional(),
@@ -13,8 +20,21 @@ export const OutputBashServerToolItem$inboundSchema = z.object({
13
20
  status: ToolCallStatus$inboundSchema,
14
21
  stderr: z.string().optional(),
15
22
  stdout: z.string().optional(),
16
- type: z.literal("openrouter:bash"),
23
+ type: OutputBashServerToolItemType$inboundSchema,
24
+ });
25
+ /** @internal */
26
+ export const OutputBashServerToolItem$outboundSchema = z.object({
27
+ command: z.string().optional(),
28
+ exitCode: z.int().optional(),
29
+ id: z.string().optional(),
30
+ status: ToolCallStatus$outboundSchema,
31
+ stderr: z.string().optional(),
32
+ stdout: z.string().optional(),
33
+ type: OutputBashServerToolItemType$outboundSchema,
17
34
  });
35
+ export function outputBashServerToolItemToJSON(outputBashServerToolItem) {
36
+ return JSON.stringify(OutputBashServerToolItem$outboundSchema.parse(outputBashServerToolItem));
37
+ }
18
38
  export function outputBashServerToolItemFromJSON(jsonString) {
19
39
  return safeParse(jsonString, (x) => OutputBashServerToolItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputBashServerToolItem' from JSON`);
20
40
  }
@@ -1,7 +1,12 @@
1
1
  import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../types/enums.js";
2
3
  import { Result as SafeParseResult } from "../types/fp.js";
3
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
5
  import { ToolCallStatus } from "./toolcallstatus.js";
6
+ export declare const OutputBrowserUseServerToolItemType: {
7
+ readonly OpenrouterBrowserUse: "openrouter:browser_use";
8
+ };
9
+ export type OutputBrowserUseServerToolItemType = ClosedEnum<typeof OutputBrowserUseServerToolItemType>;
5
10
  /**
6
11
  * An openrouter:browser_use server tool output item
7
12
  */
@@ -10,9 +15,24 @@ export type OutputBrowserUseServerToolItem = {
10
15
  id?: string | undefined;
11
16
  screenshotB64?: string | undefined;
12
17
  status: ToolCallStatus;
13
- type: "openrouter:browser_use";
18
+ type: OutputBrowserUseServerToolItemType;
14
19
  };
15
20
  /** @internal */
21
+ export declare const OutputBrowserUseServerToolItemType$inboundSchema: z.ZodEnum<typeof OutputBrowserUseServerToolItemType>;
22
+ /** @internal */
23
+ export declare const OutputBrowserUseServerToolItemType$outboundSchema: z.ZodEnum<typeof OutputBrowserUseServerToolItemType>;
24
+ /** @internal */
16
25
  export declare const OutputBrowserUseServerToolItem$inboundSchema: z.ZodType<OutputBrowserUseServerToolItem, unknown>;
26
+ /** @internal */
27
+ export type OutputBrowserUseServerToolItem$Outbound = {
28
+ action?: string | undefined;
29
+ id?: string | undefined;
30
+ screenshotB64?: string | undefined;
31
+ status: string;
32
+ type: string;
33
+ };
34
+ /** @internal */
35
+ export declare const OutputBrowserUseServerToolItem$outboundSchema: z.ZodType<OutputBrowserUseServerToolItem$Outbound, OutputBrowserUseServerToolItem>;
36
+ export declare function outputBrowserUseServerToolItemToJSON(outputBrowserUseServerToolItem: OutputBrowserUseServerToolItem): string;
17
37
  export declare function outputBrowserUseServerToolItemFromJSON(jsonString: string): SafeParseResult<OutputBrowserUseServerToolItem, SDKValidationError>;
18
38
  //# sourceMappingURL=outputbrowseruseservertoolitem.d.ts.map
@@ -4,15 +4,33 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { safeParse } from "../lib/schemas.js";
7
- import { ToolCallStatus$inboundSchema, } from "./toolcallstatus.js";
7
+ import { ToolCallStatus$inboundSchema, ToolCallStatus$outboundSchema, } from "./toolcallstatus.js";
8
+ export const OutputBrowserUseServerToolItemType = {
9
+ OpenrouterBrowserUse: "openrouter:browser_use",
10
+ };
11
+ /** @internal */
12
+ export const OutputBrowserUseServerToolItemType$inboundSchema = z.enum(OutputBrowserUseServerToolItemType);
13
+ /** @internal */
14
+ export const OutputBrowserUseServerToolItemType$outboundSchema = OutputBrowserUseServerToolItemType$inboundSchema;
8
15
  /** @internal */
9
16
  export const OutputBrowserUseServerToolItem$inboundSchema = z.object({
10
17
  action: z.string().optional(),
11
18
  id: z.string().optional(),
12
19
  screenshotB64: z.string().optional(),
13
20
  status: ToolCallStatus$inboundSchema,
14
- type: z.literal("openrouter:browser_use"),
21
+ type: OutputBrowserUseServerToolItemType$inboundSchema,
22
+ });
23
+ /** @internal */
24
+ export const OutputBrowserUseServerToolItem$outboundSchema = z.object({
25
+ action: z.string().optional(),
26
+ id: z.string().optional(),
27
+ screenshotB64: z.string().optional(),
28
+ status: ToolCallStatus$outboundSchema,
29
+ type: OutputBrowserUseServerToolItemType$outboundSchema,
15
30
  });
31
+ export function outputBrowserUseServerToolItemToJSON(outputBrowserUseServerToolItem) {
32
+ return JSON.stringify(OutputBrowserUseServerToolItem$outboundSchema.parse(outputBrowserUseServerToolItem));
33
+ }
16
34
  export function outputBrowserUseServerToolItemFromJSON(jsonString) {
17
35
  return safeParse(jsonString, (x) => OutputBrowserUseServerToolItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputBrowserUseServerToolItem' from JSON`);
18
36
  }