@openrouter/sdk 0.13.23 → 0.13.25

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.
package/README.md CHANGED
@@ -169,9 +169,11 @@ const openRouter = new OpenRouter({
169
169
  });
170
170
 
171
171
  async function run() {
172
- const result = await openRouter.files.upload({
172
+ const result = await openRouter.stt.createTranscriptionMultipart({
173
173
  requestBody: {
174
174
  file: await openAsBlob("example.file"),
175
+ language: "en",
176
+ model: "openai/whisper-large-v3",
175
177
  },
176
178
  });
177
179
 
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
13
13
  * Create transcription
14
14
  *
15
15
  * @remarks
16
- * Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text.
16
+ * Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
17
17
  */
18
18
  export declare function sttCreateTranscription(client: OpenRouterCore, request: operations.CreateAudioTranscriptionsRequest, options?: RequestOptions): APIPromise<Result<models.STTResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.NotFoundResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
19
  //# sourceMappingURL=sttCreateTranscription.d.ts.map
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
17
17
  * Create transcription
18
18
  *
19
19
  * @remarks
20
- * Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text.
20
+ * Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
21
21
  */
22
22
  export function sttCreateTranscription(client, request, options) {
23
23
  return new APIPromise($do(client, request, options));
@@ -0,0 +1,19 @@
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
+ * Create transcription
14
+ *
15
+ * @remarks
16
+ * Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
17
+ */
18
+ export declare function sttCreateTranscriptionMultipart(client: OpenRouterCore, request: operations.CreateAudioTranscriptionsMultipartRequest, options?: RequestOptions): APIPromise<Result<models.STTResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.NotFoundResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
+ //# sourceMappingURL=sttCreateTranscriptionMultipart.d.ts.map
@@ -0,0 +1,127 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: ec09b43036c3
4
+ */
5
+ import { appendForm, encodeSimple, normalizeBlob } from "../lib/encodings.js";
6
+ import { bytesToBlob, getContentTypeFromFileName, readableStreamToArrayBuffer, } from "../lib/files.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as errors from "../models/errors/index.js";
14
+ import * as models from "../models/index.js";
15
+ import * as operations from "../models/operations/index.js";
16
+ import { APIPromise } from "../types/async.js";
17
+ import { isBlobLike } from "../types/blobs.js";
18
+ import { isReadableStream } from "../types/streams.js";
19
+ /**
20
+ * Create transcription
21
+ *
22
+ * @remarks
23
+ * Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
24
+ */
25
+ export function sttCreateTranscriptionMultipart(client, request, options) {
26
+ return new APIPromise($do(client, request, options));
27
+ }
28
+ async function $do(client, request, options) {
29
+ const parsed = safeParse(request, (value) => operations.CreateAudioTranscriptionsMultipartRequest$outboundSchema.parse(value), "Input validation failed");
30
+ if (!parsed.ok) {
31
+ return [parsed, { status: "invalid" }];
32
+ }
33
+ const payload = parsed.value;
34
+ const body = new FormData();
35
+ if (isBlobLike(payload.RequestBody.file)) {
36
+ const file = payload.RequestBody.file;
37
+ const blob = await normalizeBlob(file);
38
+ const name = "name" in file ? file.name : undefined;
39
+ appendForm(body, "file", blob, name);
40
+ }
41
+ else if (isReadableStream(payload.RequestBody.file.content)) {
42
+ const buffer = await readableStreamToArrayBuffer(payload.RequestBody.file.content);
43
+ const contentType = getContentTypeFromFileName(payload.RequestBody.file.fileName)
44
+ || "application/octet-stream";
45
+ appendForm(body, "file", bytesToBlob(buffer, contentType), payload.RequestBody.file.fileName);
46
+ }
47
+ else {
48
+ const contentType = getContentTypeFromFileName(payload.RequestBody.file.fileName)
49
+ || "application/octet-stream";
50
+ appendForm(body, "file", bytesToBlob(payload.RequestBody.file.content, contentType), payload.RequestBody.file.fileName);
51
+ }
52
+ appendForm(body, "model", payload.RequestBody.model);
53
+ if (payload.RequestBody.language !== undefined) {
54
+ appendForm(body, "language", payload.RequestBody.language);
55
+ }
56
+ if (payload.RequestBody.response_format !== undefined) {
57
+ appendForm(body, "response_format", payload.RequestBody.response_format);
58
+ }
59
+ if (payload.RequestBody.temperature !== undefined) {
60
+ appendForm(body, "temperature", payload.RequestBody.temperature);
61
+ }
62
+ const path = pathToFunc("/audio/transcriptions")();
63
+ const headers = new Headers(compactMap({
64
+ Accept: "application/json",
65
+ "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
66
+ "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
67
+ "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
68
+ }));
69
+ const secConfig = await extractSecurity(client._options.apiKey);
70
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
71
+ const requestSecurity = resolveGlobalSecurity(securityInput);
72
+ const context = {
73
+ options: client._options,
74
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
75
+ operationID: "createAudioTranscriptions_multipart",
76
+ oAuth2Scopes: null,
77
+ resolvedSecurity: requestSecurity,
78
+ securitySource: client._options.apiKey,
79
+ retryConfig: options?.retries
80
+ || client._options.retryConfig
81
+ || {
82
+ strategy: "backoff",
83
+ backoff: {
84
+ initialInterval: 500,
85
+ maxInterval: 60000,
86
+ exponent: 1.5,
87
+ maxElapsedTime: 3600000,
88
+ },
89
+ retryConnectionErrors: true,
90
+ }
91
+ || { strategy: "none" },
92
+ retryCodes: options?.retryCodes || ["5XX"],
93
+ };
94
+ const requestRes = client._createRequest(context, {
95
+ security: requestSecurity,
96
+ method: "POST",
97
+ baseURL: options?.serverURL,
98
+ path: path,
99
+ headers: headers,
100
+ body: body,
101
+ userAgent: client._options.userAgent,
102
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
103
+ }, options);
104
+ if (!requestRes.ok) {
105
+ return [requestRes, { status: "invalid" }];
106
+ }
107
+ const req = requestRes.value;
108
+ const doResult = await client._do(req, {
109
+ context,
110
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
111
+ retryConfig: context.retryConfig,
112
+ retryCodes: context.retryCodes,
113
+ });
114
+ if (!doResult.ok) {
115
+ return [doResult, { status: "request-error", request: req }];
116
+ }
117
+ const response = doResult.value;
118
+ const responseFields = {
119
+ HttpMeta: { Response: response, Request: req },
120
+ };
121
+ const [result] = await M.match(M.json(200, models.STTResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(402, errors.PaymentRequiredResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.jsonErr(524, errors.EdgeNetworkTimeoutResponseError$inboundSchema), M.jsonErr(529, errors.ProviderOverloadedResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
122
+ if (!result.ok) {
123
+ return [result, { status: "complete", request: req, response }];
124
+ }
125
+ return [result, { status: "complete", request: req, response }];
126
+ }
127
+ //# sourceMappingURL=sttCreateTranscriptionMultipart.js.map
@@ -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.13.23";
52
+ readonly sdkVersion: "0.13.25";
53
53
  readonly genVersion: "2.884.4";
54
- readonly userAgent: "speakeasy-sdk/typescript 0.13.23 2.884.4 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 0.13.25 2.884.4 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.13.23",
29
+ sdkVersion: "0.13.25",
30
30
  genVersion: "2.884.4",
31
- userAgent: "speakeasy-sdk/typescript 0.13.23 2.884.4 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 0.13.25 2.884.4 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -507,7 +507,7 @@ export type ImageGenerationRequest = {
507
507
  */
508
508
  seed?: number | undefined;
509
509
  /**
510
- * Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected.
510
+ * Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400.
511
511
  */
512
512
  size?: string | undefined;
513
513
  /**
@@ -347,6 +347,7 @@ export * from "./outputcustomtoolcallitem.js";
347
347
  export * from "./outputdatetimeitem.js";
348
348
  export * from "./outputfilesearchcallitem.js";
349
349
  export * from "./outputfilesearchservertoolitem.js";
350
+ export * from "./outputfilesservertoolitem.js";
350
351
  export * from "./outputfunctioncallitem.js";
351
352
  export * from "./outputfusionservertoolitem.js";
352
353
  export * from "./outputimagegenerationcallitem.js";
@@ -351,6 +351,7 @@ export * from "./outputcustomtoolcallitem.js";
351
351
  export * from "./outputdatetimeitem.js";
352
352
  export * from "./outputfilesearchcallitem.js";
353
353
  export * from "./outputfilesearchservertoolitem.js";
354
+ export * from "./outputfilesservertoolitem.js";
354
355
  export * from "./outputfunctioncallitem.js";
355
356
  export * from "./outputfusionservertoolitem.js";
356
357
  export * from "./outputimagegenerationcallitem.js";
@@ -28,6 +28,7 @@ import { OutputCustomToolCallItem, OutputCustomToolCallItem$Outbound } from "./o
28
28
  import { OutputDatetimeItem, OutputDatetimeItem$Outbound } from "./outputdatetimeitem.js";
29
29
  import { OutputFileSearchCallItem, OutputFileSearchCallItem$Outbound } from "./outputfilesearchcallitem.js";
30
30
  import { OutputFileSearchServerToolItem, OutputFileSearchServerToolItem$Outbound } from "./outputfilesearchservertoolitem.js";
31
+ import { OutputFilesServerToolItem, OutputFilesServerToolItem$Outbound } from "./outputfilesservertoolitem.js";
31
32
  import { OutputFunctionCallItem, OutputFunctionCallItem$Outbound } from "./outputfunctioncallitem.js";
32
33
  import { OutputFusionServerToolItem, OutputFusionServerToolItem$Outbound } from "./outputfusionservertoolitem.js";
33
34
  import { OutputImageGenerationCallItem, OutputImageGenerationCallItem$Outbound } from "./outputimagegenerationcallitem.js";
@@ -130,11 +131,11 @@ export type InputsMessage = {
130
131
  status?: InputsStatusCompleted1 | InputsStatusIncomplete1 | InputsStatusInProgress1 | undefined;
131
132
  type: InputsTypeMessage;
132
133
  };
133
- export type InputsUnion1 = OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | InputsMessage | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem;
134
+ export type InputsUnion1 = OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | InputsMessage | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem;
134
135
  /**
135
136
  * Input for a response request - can be a string or array of items
136
137
  */
137
- export type InputsUnion = string | Array<OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | InputsMessage | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem>;
138
+ export type InputsUnion = string | Array<OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | InputsMessage | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem>;
138
139
  /** @internal */
139
140
  export declare const InputsStatusInProgress2$outboundSchema: z.ZodEnum<typeof InputsStatusInProgress2>;
140
141
  /** @internal */
@@ -209,12 +210,12 @@ export type InputsMessage$Outbound = {
209
210
  export declare const InputsMessage$outboundSchema: z.ZodType<InputsMessage$Outbound, InputsMessage>;
210
211
  export declare function inputsMessageToJSON(inputsMessage: InputsMessage): string;
211
212
  /** @internal */
212
- export type InputsUnion1$Outbound = OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$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 | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound;
213
+ export type InputsUnion1$Outbound = OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$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 | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound;
213
214
  /** @internal */
214
215
  export declare const InputsUnion1$outboundSchema: z.ZodType<InputsUnion1$Outbound, InputsUnion1>;
215
216
  export declare function inputsUnion1ToJSON(inputsUnion1: InputsUnion1): string;
216
217
  /** @internal */
217
- export type InputsUnion$Outbound = string | Array<OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$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 | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound>;
218
+ export type InputsUnion$Outbound = string | Array<OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$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 | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound>;
218
219
  /** @internal */
219
220
  export declare const InputsUnion$outboundSchema: z.ZodType<InputsUnion$Outbound, InputsUnion>;
220
221
  export declare function inputsUnionToJSON(inputsUnion: InputsUnion): string;
@@ -32,6 +32,7 @@ import { OutputCustomToolCallItem$outboundSchema, } from "./outputcustomtoolcall
32
32
  import { OutputDatetimeItem$outboundSchema, } from "./outputdatetimeitem.js";
33
33
  import { OutputFileSearchCallItem$outboundSchema, } from "./outputfilesearchcallitem.js";
34
34
  import { OutputFileSearchServerToolItem$outboundSchema, } from "./outputfilesearchservertoolitem.js";
35
+ import { OutputFilesServerToolItem$outboundSchema, } from "./outputfilesservertoolitem.js";
35
36
  import { OutputFunctionCallItem$outboundSchema, } from "./outputfunctioncallitem.js";
36
37
  import { OutputFusionServerToolItem$outboundSchema, } from "./outputfusionservertoolitem.js";
37
38
  import { OutputImageGenerationCallItem$outboundSchema, } from "./outputimagegenerationcallitem.js";
@@ -246,6 +247,7 @@ export const InputsUnion1$outboundSchema = z.union([
246
247
  OutputFusionServerToolItem$outboundSchema,
247
248
  OutputAdvisorServerToolItem$outboundSchema,
248
249
  OutputSubagentServerToolItem$outboundSchema,
250
+ OutputFilesServerToolItem$outboundSchema,
249
251
  CompactionItem$outboundSchema,
250
252
  ItemReferenceItem$outboundSchema,
251
253
  EasyInputMessage$outboundSchema,
@@ -299,6 +301,7 @@ export const InputsUnion$outboundSchema = z.union([
299
301
  OutputFusionServerToolItem$outboundSchema,
300
302
  OutputAdvisorServerToolItem$outboundSchema,
301
303
  OutputSubagentServerToolItem$outboundSchema,
304
+ OutputFilesServerToolItem$outboundSchema,
302
305
  CompactionItem$outboundSchema,
303
306
  ItemReferenceItem$outboundSchema,
304
307
  EasyInputMessage$outboundSchema,
@@ -0,0 +1,113 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../../types/enums.js";
3
+ export type CreateAudioTranscriptionsMultipartGlobals = {
4
+ /**
5
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
6
+ *
7
+ * @remarks
8
+ * This is used to track API usage per application.
9
+ */
10
+ httpReferer?: string | undefined;
11
+ /**
12
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
13
+ *
14
+ * @remarks
15
+ */
16
+ appTitle?: string | undefined;
17
+ /**
18
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
19
+ *
20
+ * @remarks
21
+ */
22
+ appCategories?: string | undefined;
23
+ };
24
+ export type CreateAudioTranscriptionsMultipartFile = {
25
+ fileName: string;
26
+ content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
27
+ };
28
+ /**
29
+ * The response format. Only "json" is supported.
30
+ */
31
+ export declare const ResponseFormat: {
32
+ readonly Json: "json";
33
+ };
34
+ /**
35
+ * The response format. Only "json" is supported.
36
+ */
37
+ export type ResponseFormat = ClosedEnum<typeof ResponseFormat>;
38
+ export type CreateAudioTranscriptionsMultipartRequestBody = {
39
+ /**
40
+ * The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio.
41
+ */
42
+ file: CreateAudioTranscriptionsMultipartFile | Blob;
43
+ /**
44
+ * The language of the input audio (ISO-639-1).
45
+ */
46
+ language?: string | undefined;
47
+ /**
48
+ * The model to use for transcription.
49
+ */
50
+ model: string;
51
+ /**
52
+ * The response format. Only "json" is supported.
53
+ */
54
+ responseFormat?: ResponseFormat | undefined;
55
+ /**
56
+ * The sampling temperature.
57
+ */
58
+ temperature?: number | undefined;
59
+ };
60
+ export type CreateAudioTranscriptionsMultipartRequest = {
61
+ /**
62
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
63
+ *
64
+ * @remarks
65
+ * This is used to track API usage per application.
66
+ */
67
+ httpReferer?: string | undefined;
68
+ /**
69
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
70
+ *
71
+ * @remarks
72
+ */
73
+ appTitle?: string | undefined;
74
+ /**
75
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
76
+ *
77
+ * @remarks
78
+ */
79
+ appCategories?: string | undefined;
80
+ requestBody: CreateAudioTranscriptionsMultipartRequestBody;
81
+ };
82
+ /** @internal */
83
+ export type CreateAudioTranscriptionsMultipartFile$Outbound = {
84
+ fileName: string;
85
+ content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
86
+ };
87
+ /** @internal */
88
+ export declare const CreateAudioTranscriptionsMultipartFile$outboundSchema: z.ZodType<CreateAudioTranscriptionsMultipartFile$Outbound, CreateAudioTranscriptionsMultipartFile>;
89
+ export declare function createAudioTranscriptionsMultipartFileToJSON(createAudioTranscriptionsMultipartFile: CreateAudioTranscriptionsMultipartFile): string;
90
+ /** @internal */
91
+ export declare const ResponseFormat$outboundSchema: z.ZodEnum<typeof ResponseFormat>;
92
+ /** @internal */
93
+ export type CreateAudioTranscriptionsMultipartRequestBody$Outbound = {
94
+ file: CreateAudioTranscriptionsMultipartFile$Outbound | Blob;
95
+ language?: string | undefined;
96
+ model: string;
97
+ response_format?: string | undefined;
98
+ temperature?: number | undefined;
99
+ };
100
+ /** @internal */
101
+ export declare const CreateAudioTranscriptionsMultipartRequestBody$outboundSchema: z.ZodType<CreateAudioTranscriptionsMultipartRequestBody$Outbound, CreateAudioTranscriptionsMultipartRequestBody>;
102
+ export declare function createAudioTranscriptionsMultipartRequestBodyToJSON(createAudioTranscriptionsMultipartRequestBody: CreateAudioTranscriptionsMultipartRequestBody): string;
103
+ /** @internal */
104
+ export type CreateAudioTranscriptionsMultipartRequest$Outbound = {
105
+ "HTTP-Referer"?: string | undefined;
106
+ appTitle?: string | undefined;
107
+ appCategories?: string | undefined;
108
+ RequestBody: CreateAudioTranscriptionsMultipartRequestBody$Outbound;
109
+ };
110
+ /** @internal */
111
+ export declare const CreateAudioTranscriptionsMultipartRequest$outboundSchema: z.ZodType<CreateAudioTranscriptionsMultipartRequest$Outbound, CreateAudioTranscriptionsMultipartRequest>;
112
+ export declare function createAudioTranscriptionsMultipartRequestToJSON(createAudioTranscriptionsMultipartRequest: CreateAudioTranscriptionsMultipartRequest): string;
113
+ //# sourceMappingURL=createaudiotranscriptionsmultipart.d.ts.map
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 29a4e7468387
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { blobLikeSchema } from "../../types/blobs.js";
8
+ /**
9
+ * The response format. Only "json" is supported.
10
+ */
11
+ export const ResponseFormat = {
12
+ Json: "json",
13
+ };
14
+ /** @internal */
15
+ export const CreateAudioTranscriptionsMultipartFile$outboundSchema = z.object({
16
+ fileName: z.string(),
17
+ content: z.union([
18
+ z.custom(x => x instanceof ReadableStream),
19
+ z.custom(x => x instanceof Blob),
20
+ z.custom(x => x instanceof ArrayBuffer),
21
+ z.custom(x => x instanceof Uint8Array),
22
+ ]),
23
+ });
24
+ export function createAudioTranscriptionsMultipartFileToJSON(createAudioTranscriptionsMultipartFile) {
25
+ return JSON.stringify(CreateAudioTranscriptionsMultipartFile$outboundSchema.parse(createAudioTranscriptionsMultipartFile));
26
+ }
27
+ /** @internal */
28
+ export const ResponseFormat$outboundSchema = z
29
+ .enum(ResponseFormat);
30
+ /** @internal */
31
+ export const CreateAudioTranscriptionsMultipartRequestBody$outboundSchema = z.object({
32
+ file: z.lazy(() => CreateAudioTranscriptionsMultipartFile$outboundSchema)
33
+ .or(blobLikeSchema),
34
+ language: z.string().optional(),
35
+ model: z.string(),
36
+ responseFormat: ResponseFormat$outboundSchema.optional(),
37
+ temperature: z.number().optional(),
38
+ }).transform((v) => {
39
+ return remap$(v, {
40
+ responseFormat: "response_format",
41
+ });
42
+ });
43
+ export function createAudioTranscriptionsMultipartRequestBodyToJSON(createAudioTranscriptionsMultipartRequestBody) {
44
+ return JSON.stringify(CreateAudioTranscriptionsMultipartRequestBody$outboundSchema.parse(createAudioTranscriptionsMultipartRequestBody));
45
+ }
46
+ /** @internal */
47
+ export const CreateAudioTranscriptionsMultipartRequest$outboundSchema = z.object({
48
+ httpReferer: z.string().optional(),
49
+ appTitle: z.string().optional(),
50
+ appCategories: z.string().optional(),
51
+ requestBody: z.lazy(() => CreateAudioTranscriptionsMultipartRequestBody$outboundSchema),
52
+ }).transform((v) => {
53
+ return remap$(v, {
54
+ httpReferer: "HTTP-Referer",
55
+ requestBody: "RequestBody",
56
+ });
57
+ });
58
+ export function createAudioTranscriptionsMultipartRequestToJSON(createAudioTranscriptionsMultipartRequest) {
59
+ return JSON.stringify(CreateAudioTranscriptionsMultipartRequest$outboundSchema.parse(createAudioTranscriptionsMultipartRequest));
60
+ }
61
+ //# sourceMappingURL=createaudiotranscriptionsmultipart.js.map
@@ -6,6 +6,7 @@ export * from "./bulkunassignkeysfromguardrail.js";
6
6
  export * from "./bulkunassignmembersfromguardrail.js";
7
7
  export * from "./createaudiospeech.js";
8
8
  export * from "./createaudiotranscriptions.js";
9
+ export * from "./createaudiotranscriptionsmultipart.js";
9
10
  export * from "./createauthkeyscode.js";
10
11
  export * from "./createbyokkey.js";
11
12
  export * from "./createembeddings.js";
@@ -10,6 +10,7 @@ export * from "./bulkunassignkeysfromguardrail.js";
10
10
  export * from "./bulkunassignmembersfromguardrail.js";
11
11
  export * from "./createaudiospeech.js";
12
12
  export * from "./createaudiotranscriptions.js";
13
+ export * from "./createaudiotranscriptionsmultipart.js";
13
14
  export * from "./createauthkeyscode.js";
14
15
  export * from "./createbyokkey.js";
15
16
  export * from "./createembeddings.js";
@@ -20,12 +20,12 @@ export type UploadFileGlobals = {
20
20
  */
21
21
  appCategories?: string | undefined;
22
22
  };
23
- export type FileT = {
23
+ export type UploadFileFile = {
24
24
  fileName: string;
25
25
  content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
26
26
  };
27
27
  export type UploadFileRequestBody = {
28
- file: FileT | Blob;
28
+ file: UploadFileFile | Blob;
29
29
  };
30
30
  export type UploadFileRequest = {
31
31
  /**
@@ -54,16 +54,16 @@ export type UploadFileRequest = {
54
54
  requestBody: UploadFileRequestBody;
55
55
  };
56
56
  /** @internal */
57
- export type FileT$Outbound = {
57
+ export type UploadFileFile$Outbound = {
58
58
  fileName: string;
59
59
  content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
60
60
  };
61
61
  /** @internal */
62
- export declare const FileT$outboundSchema: z.ZodType<FileT$Outbound, FileT>;
63
- export declare function fileToJSON(fileT: FileT): string;
62
+ export declare const UploadFileFile$outboundSchema: z.ZodType<UploadFileFile$Outbound, UploadFileFile>;
63
+ export declare function uploadFileFileToJSON(uploadFileFile: UploadFileFile): string;
64
64
  /** @internal */
65
65
  export type UploadFileRequestBody$Outbound = {
66
- file: FileT$Outbound | Blob;
66
+ file: UploadFileFile$Outbound | Blob;
67
67
  };
68
68
  /** @internal */
69
69
  export declare const UploadFileRequestBody$outboundSchema: z.ZodType<UploadFileRequestBody$Outbound, UploadFileRequestBody>;
@@ -6,7 +6,7 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { blobLikeSchema } from "../../types/blobs.js";
8
8
  /** @internal */
9
- export const FileT$outboundSchema = z.object({
9
+ export const UploadFileFile$outboundSchema = z.object({
10
10
  fileName: z.string(),
11
11
  content: z.union([
12
12
  z.custom(x => x instanceof ReadableStream),
@@ -15,12 +15,12 @@ export const FileT$outboundSchema = z.object({
15
15
  z.custom(x => x instanceof Uint8Array),
16
16
  ]),
17
17
  });
18
- export function fileToJSON(fileT) {
19
- return JSON.stringify(FileT$outboundSchema.parse(fileT));
18
+ export function uploadFileFileToJSON(uploadFileFile) {
19
+ return JSON.stringify(UploadFileFile$outboundSchema.parse(uploadFileFile));
20
20
  }
21
21
  /** @internal */
22
22
  export const UploadFileRequestBody$outboundSchema = z.object({
23
- file: z.lazy(() => FileT$outboundSchema).or(blobLikeSchema),
23
+ file: z.lazy(() => UploadFileFile$outboundSchema).or(blobLikeSchema),
24
24
  });
25
25
  export function uploadFileRequestBodyToJSON(uploadFileRequestBody) {
26
26
  return JSON.stringify(UploadFileRequestBody$outboundSchema.parse(uploadFileRequestBody));
@@ -0,0 +1,59 @@
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
+ import { ToolCallStatus } from "./toolcallstatus.js";
6
+ export declare const OutputFilesServerToolItemType: {
7
+ readonly OpenrouterFiles: "openrouter:files";
8
+ };
9
+ export type OutputFilesServerToolItemType = ClosedEnum<typeof OutputFilesServerToolItemType>;
10
+ /**
11
+ * An openrouter:files server tool output item
12
+ */
13
+ export type OutputFilesServerToolItem = {
14
+ /**
15
+ * Error message when the file operation failed.
16
+ */
17
+ error?: string | undefined;
18
+ /**
19
+ * The target file id supplied in the tool-call arguments.
20
+ */
21
+ fileId?: string | undefined;
22
+ /**
23
+ * The target filename supplied in the tool-call arguments.
24
+ */
25
+ filename?: string | undefined;
26
+ id?: string | undefined;
27
+ /**
28
+ * The file operation performed (list, read, write, or edit).
29
+ */
30
+ operation?: string | undefined;
31
+ /**
32
+ * JSON-serialized result of the file operation.
33
+ */
34
+ result?: string | undefined;
35
+ status: ToolCallStatus;
36
+ type: OutputFilesServerToolItemType;
37
+ };
38
+ /** @internal */
39
+ export declare const OutputFilesServerToolItemType$inboundSchema: z.ZodEnum<typeof OutputFilesServerToolItemType>;
40
+ /** @internal */
41
+ export declare const OutputFilesServerToolItemType$outboundSchema: z.ZodEnum<typeof OutputFilesServerToolItemType>;
42
+ /** @internal */
43
+ export declare const OutputFilesServerToolItem$inboundSchema: z.ZodType<OutputFilesServerToolItem, unknown>;
44
+ /** @internal */
45
+ export type OutputFilesServerToolItem$Outbound = {
46
+ error?: string | undefined;
47
+ file_id?: string | undefined;
48
+ filename?: string | undefined;
49
+ id?: string | undefined;
50
+ operation?: string | undefined;
51
+ result?: string | undefined;
52
+ status: string;
53
+ type: string;
54
+ };
55
+ /** @internal */
56
+ export declare const OutputFilesServerToolItem$outboundSchema: z.ZodType<OutputFilesServerToolItem$Outbound, OutputFilesServerToolItem>;
57
+ export declare function outputFilesServerToolItemToJSON(outputFilesServerToolItem: OutputFilesServerToolItem): string;
58
+ export declare function outputFilesServerToolItemFromJSON(jsonString: string): SafeParseResult<OutputFilesServerToolItem, SDKValidationError>;
59
+ //# sourceMappingURL=outputfilesservertoolitem.d.ts.map
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 66f4fffdcaca
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 { ToolCallStatus$inboundSchema, ToolCallStatus$outboundSchema, } from "./toolcallstatus.js";
9
+ export const OutputFilesServerToolItemType = {
10
+ OpenrouterFiles: "openrouter:files",
11
+ };
12
+ /** @internal */
13
+ export const OutputFilesServerToolItemType$inboundSchema = z.enum(OutputFilesServerToolItemType);
14
+ /** @internal */
15
+ export const OutputFilesServerToolItemType$outboundSchema = OutputFilesServerToolItemType$inboundSchema;
16
+ /** @internal */
17
+ export const OutputFilesServerToolItem$inboundSchema = z.object({
18
+ error: z.string().optional(),
19
+ file_id: z.string().optional(),
20
+ filename: z.string().optional(),
21
+ id: z.string().optional(),
22
+ operation: z.string().optional(),
23
+ result: z.string().optional(),
24
+ status: ToolCallStatus$inboundSchema,
25
+ type: OutputFilesServerToolItemType$inboundSchema,
26
+ }).transform((v) => {
27
+ return remap$(v, {
28
+ "file_id": "fileId",
29
+ });
30
+ });
31
+ /** @internal */
32
+ export const OutputFilesServerToolItem$outboundSchema = z.object({
33
+ error: z.string().optional(),
34
+ fileId: z.string().optional(),
35
+ filename: z.string().optional(),
36
+ id: z.string().optional(),
37
+ operation: z.string().optional(),
38
+ result: z.string().optional(),
39
+ status: ToolCallStatus$outboundSchema,
40
+ type: OutputFilesServerToolItemType$outboundSchema,
41
+ }).transform((v) => {
42
+ return remap$(v, {
43
+ fileId: "file_id",
44
+ });
45
+ });
46
+ export function outputFilesServerToolItemToJSON(outputFilesServerToolItem) {
47
+ return JSON.stringify(OutputFilesServerToolItem$outboundSchema.parse(outputFilesServerToolItem));
48
+ }
49
+ export function outputFilesServerToolItemFromJSON(jsonString) {
50
+ return safeParse(jsonString, (x) => OutputFilesServerToolItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputFilesServerToolItem' from JSON`);
51
+ }
52
+ //# sourceMappingURL=outputfilesservertoolitem.js.map
@@ -14,6 +14,7 @@ import { OutputCustomToolCallItem } from "./outputcustomtoolcallitem.js";
14
14
  import { OutputDatetimeItem } from "./outputdatetimeitem.js";
15
15
  import { OutputFileSearchCallItem } from "./outputfilesearchcallitem.js";
16
16
  import { OutputFileSearchServerToolItem } from "./outputfilesearchservertoolitem.js";
17
+ import { OutputFilesServerToolItem } from "./outputfilesservertoolitem.js";
17
18
  import { OutputFunctionCallItem } from "./outputfunctioncallitem.js";
18
19
  import { OutputFusionServerToolItem } from "./outputfusionservertoolitem.js";
19
20
  import { OutputImageGenerationCallItem } from "./outputimagegenerationcallitem.js";
@@ -62,6 +63,8 @@ export type OutputItems = OutputApplyPatchCallItem | (OutputCodeInterpreterCallI
62
63
  type: "openrouter:experimental__search_models";
63
64
  }) | (OutputFileSearchServerToolItem & {
64
65
  type: "openrouter:file_search";
66
+ }) | (OutputFilesServerToolItem & {
67
+ type: "openrouter:files";
65
68
  }) | (OutputFusionServerToolItem & {
66
69
  type: "openrouter:fusion";
67
70
  }) | (OutputImageGenerationServerToolItem & {
@@ -17,6 +17,7 @@ import { OutputCustomToolCallItem$inboundSchema, } from "./outputcustomtoolcalli
17
17
  import { OutputDatetimeItem$inboundSchema, } from "./outputdatetimeitem.js";
18
18
  import { OutputFileSearchCallItem$inboundSchema, } from "./outputfilesearchcallitem.js";
19
19
  import { OutputFileSearchServerToolItem$inboundSchema, } from "./outputfilesearchservertoolitem.js";
20
+ import { OutputFilesServerToolItem$inboundSchema, } from "./outputfilesservertoolitem.js";
20
21
  import { OutputFunctionCallItem$inboundSchema, } from "./outputfunctioncallitem.js";
21
22
  import { OutputFusionServerToolItem$inboundSchema, } from "./outputfusionservertoolitem.js";
22
23
  import { OutputImageGenerationCallItem$inboundSchema, } from "./outputimagegenerationcallitem.js";
@@ -55,6 +56,7 @@ export const OutputItems$inboundSchema = discriminatedUnion("type", {
55
56
  ["openrouter:experimental__search_models"]: OutputSearchModelsServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
56
57
  ["openrouter:file_search"]: OutputFileSearchServerToolItem$inboundSchema
57
58
  .and(z.object({ type: z.literal("openrouter:file_search") })),
59
+ ["openrouter:files"]: OutputFilesServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:files") })),
58
60
  ["openrouter:fusion"]: OutputFusionServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:fusion") })),
59
61
  ["openrouter:image_generation"]: OutputImageGenerationServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
60
62
  ["openrouter:mcp"]: OutputMcpServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:mcp") })),
@@ -1,4 +1,16 @@
1
1
  import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ /**
4
+ * Price source for the Pareto frontier cost axis. "prompt" uses catalog list price (endpoint.pricing.prompt). "weighted_avg" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to "prompt".
5
+ */
6
+ export declare const PriceSource: {
7
+ readonly Prompt: "prompt";
8
+ readonly WeightedAvg: "weighted_avg";
9
+ };
10
+ /**
11
+ * Price source for the Pareto frontier cost axis. "prompt" uses catalog list price (endpoint.pricing.prompt). "weighted_avg" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to "prompt".
12
+ */
13
+ export type PriceSource = OpenEnum<typeof PriceSource>;
2
14
  export type ParetoRouterPlugin = {
3
15
  /**
4
16
  * Set to false to disable the pareto-router plugin for this request. Defaults to true.
@@ -6,15 +18,22 @@ export type ParetoRouterPlugin = {
6
18
  enabled?: boolean | undefined;
7
19
  id: "pareto-router";
8
20
  /**
9
- * Minimum desired coding score between 0 and 1, where 1 is best. Higher values select from stronger coding models (sourced from Artificial Analysis coding percentiles). Maps internally to one of three tiers (low, medium, high). Omit to use the router default tier.
21
+ * Minimum coding quality score between 0 and 1. Maps to internal quality tiers: >= 0.66 high (top coding models), >= 0.33 medium (strong modern flagships), < 0.33 low (capable coders above the median). Omit to default to the highest tier (equivalent to >= 0.66).
10
22
  */
11
23
  minCodingScore?: number | undefined;
24
+ /**
25
+ * Price source for the Pareto frontier cost axis. "prompt" uses catalog list price (endpoint.pricing.prompt). "weighted_avg" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to "prompt".
26
+ */
27
+ priceSource?: PriceSource | undefined;
12
28
  };
13
29
  /** @internal */
30
+ export declare const PriceSource$outboundSchema: z.ZodType<string, PriceSource>;
31
+ /** @internal */
14
32
  export type ParetoRouterPlugin$Outbound = {
15
33
  enabled?: boolean | undefined;
16
34
  id: "pareto-router";
17
35
  min_coding_score?: number | undefined;
36
+ price_source?: string | undefined;
18
37
  };
19
38
  /** @internal */
20
39
  export declare const ParetoRouterPlugin$outboundSchema: z.ZodType<ParetoRouterPlugin$Outbound, ParetoRouterPlugin>;
@@ -4,14 +4,26 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
+ import * as openEnums from "../types/enums.js";
8
+ /**
9
+ * Price source for the Pareto frontier cost axis. "prompt" uses catalog list price (endpoint.pricing.prompt). "weighted_avg" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without traffic data. Defaults to "prompt".
10
+ */
11
+ export const PriceSource = {
12
+ Prompt: "prompt",
13
+ WeightedAvg: "weighted_avg",
14
+ };
15
+ /** @internal */
16
+ export const PriceSource$outboundSchema = openEnums.outboundSchema(PriceSource);
7
17
  /** @internal */
8
18
  export const ParetoRouterPlugin$outboundSchema = z.object({
9
19
  enabled: z.boolean().optional(),
10
20
  id: z.literal("pareto-router"),
11
21
  minCodingScore: z.number().optional(),
22
+ priceSource: PriceSource$outboundSchema.optional(),
12
23
  }).transform((v) => {
13
24
  return remap$(v, {
14
25
  minCodingScore: "min_coding_score",
26
+ priceSource: "price_source",
15
27
  });
16
28
  });
17
29
  export function paretoRouterPluginToJSON(paretoRouterPlugin) {
package/esm/sdk/stt.d.ts CHANGED
@@ -6,8 +6,15 @@ export declare class Stt extends ClientSDK {
6
6
  * Create transcription
7
7
  *
8
8
  * @remarks
9
- * Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text.
9
+ * Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
10
10
  */
11
11
  createTranscription(request: operations.CreateAudioTranscriptionsRequest, options?: RequestOptions): Promise<models.STTResponse>;
12
+ /**
13
+ * Create transcription
14
+ *
15
+ * @remarks
16
+ * Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
17
+ */
18
+ createTranscriptionMultipart(request: operations.CreateAudioTranscriptionsMultipartRequest, options?: RequestOptions): Promise<models.STTResponse>;
12
19
  }
13
20
  //# sourceMappingURL=stt.d.ts.map
package/esm/sdk/stt.js CHANGED
@@ -3,6 +3,7 @@
3
3
  * @generated-id: fd9e88c22d1f
4
4
  */
5
5
  import { sttCreateTranscription } from "../funcs/sttCreateTranscription.js";
6
+ import { sttCreateTranscriptionMultipart } from "../funcs/sttCreateTranscriptionMultipart.js";
6
7
  import { ClientSDK } from "../lib/sdks.js";
7
8
  import { unwrapAsync } from "../types/fp.js";
8
9
  export class Stt extends ClientSDK {
@@ -10,10 +11,19 @@ export class Stt extends ClientSDK {
10
11
  * Create transcription
11
12
  *
12
13
  * @remarks
13
- * Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text.
14
+ * Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
14
15
  */
15
16
  async createTranscription(request, options) {
16
17
  return unwrapAsync(sttCreateTranscription(this, request, options));
17
18
  }
19
+ /**
20
+ * Create transcription
21
+ *
22
+ * @remarks
23
+ * Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
24
+ */
25
+ async createTranscriptionMultipart(request, options) {
26
+ return unwrapAsync(sttCreateTranscriptionMultipart(this, request, options));
27
+ }
18
28
  }
19
29
  //# sourceMappingURL=stt.js.map
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.13.23",
5
+ "version": "0.13.25",
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": "0.13.23",
3
+ "version": "0.13.25",
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": [
@@ -21,8 +21,8 @@
21
21
  "license": "Apache-2.0",
22
22
  "packageManager": "pnpm@10.22.0",
23
23
  "publishConfig": {
24
- "provenance": true,
25
- "access": "public"
24
+ "access": "public",
25
+ "provenance": true
26
26
  },
27
27
  "type": "module",
28
28
  "main": "./esm/index.js",
@@ -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": "vitest --run --project unit",
77
- "postinstall": "node scripts/check-types.js || true",
78
76
  "prepare": "npm run build",
77
+ "test": "vitest --run --project unit",
79
78
  "test:e2e": "vitest --run --project e2e",
80
79
  "test:transit": "exit 0",
81
80
  "test:watch": "vitest --watch --project unit",
82
- "typecheck": "tsc --noEmit",
83
81
  "typecheck:transit": "exit 0",
84
- "compile": "tsc"
82
+ "compile": "tsc",
83
+ "postinstall": "node scripts/check-types.js || true",
84
+ "typecheck": "tsc --noEmit"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {