@openrouter/sdk 0.12.17 → 0.12.19

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 (35) hide show
  1. package/esm/funcs/ttsCreateSpeech.d.ts +1 -1
  2. package/esm/funcs/ttsCreateSpeech.js +6 -6
  3. package/esm/lib/config.d.ts +2 -2
  4. package/esm/lib/config.js +2 -2
  5. package/esm/models/chatfunctiontool.d.ts +3 -2
  6. package/esm/models/chatfunctiontool.js +2 -0
  7. package/esm/models/chatrequest.d.ts +5 -4
  8. package/esm/models/chatrequest.js +3 -0
  9. package/esm/models/generationresponse.d.ts +4 -0
  10. package/esm/models/generationresponse.js +2 -0
  11. package/esm/models/index.d.ts +5 -0
  12. package/esm/models/index.js +5 -0
  13. package/esm/models/operations/createaudiospeech.d.ts +56 -0
  14. package/esm/models/operations/createaudiospeech.js +23 -0
  15. package/esm/models/operations/index.d.ts +1 -1
  16. package/esm/models/operations/index.js +1 -1
  17. package/esm/models/paretorouterplugin.d.ts +22 -0
  18. package/esm/models/paretorouterplugin.js +20 -0
  19. package/esm/models/responsesrequest.d.ts +14 -4
  20. package/esm/models/responsesrequest.js +6 -0
  21. package/esm/models/{operations/createtts.d.ts → speechrequest.d.ts} +23 -76
  22. package/esm/models/{operations/createtts.js → speechrequest.js} +18 -35
  23. package/esm/models/videogenerationrequest.d.ts +12 -12
  24. package/esm/models/videogenerationrequest.js +10 -10
  25. package/esm/models/webfetchengineenum.d.ts +19 -0
  26. package/esm/models/webfetchengineenum.js +18 -0
  27. package/esm/models/webfetchservertool.d.ts +28 -0
  28. package/esm/models/webfetchservertool.js +20 -0
  29. package/esm/models/webfetchservertoolconfig.d.ts +39 -0
  30. package/esm/models/webfetchservertoolconfig.js +26 -0
  31. package/esm/sdk/sdk.d.ts +2 -2
  32. package/esm/sdk/sdk.js +3 -3
  33. package/esm/sdk/tts.d.ts +1 -1
  34. package/jsr.json +1 -1
  35. package/package.json +6 -6
@@ -14,5 +14,5 @@ import { Result } from "../types/fp.js";
14
14
  * @remarks
15
15
  * Synthesizes audio from the input text
16
16
  */
17
- export declare function ttsCreateSpeech(client: OpenRouterCore, request: operations.CreateTtsRequest, options?: RequestOptions): APIPromise<Result<ReadableStream<Uint8Array>, 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>>;
17
+ export declare function ttsCreateSpeech(client: OpenRouterCore, request: operations.CreateAudioSpeechRequest, options?: RequestOptions): APIPromise<Result<ReadableStream<Uint8Array>, 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>>;
18
18
  //# sourceMappingURL=ttsCreateSpeech.d.ts.map
@@ -22,16 +22,16 @@ export function ttsCreateSpeech(client, request, options) {
22
22
  return new APIPromise($do(client, request, options));
23
23
  }
24
24
  async function $do(client, request, options) {
25
- const parsed = safeParse(request, (value) => operations.CreateTtsRequest$outboundSchema.parse(value), "Input validation failed");
25
+ const parsed = safeParse(request, (value) => operations.CreateAudioSpeechRequest$outboundSchema.parse(value), "Input validation failed");
26
26
  if (!parsed.ok) {
27
27
  return [parsed, { status: "invalid" }];
28
28
  }
29
29
  const payload = parsed.value;
30
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
31
- const path = pathToFunc("/tts")();
30
+ const body = encodeJSON("body", payload.SpeechRequest, { explode: true });
31
+ const path = pathToFunc("/audio/speech")();
32
32
  const headers = new Headers(compactMap({
33
33
  "Content-Type": "application/json",
34
- Accept: "application/octet-stream",
34
+ Accept: "audio/*",
35
35
  "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
36
36
  "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
37
37
  "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
@@ -42,7 +42,7 @@ async function $do(client, request, options) {
42
42
  const context = {
43
43
  options: client._options,
44
44
  baseURL: options?.serverURL ?? client._baseURL ?? "",
45
- operationID: "createTts",
45
+ operationID: "createAudioSpeech",
46
46
  oAuth2Scopes: null,
47
47
  resolvedSecurity: requestSecurity,
48
48
  securitySource: client._options.apiKey,
@@ -101,7 +101,7 @@ async function $do(client, request, options) {
101
101
  const responseFields = {
102
102
  HttpMeta: { Response: response, Request: req },
103
103
  };
104
- const [result] = await M.match(M.stream(200, z.custom(x => x instanceof ReadableStream)), 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 });
104
+ const [result] = await M.match(M.stream(200, z.custom(x => x instanceof ReadableStream), { ctype: "audio/*" }), 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 });
105
105
  if (!result.ok) {
106
106
  return [result, { status: "complete", request: req, response }];
107
107
  }
@@ -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.17";
52
+ readonly sdkVersion: "0.12.19";
53
53
  readonly genVersion: "2.879.1";
54
- readonly userAgent: "speakeasy-sdk/typescript 0.12.17 2.879.1 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 0.12.19 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.17",
29
+ sdkVersion: "0.12.19",
30
30
  genVersion: "2.879.1",
31
- userAgent: "speakeasy-sdk/typescript 0.12.17 2.879.1 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 0.12.19 2.879.1 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -6,6 +6,7 @@ import { ChatWebSearchShorthand, ChatWebSearchShorthand$Outbound } from "./chatw
6
6
  import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
7
7
  import { ImageGenerationServerToolOpenRouter, ImageGenerationServerToolOpenRouter$Outbound } from "./imagegenerationservertoolopenrouter.js";
8
8
  import { OpenRouterWebSearchServerTool, OpenRouterWebSearchServerTool$Outbound } from "./openrouterwebsearchservertool.js";
9
+ import { WebFetchServerTool, WebFetchServerTool$Outbound } from "./webfetchservertool.js";
9
10
  /**
10
11
  * Function definition for tool calling
11
12
  */
@@ -47,7 +48,7 @@ export type ChatFunctionToolFunction = {
47
48
  /**
48
49
  * Tool definition for function calling (regular function or OpenRouter built-in server tool)
49
50
  */
50
- export type ChatFunctionTool = ChatFunctionToolFunction | DatetimeServerTool | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
51
+ export type ChatFunctionTool = ChatFunctionToolFunction | DatetimeServerTool | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | WebFetchServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
51
52
  /** @internal */
52
53
  export type ChatFunctionToolFunctionFunction$Outbound = {
53
54
  description?: string | undefined;
@@ -72,7 +73,7 @@ export type ChatFunctionToolFunction$Outbound = {
72
73
  export declare const ChatFunctionToolFunction$outboundSchema: z.ZodType<ChatFunctionToolFunction$Outbound, ChatFunctionToolFunction>;
73
74
  export declare function chatFunctionToolFunctionToJSON(chatFunctionToolFunction: ChatFunctionToolFunction): string;
74
75
  /** @internal */
75
- export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
76
+ export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
76
77
  /** @internal */
77
78
  export declare const ChatFunctionTool$outboundSchema: z.ZodType<ChatFunctionTool$Outbound, ChatFunctionTool>;
78
79
  export declare function chatFunctionToolToJSON(chatFunctionTool: ChatFunctionTool): string;
@@ -10,6 +10,7 @@ import { ChatWebSearchShorthand$outboundSchema, } from "./chatwebsearchshorthand
10
10
  import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
11
11
  import { ImageGenerationServerToolOpenRouter$outboundSchema, } from "./imagegenerationservertoolopenrouter.js";
12
12
  import { OpenRouterWebSearchServerTool$outboundSchema, } from "./openrouterwebsearchservertool.js";
13
+ import { WebFetchServerTool$outboundSchema, } from "./webfetchservertool.js";
13
14
  export const ChatFunctionToolType = {
14
15
  Function: "function",
15
16
  };
@@ -44,6 +45,7 @@ export const ChatFunctionTool$outboundSchema = z.union([
44
45
  DatetimeServerTool$outboundSchema,
45
46
  ImageGenerationServerToolOpenRouter$outboundSchema,
46
47
  ChatSearchModelsServerTool$outboundSchema,
48
+ WebFetchServerTool$outboundSchema,
47
49
  OpenRouterWebSearchServerTool$outboundSchema,
48
50
  ChatWebSearchShorthand$outboundSchema,
49
51
  ]);
@@ -17,6 +17,7 @@ import { FileParserPlugin, FileParserPlugin$Outbound } from "./fileparserplugin.
17
17
  import { FormatJsonObjectConfig, FormatJsonObjectConfig$Outbound } from "./formatjsonobjectconfig.js";
18
18
  import { ImageConfig, ImageConfig$Outbound } from "./imageconfig.js";
19
19
  import { ModerationPlugin, ModerationPlugin$Outbound } from "./moderationplugin.js";
20
+ import { ParetoRouterPlugin, ParetoRouterPlugin$Outbound } from "./paretorouterplugin.js";
20
21
  import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
21
22
  import { ResponseHealingPlugin, ResponseHealingPlugin$Outbound } from "./responsehealingplugin.js";
22
23
  import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
@@ -27,7 +28,7 @@ export declare const Modality: {
27
28
  readonly Audio: "audio";
28
29
  };
29
30
  export type Modality = OpenEnum<typeof Modality>;
30
- export type ChatRequestPlugin = AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | ModerationPlugin | ResponseHealingPlugin | WebSearchPlugin;
31
+ export type ChatRequestPlugin = AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin;
31
32
  /**
32
33
  * Constrains effort on reasoning for reasoning models
33
34
  */
@@ -141,7 +142,7 @@ export type ChatRequest = {
141
142
  /**
142
143
  * Plugins you want to enable for this request, including their settings.
143
144
  */
144
- plugins?: Array<AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | ModerationPlugin | ResponseHealingPlugin | WebSearchPlugin> | undefined;
145
+ plugins?: Array<AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin> | undefined;
145
146
  /**
146
147
  * Presence penalty (-2.0 to 2.0)
147
148
  */
@@ -214,7 +215,7 @@ export type ChatRequest = {
214
215
  /** @internal */
215
216
  export declare const Modality$outboundSchema: z.ZodType<string, Modality>;
216
217
  /** @internal */
217
- export type ChatRequestPlugin$Outbound = AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound;
218
+ export type ChatRequestPlugin$Outbound = AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound;
218
219
  /** @internal */
219
220
  export declare const ChatRequestPlugin$outboundSchema: z.ZodType<ChatRequestPlugin$Outbound, ChatRequestPlugin>;
220
221
  export declare function chatRequestPluginToJSON(chatRequestPlugin: ChatRequestPlugin): string;
@@ -262,7 +263,7 @@ export type ChatRequest$Outbound = {
262
263
  model?: string | undefined;
263
264
  models?: Array<string> | undefined;
264
265
  parallel_tool_calls?: boolean | null | undefined;
265
- plugins?: Array<AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound> | undefined;
266
+ plugins?: Array<AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound> | undefined;
266
267
  presence_penalty?: number | null | undefined;
267
268
  provider?: ProviderPreferences$Outbound | null | undefined;
268
269
  reasoning?: Reasoning$Outbound | undefined;
@@ -22,6 +22,7 @@ import { FileParserPlugin$outboundSchema, } from "./fileparserplugin.js";
22
22
  import { FormatJsonObjectConfig$outboundSchema, } from "./formatjsonobjectconfig.js";
23
23
  import { ImageConfig$outboundSchema, } from "./imageconfig.js";
24
24
  import { ModerationPlugin$outboundSchema, } from "./moderationplugin.js";
25
+ import { ParetoRouterPlugin$outboundSchema, } from "./paretorouterplugin.js";
25
26
  import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
26
27
  import { ResponseHealingPlugin$outboundSchema, } from "./responsehealingplugin.js";
27
28
  import { TraceConfig$outboundSchema, } from "./traceconfig.js";
@@ -61,6 +62,7 @@ export const ChatRequestPlugin$outboundSchema = z.union([
61
62
  ContextCompressionPlugin$outboundSchema,
62
63
  FileParserPlugin$outboundSchema,
63
64
  ModerationPlugin$outboundSchema,
65
+ ParetoRouterPlugin$outboundSchema,
64
66
  ResponseHealingPlugin$outboundSchema,
65
67
  WebSearchPlugin$outboundSchema,
66
68
  ]);
@@ -122,6 +124,7 @@ export const ChatRequest$outboundSchema = z.object({
122
124
  ContextCompressionPlugin$outboundSchema,
123
125
  FileParserPlugin$outboundSchema,
124
126
  ModerationPlugin$outboundSchema,
127
+ ParetoRouterPlugin$outboundSchema,
125
128
  ResponseHealingPlugin$outboundSchema,
126
129
  WebSearchPlugin$outboundSchema,
127
130
  ])).optional(),
@@ -101,6 +101,10 @@ export type GenerationResponseData = {
101
101
  * Native reasoning tokens as reported by provider
102
102
  */
103
103
  nativeTokensReasoning: number | null;
104
+ /**
105
+ * Number of web fetches performed
106
+ */
107
+ numFetches: number | null;
104
108
  /**
105
109
  * Number of audio inputs in the prompt
106
110
  */
@@ -42,6 +42,7 @@ export const GenerationResponseData$inboundSchema = z.object({
42
42
  native_tokens_completion_images: z.nullable(z.int()),
43
43
  native_tokens_prompt: z.nullable(z.int()),
44
44
  native_tokens_reasoning: z.nullable(z.int()),
45
+ num_fetches: z.nullable(z.int()),
45
46
  num_input_audio_prompt: z.nullable(z.int()),
46
47
  num_media_completion: z.nullable(z.int()),
47
48
  num_media_prompt: z.nullable(z.int()),
@@ -79,6 +80,7 @@ export const GenerationResponseData$inboundSchema = z.object({
79
80
  "native_tokens_completion_images": "nativeTokensCompletionImages",
80
81
  "native_tokens_prompt": "nativeTokensPrompt",
81
82
  "native_tokens_reasoning": "nativeTokensReasoning",
83
+ "num_fetches": "numFetches",
82
84
  "num_input_audio_prompt": "numInputAudioPrompt",
83
85
  "num_media_completion": "numMediaCompletion",
84
86
  "num_media_prompt": "numMediaPrompt",
@@ -186,6 +186,7 @@ export * from "./outputwebfetchservertoolitem.js";
186
186
  export * from "./outputwebsearchcallitem.js";
187
187
  export * from "./outputwebsearchservertoolitem.js";
188
188
  export * from "./parameter.js";
189
+ export * from "./paretorouterplugin.js";
189
190
  export * from "./payloadtoolargeresponseerrordata.js";
190
191
  export * from "./paymentrequiredresponseerrordata.js";
191
192
  export * from "./pdfparserengine.js";
@@ -239,6 +240,7 @@ export * from "./searchqualitylevel.js";
239
240
  export * from "./security.js";
240
241
  export * from "./serviceunavailableresponseerrordata.js";
241
242
  export * from "./shellservertool.js";
243
+ export * from "./speechrequest.js";
242
244
  export * from "./storedprompttemplate.js";
243
245
  export * from "./streamevents.js";
244
246
  export * from "./streameventsresponsecompleted.js";
@@ -270,6 +272,9 @@ export * from "./videogenerationresponse.js";
270
272
  export * from "./videogenerationusage.js";
271
273
  export * from "./videomodel.js";
272
274
  export * from "./videomodelslistresponse.js";
275
+ export * from "./webfetchengineenum.js";
276
+ export * from "./webfetchservertool.js";
277
+ export * from "./webfetchservertoolconfig.js";
273
278
  export * from "./websearchcallcompletedevent.js";
274
279
  export * from "./websearchcallinprogressevent.js";
275
280
  export * from "./websearchcallsearchingevent.js";
@@ -190,6 +190,7 @@ export * from "./outputwebfetchservertoolitem.js";
190
190
  export * from "./outputwebsearchcallitem.js";
191
191
  export * from "./outputwebsearchservertoolitem.js";
192
192
  export * from "./parameter.js";
193
+ export * from "./paretorouterplugin.js";
193
194
  export * from "./payloadtoolargeresponseerrordata.js";
194
195
  export * from "./paymentrequiredresponseerrordata.js";
195
196
  export * from "./pdfparserengine.js";
@@ -243,6 +244,7 @@ export * from "./searchqualitylevel.js";
243
244
  export * from "./security.js";
244
245
  export * from "./serviceunavailableresponseerrordata.js";
245
246
  export * from "./shellservertool.js";
247
+ export * from "./speechrequest.js";
246
248
  export * from "./storedprompttemplate.js";
247
249
  export * from "./streamevents.js";
248
250
  export * from "./streameventsresponsecompleted.js";
@@ -274,6 +276,9 @@ export * from "./videogenerationresponse.js";
274
276
  export * from "./videogenerationusage.js";
275
277
  export * from "./videomodel.js";
276
278
  export * from "./videomodelslistresponse.js";
279
+ export * from "./webfetchengineenum.js";
280
+ export * from "./webfetchservertool.js";
281
+ export * from "./webfetchservertoolconfig.js";
277
282
  export * from "./websearchcallcompletedevent.js";
278
283
  export * from "./websearchcallinprogressevent.js";
279
284
  export * from "./websearchcallsearchingevent.js";
@@ -0,0 +1,56 @@
1
+ import * as z from "zod/v4";
2
+ import * as models from "../index.js";
3
+ export type CreateAudioSpeechGlobals = {
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 CreateAudioSpeechRequest = {
25
+ /**
26
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
27
+ *
28
+ * @remarks
29
+ * This is used to track API usage per application.
30
+ */
31
+ httpReferer?: string | undefined;
32
+ /**
33
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
34
+ *
35
+ * @remarks
36
+ */
37
+ appTitle?: string | undefined;
38
+ /**
39
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
40
+ *
41
+ * @remarks
42
+ */
43
+ appCategories?: string | undefined;
44
+ speechRequest: models.SpeechRequest;
45
+ };
46
+ /** @internal */
47
+ export type CreateAudioSpeechRequest$Outbound = {
48
+ "HTTP-Referer"?: string | undefined;
49
+ appTitle?: string | undefined;
50
+ appCategories?: string | undefined;
51
+ SpeechRequest: models.SpeechRequest$Outbound;
52
+ };
53
+ /** @internal */
54
+ export declare const CreateAudioSpeechRequest$outboundSchema: z.ZodType<CreateAudioSpeechRequest$Outbound, CreateAudioSpeechRequest>;
55
+ export declare function createAudioSpeechRequestToJSON(createAudioSpeechRequest: CreateAudioSpeechRequest): string;
56
+ //# sourceMappingURL=createaudiospeech.d.ts.map
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 70089adf9736
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import * as models from "../index.js";
8
+ /** @internal */
9
+ export const CreateAudioSpeechRequest$outboundSchema = z.object({
10
+ httpReferer: z.string().optional(),
11
+ appTitle: z.string().optional(),
12
+ appCategories: z.string().optional(),
13
+ speechRequest: models.SpeechRequest$outboundSchema,
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ httpReferer: "HTTP-Referer",
17
+ speechRequest: "SpeechRequest",
18
+ });
19
+ });
20
+ export function createAudioSpeechRequestToJSON(createAudioSpeechRequest) {
21
+ return JSON.stringify(CreateAudioSpeechRequest$outboundSchema.parse(createAudioSpeechRequest));
22
+ }
23
+ //# sourceMappingURL=createaudiospeech.js.map
@@ -4,13 +4,13 @@ export * from "./bulkassignmemberstoguardrail.js";
4
4
  export * from "./bulkremoveworkspacemembers.js";
5
5
  export * from "./bulkunassignkeysfromguardrail.js";
6
6
  export * from "./bulkunassignmembersfromguardrail.js";
7
+ export * from "./createaudiospeech.js";
7
8
  export * from "./createauthkeyscode.js";
8
9
  export * from "./createembeddings.js";
9
10
  export * from "./createguardrail.js";
10
11
  export * from "./createkeys.js";
11
12
  export * from "./creatererank.js";
12
13
  export * from "./createresponses.js";
13
- export * from "./createtts.js";
14
14
  export * from "./createvideos.js";
15
15
  export * from "./createworkspace.js";
16
16
  export * from "./deleteguardrail.js";
@@ -8,13 +8,13 @@ export * from "./bulkassignmemberstoguardrail.js";
8
8
  export * from "./bulkremoveworkspacemembers.js";
9
9
  export * from "./bulkunassignkeysfromguardrail.js";
10
10
  export * from "./bulkunassignmembersfromguardrail.js";
11
+ export * from "./createaudiospeech.js";
11
12
  export * from "./createauthkeyscode.js";
12
13
  export * from "./createembeddings.js";
13
14
  export * from "./createguardrail.js";
14
15
  export * from "./createkeys.js";
15
16
  export * from "./creatererank.js";
16
17
  export * from "./createresponses.js";
17
- export * from "./createtts.js";
18
18
  export * from "./createvideos.js";
19
19
  export * from "./createworkspace.js";
20
20
  export * from "./deleteguardrail.js";
@@ -0,0 +1,22 @@
1
+ import * as z from "zod/v4";
2
+ export type ParetoRouterPlugin = {
3
+ /**
4
+ * Set to false to disable the pareto-router plugin for this request. Defaults to true.
5
+ */
6
+ enabled?: boolean | undefined;
7
+ id: "pareto-router";
8
+ /**
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.
10
+ */
11
+ minCodingScore?: number | undefined;
12
+ };
13
+ /** @internal */
14
+ export type ParetoRouterPlugin$Outbound = {
15
+ enabled?: boolean | undefined;
16
+ id: "pareto-router";
17
+ min_coding_score?: number | undefined;
18
+ };
19
+ /** @internal */
20
+ export declare const ParetoRouterPlugin$outboundSchema: z.ZodType<ParetoRouterPlugin$Outbound, ParetoRouterPlugin>;
21
+ export declare function paretoRouterPluginToJSON(paretoRouterPlugin: ParetoRouterPlugin): string;
22
+ //# sourceMappingURL=paretorouterplugin.d.ts.map
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 4e557119b1dd
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ /** @internal */
8
+ export const ParetoRouterPlugin$outboundSchema = z.object({
9
+ enabled: z.boolean().optional(),
10
+ id: z.literal("pareto-router"),
11
+ minCodingScore: z.number().optional(),
12
+ }).transform((v) => {
13
+ return remap$(v, {
14
+ minCodingScore: "min_coding_score",
15
+ });
16
+ });
17
+ export function paretoRouterPluginToJSON(paretoRouterPlugin) {
18
+ return JSON.stringify(ParetoRouterPlugin$outboundSchema.parse(paretoRouterPlugin));
19
+ }
20
+ //# sourceMappingURL=paretorouterplugin.js.map
@@ -21,6 +21,7 @@ import { ModerationPlugin, ModerationPlugin$Outbound } from "./moderationplugin.
21
21
  import { OpenAIResponsesToolChoiceUnion, OpenAIResponsesToolChoiceUnion$Outbound } from "./openairesponsestoolchoiceunion.js";
22
22
  import { OpenAIResponsesTruncation } from "./openairesponsestruncation.js";
23
23
  import { OutputModalityEnum } from "./outputmodalityenum.js";
24
+ import { ParetoRouterPlugin, ParetoRouterPlugin$Outbound } from "./paretorouterplugin.js";
24
25
  import { Preview20250311WebSearchServerTool, Preview20250311WebSearchServerTool$Outbound } from "./preview20250311websearchservertool.js";
25
26
  import { PreviewWebSearchServerTool, PreviewWebSearchServerTool$Outbound } from "./previewwebsearchservertool.js";
26
27
  import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
@@ -31,10 +32,11 @@ import { ShellServerTool, ShellServerTool$Outbound } from "./shellservertool.js"
31
32
  import { StoredPromptTemplate, StoredPromptTemplate$Outbound } from "./storedprompttemplate.js";
32
33
  import { TextExtendedConfig, TextExtendedConfig$Outbound } from "./textextendedconfig.js";
33
34
  import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
35
+ import { WebFetchServerTool, WebFetchServerTool$Outbound } from "./webfetchservertool.js";
34
36
  import { WebSearchPlugin, WebSearchPlugin$Outbound } from "./websearchplugin.js";
35
37
  import { WebSearchServerTool, WebSearchServerTool$Outbound } from "./websearchservertool.js";
36
38
  import { WebSearchServerToolOpenRouter, WebSearchServerToolOpenRouter$Outbound } from "./websearchservertoolopenrouter.js";
37
- export type ResponsesRequestPlugin = AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | ModerationPlugin | ResponseHealingPlugin | WebSearchPlugin;
39
+ export type ResponsesRequestPlugin = AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin;
38
40
  export declare const ResponsesRequestServiceTier: {
39
41
  readonly Auto: "auto";
40
42
  readonly Default: "default";
@@ -61,6 +63,8 @@ export type ResponsesRequestToolUnion = ResponsesRequestToolFunction | PreviewWe
61
63
  type: "openrouter:image_generation";
62
64
  }) | (ChatSearchModelsServerTool & {
63
65
  type: "openrouter:experimental__search_models";
66
+ }) | (WebFetchServerTool & {
67
+ type: "openrouter:web_fetch";
64
68
  }) | WebSearchServerToolOpenRouter;
65
69
  /**
66
70
  * Request schema for Responses endpoint
@@ -98,7 +102,7 @@ export type ResponsesRequest = {
98
102
  /**
99
103
  * Plugins you want to enable for this request, including their settings.
100
104
  */
101
- plugins?: Array<AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | ModerationPlugin | ResponseHealingPlugin | WebSearchPlugin> | undefined;
105
+ plugins?: Array<AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin> | undefined;
102
106
  presencePenalty?: number | null | undefined;
103
107
  previousResponseId?: string | null | undefined;
104
108
  prompt?: StoredPromptTemplate | null | undefined;
@@ -131,6 +135,8 @@ export type ResponsesRequest = {
131
135
  type: "openrouter:image_generation";
132
136
  }) | (ChatSearchModelsServerTool & {
133
137
  type: "openrouter:experimental__search_models";
138
+ }) | (WebFetchServerTool & {
139
+ type: "openrouter:web_fetch";
134
140
  }) | WebSearchServerToolOpenRouter> | undefined;
135
141
  topK?: number | undefined;
136
142
  topLogprobs?: number | null | undefined;
@@ -146,7 +152,7 @@ export type ResponsesRequest = {
146
152
  user?: string | undefined;
147
153
  };
148
154
  /** @internal */
149
- export type ResponsesRequestPlugin$Outbound = AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound;
155
+ export type ResponsesRequestPlugin$Outbound = AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound;
150
156
  /** @internal */
151
157
  export declare const ResponsesRequestPlugin$outboundSchema: z.ZodType<ResponsesRequestPlugin$Outbound, ResponsesRequestPlugin>;
152
158
  export declare function responsesRequestPluginToJSON(responsesRequestPlugin: ResponsesRequestPlugin): string;
@@ -172,6 +178,8 @@ export type ResponsesRequestToolUnion$Outbound = ResponsesRequestToolFunction$Ou
172
178
  type: "openrouter:image_generation";
173
179
  }) | (ChatSearchModelsServerTool$Outbound & {
174
180
  type: "openrouter:experimental__search_models";
181
+ }) | (WebFetchServerTool$Outbound & {
182
+ type: "openrouter:web_fetch";
175
183
  }) | WebSearchServerToolOpenRouter$Outbound;
176
184
  /** @internal */
177
185
  export declare const ResponsesRequestToolUnion$outboundSchema: z.ZodType<ResponsesRequestToolUnion$Outbound, ResponsesRequestToolUnion>;
@@ -195,7 +203,7 @@ export type ResponsesRequest$Outbound = {
195
203
  model?: string | undefined;
196
204
  models?: Array<string> | undefined;
197
205
  parallel_tool_calls?: boolean | null | undefined;
198
- plugins?: Array<AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound> | undefined;
206
+ plugins?: Array<AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound> | undefined;
199
207
  presence_penalty?: number | null | undefined;
200
208
  previous_response_id?: string | null | undefined;
201
209
  prompt?: StoredPromptTemplate$Outbound | null | undefined;
@@ -216,6 +224,8 @@ export type ResponsesRequest$Outbound = {
216
224
  type: "openrouter:image_generation";
217
225
  }) | (ChatSearchModelsServerTool$Outbound & {
218
226
  type: "openrouter:experimental__search_models";
227
+ }) | (WebFetchServerTool$Outbound & {
228
+ type: "openrouter:web_fetch";
219
229
  }) | WebSearchServerToolOpenRouter$Outbound> | undefined;
220
230
  top_k?: number | undefined;
221
231
  top_logprobs?: number | null | undefined;
@@ -26,6 +26,7 @@ import { ModerationPlugin$outboundSchema, } from "./moderationplugin.js";
26
26
  import { OpenAIResponsesToolChoiceUnion$outboundSchema, } from "./openairesponsestoolchoiceunion.js";
27
27
  import { OpenAIResponsesTruncation$outboundSchema, } from "./openairesponsestruncation.js";
28
28
  import { OutputModalityEnum$outboundSchema, } from "./outputmodalityenum.js";
29
+ import { ParetoRouterPlugin$outboundSchema, } from "./paretorouterplugin.js";
29
30
  import { Preview20250311WebSearchServerTool$outboundSchema, } from "./preview20250311websearchservertool.js";
30
31
  import { PreviewWebSearchServerTool$outboundSchema, } from "./previewwebsearchservertool.js";
31
32
  import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
@@ -36,6 +37,7 @@ import { ShellServerTool$outboundSchema, } from "./shellservertool.js";
36
37
  import { StoredPromptTemplate$outboundSchema, } from "./storedprompttemplate.js";
37
38
  import { TextExtendedConfig$outboundSchema, } from "./textextendedconfig.js";
38
39
  import { TraceConfig$outboundSchema, } from "./traceconfig.js";
40
+ import { WebFetchServerTool$outboundSchema, } from "./webfetchservertool.js";
39
41
  import { WebSearchPlugin$outboundSchema, } from "./websearchplugin.js";
40
42
  import { WebSearchServerTool$outboundSchema, } from "./websearchservertool.js";
41
43
  import { WebSearchServerToolOpenRouter$outboundSchema, } from "./websearchservertoolopenrouter.js";
@@ -52,6 +54,7 @@ export const ResponsesRequestPlugin$outboundSchema = z.union([
52
54
  ContextCompressionPlugin$outboundSchema,
53
55
  FileParserPlugin$outboundSchema,
54
56
  ModerationPlugin$outboundSchema,
57
+ ParetoRouterPlugin$outboundSchema,
55
58
  ResponseHealingPlugin$outboundSchema,
56
59
  WebSearchPlugin$outboundSchema,
57
60
  ]);
@@ -90,6 +93,7 @@ export const ResponsesRequestToolUnion$outboundSchema = z.union([
90
93
  DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
91
94
  ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
92
95
  ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
96
+ WebFetchServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:web_fetch") })),
93
97
  WebSearchServerToolOpenRouter$outboundSchema,
94
98
  ]);
95
99
  export function responsesRequestToolUnionToJSON(responsesRequestToolUnion) {
@@ -115,6 +119,7 @@ export const ResponsesRequest$outboundSchema = z.object({
115
119
  ContextCompressionPlugin$outboundSchema,
116
120
  FileParserPlugin$outboundSchema,
117
121
  ModerationPlugin$outboundSchema,
122
+ ParetoRouterPlugin$outboundSchema,
118
123
  ResponseHealingPlugin$outboundSchema,
119
124
  WebSearchPlugin$outboundSchema,
120
125
  ])).optional(),
@@ -150,6 +155,7 @@ export const ResponsesRequest$outboundSchema = z.object({
150
155
  DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
151
156
  ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
152
157
  ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
158
+ WebFetchServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:web_fetch") })),
153
159
  WebSearchServerToolOpenRouter$outboundSchema,
154
160
  ])).optional(),
155
161
  topK: z.int().optional(),
@@ -1,30 +1,9 @@
1
1
  import * as z from "zod/v4";
2
- import { OpenEnum } from "../../types/enums.js";
3
- export type CreateTtsGlobals = {
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
- };
2
+ import { OpenEnum } from "../types/enums.js";
24
3
  /**
25
4
  * Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body.
26
5
  */
27
- export type Options = {
6
+ export type SpeechRequestOptions = {
28
7
  oneai?: {
29
8
  [k: string]: any | null;
30
9
  } | undefined;
@@ -350,27 +329,27 @@ export type Options = {
350
329
  /**
351
330
  * Provider-specific passthrough configuration
352
331
  */
353
- export type Provider = {
332
+ export type SpeechRequestProvider = {
354
333
  /**
355
334
  * Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body.
356
335
  */
357
- options?: Options | undefined;
336
+ options?: SpeechRequestOptions | undefined;
358
337
  };
359
338
  /**
360
339
  * Audio output format
361
340
  */
362
- export declare const ResponseFormat: {
341
+ export declare const ResponseFormatEnum: {
363
342
  readonly Mp3: "mp3";
364
343
  readonly Pcm: "pcm";
365
344
  };
366
345
  /**
367
346
  * Audio output format
368
347
  */
369
- export type ResponseFormat = OpenEnum<typeof ResponseFormat>;
348
+ export type ResponseFormatEnum = OpenEnum<typeof ResponseFormatEnum>;
370
349
  /**
371
350
  * Text-to-speech request input
372
351
  */
373
- export type CreateTtsRequestBody = {
352
+ export type SpeechRequest = {
374
353
  /**
375
354
  * Text to synthesize
376
355
  */
@@ -382,44 +361,22 @@ export type CreateTtsRequestBody = {
382
361
  /**
383
362
  * Provider-specific passthrough configuration
384
363
  */
385
- provider?: Provider | undefined;
364
+ provider?: SpeechRequestProvider | undefined;
386
365
  /**
387
366
  * Audio output format
388
367
  */
389
- responseFormat?: ResponseFormat | undefined;
368
+ responseFormat?: ResponseFormatEnum | undefined;
390
369
  /**
391
370
  * Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers.
392
371
  */
393
372
  speed?: number | undefined;
394
373
  /**
395
- * Voice identifier
374
+ * Voice identifier (provider-specific).
396
375
  */
397
376
  voice: string;
398
377
  };
399
- export type CreateTtsRequest = {
400
- /**
401
- * The app identifier should be your app's URL and is used as the primary identifier for rankings.
402
- *
403
- * @remarks
404
- * This is used to track API usage per application.
405
- */
406
- httpReferer?: string | undefined;
407
- /**
408
- * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
409
- *
410
- * @remarks
411
- */
412
- appTitle?: string | undefined;
413
- /**
414
- * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
415
- *
416
- * @remarks
417
- */
418
- appCategories?: string | undefined;
419
- requestBody: CreateTtsRequestBody;
420
- };
421
378
  /** @internal */
422
- export type Options$Outbound = {
379
+ export type SpeechRequestOptions$Outbound = {
423
380
  "01ai"?: {
424
381
  [k: string]: any | null;
425
382
  } | undefined;
@@ -743,37 +700,27 @@ export type Options$Outbound = {
743
700
  } | undefined;
744
701
  };
745
702
  /** @internal */
746
- export declare const Options$outboundSchema: z.ZodType<Options$Outbound, Options>;
747
- export declare function optionsToJSON(options: Options): string;
703
+ export declare const SpeechRequestOptions$outboundSchema: z.ZodType<SpeechRequestOptions$Outbound, SpeechRequestOptions>;
704
+ export declare function speechRequestOptionsToJSON(speechRequestOptions: SpeechRequestOptions): string;
748
705
  /** @internal */
749
- export type Provider$Outbound = {
750
- options?: Options$Outbound | undefined;
706
+ export type SpeechRequestProvider$Outbound = {
707
+ options?: SpeechRequestOptions$Outbound | undefined;
751
708
  };
752
709
  /** @internal */
753
- export declare const Provider$outboundSchema: z.ZodType<Provider$Outbound, Provider>;
754
- export declare function providerToJSON(provider: Provider): string;
710
+ export declare const SpeechRequestProvider$outboundSchema: z.ZodType<SpeechRequestProvider$Outbound, SpeechRequestProvider>;
711
+ export declare function speechRequestProviderToJSON(speechRequestProvider: SpeechRequestProvider): string;
755
712
  /** @internal */
756
- export declare const ResponseFormat$outboundSchema: z.ZodType<string, ResponseFormat>;
713
+ export declare const ResponseFormatEnum$outboundSchema: z.ZodType<string, ResponseFormatEnum>;
757
714
  /** @internal */
758
- export type CreateTtsRequestBody$Outbound = {
715
+ export type SpeechRequest$Outbound = {
759
716
  input: string;
760
717
  model: string;
761
- provider?: Provider$Outbound | undefined;
718
+ provider?: SpeechRequestProvider$Outbound | undefined;
762
719
  response_format: string;
763
720
  speed?: number | undefined;
764
721
  voice: string;
765
722
  };
766
723
  /** @internal */
767
- export declare const CreateTtsRequestBody$outboundSchema: z.ZodType<CreateTtsRequestBody$Outbound, CreateTtsRequestBody>;
768
- export declare function createTtsRequestBodyToJSON(createTtsRequestBody: CreateTtsRequestBody): string;
769
- /** @internal */
770
- export type CreateTtsRequest$Outbound = {
771
- "HTTP-Referer"?: string | undefined;
772
- appTitle?: string | undefined;
773
- appCategories?: string | undefined;
774
- RequestBody: CreateTtsRequestBody$Outbound;
775
- };
776
- /** @internal */
777
- export declare const CreateTtsRequest$outboundSchema: z.ZodType<CreateTtsRequest$Outbound, CreateTtsRequest>;
778
- export declare function createTtsRequestToJSON(createTtsRequest: CreateTtsRequest): string;
779
- //# sourceMappingURL=createtts.d.ts.map
724
+ export declare const SpeechRequest$outboundSchema: z.ZodType<SpeechRequest$Outbound, SpeechRequest>;
725
+ export declare function speechRequestToJSON(speechRequest: SpeechRequest): string;
726
+ //# sourceMappingURL=speechrequest.d.ts.map
@@ -1,20 +1,19 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: fd4cb8ec3732
3
+ * @generated-id: 96d573d68420
4
4
  */
5
5
  import * as z from "zod/v4";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as openEnums from "../../types/enums.js";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import * as openEnums from "../types/enums.js";
8
8
  /**
9
9
  * Audio output format
10
10
  */
11
- export const ResponseFormat = {
11
+ export const ResponseFormatEnum = {
12
12
  Mp3: "mp3",
13
13
  Pcm: "pcm",
14
14
  };
15
15
  /** @internal */
16
- export const Options$outboundSchema = z
17
- .object({
16
+ export const SpeechRequestOptions$outboundSchema = z.object({
18
17
  oneai: z.record(z.string(), z.nullable(z.any())).optional(),
19
18
  ai21: z.record(z.string(), z.nullable(z.any())).optional(),
20
19
  aionLabs: z.record(z.string(), z.nullable(z.any())).optional(),
@@ -146,25 +145,24 @@ export const Options$outboundSchema = z
146
145
  zAi: "z-ai",
147
146
  });
148
147
  });
149
- export function optionsToJSON(options) {
150
- return JSON.stringify(Options$outboundSchema.parse(options));
148
+ export function speechRequestOptionsToJSON(speechRequestOptions) {
149
+ return JSON.stringify(SpeechRequestOptions$outboundSchema.parse(speechRequestOptions));
151
150
  }
152
151
  /** @internal */
153
- export const Provider$outboundSchema = z
154
- .object({
155
- options: z.lazy(() => Options$outboundSchema).optional(),
152
+ export const SpeechRequestProvider$outboundSchema = z.object({
153
+ options: z.lazy(() => SpeechRequestOptions$outboundSchema).optional(),
156
154
  });
157
- export function providerToJSON(provider) {
158
- return JSON.stringify(Provider$outboundSchema.parse(provider));
155
+ export function speechRequestProviderToJSON(speechRequestProvider) {
156
+ return JSON.stringify(SpeechRequestProvider$outboundSchema.parse(speechRequestProvider));
159
157
  }
160
158
  /** @internal */
161
- export const ResponseFormat$outboundSchema = openEnums.outboundSchema(ResponseFormat);
159
+ export const ResponseFormatEnum$outboundSchema = openEnums.outboundSchema(ResponseFormatEnum);
162
160
  /** @internal */
163
- export const CreateTtsRequestBody$outboundSchema = z.object({
161
+ export const SpeechRequest$outboundSchema = z.object({
164
162
  input: z.string(),
165
163
  model: z.string(),
166
- provider: z.lazy(() => Provider$outboundSchema).optional(),
167
- responseFormat: ResponseFormat$outboundSchema.default("pcm"),
164
+ provider: z.lazy(() => SpeechRequestProvider$outboundSchema).optional(),
165
+ responseFormat: ResponseFormatEnum$outboundSchema.default("pcm"),
168
166
  speed: z.number().optional(),
169
167
  voice: z.string(),
170
168
  }).transform((v) => {
@@ -172,22 +170,7 @@ export const CreateTtsRequestBody$outboundSchema = z.object({
172
170
  responseFormat: "response_format",
173
171
  });
174
172
  });
175
- export function createTtsRequestBodyToJSON(createTtsRequestBody) {
176
- return JSON.stringify(CreateTtsRequestBody$outboundSchema.parse(createTtsRequestBody));
173
+ export function speechRequestToJSON(speechRequest) {
174
+ return JSON.stringify(SpeechRequest$outboundSchema.parse(speechRequest));
177
175
  }
178
- /** @internal */
179
- export const CreateTtsRequest$outboundSchema = z.object({
180
- httpReferer: z.string().optional(),
181
- appTitle: z.string().optional(),
182
- appCategories: z.string().optional(),
183
- requestBody: z.lazy(() => CreateTtsRequestBody$outboundSchema),
184
- }).transform((v) => {
185
- return remap$(v, {
186
- httpReferer: "HTTP-Referer",
187
- requestBody: "RequestBody",
188
- });
189
- });
190
- export function createTtsRequestToJSON(createTtsRequest) {
191
- return JSON.stringify(CreateTtsRequest$outboundSchema.parse(createTtsRequest));
192
- }
193
- //# sourceMappingURL=createtts.js.map
176
+ //# sourceMappingURL=speechrequest.js.map
@@ -21,7 +21,7 @@ export type AspectRatio = OpenEnum<typeof AspectRatio>;
21
21
  /**
22
22
  * Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body.
23
23
  */
24
- export type Options = {
24
+ export type VideoGenerationRequestOptions = {
25
25
  oneai?: {
26
26
  [k: string]: any | null;
27
27
  } | undefined;
@@ -347,11 +347,11 @@ export type Options = {
347
347
  /**
348
348
  * Provider-specific passthrough configuration
349
349
  */
350
- export type Provider = {
350
+ export type VideoGenerationRequestProvider = {
351
351
  /**
352
352
  * Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body.
353
353
  */
354
- options?: Options | undefined;
354
+ options?: VideoGenerationRequestOptions | undefined;
355
355
  };
356
356
  /**
357
357
  * Resolution of the generated video
@@ -394,7 +394,7 @@ export type VideoGenerationRequest = {
394
394
  /**
395
395
  * Provider-specific passthrough configuration
396
396
  */
397
- provider?: Provider | undefined;
397
+ provider?: VideoGenerationRequestProvider | undefined;
398
398
  /**
399
399
  * Resolution of the generated video
400
400
  */
@@ -411,7 +411,7 @@ export type VideoGenerationRequest = {
411
411
  /** @internal */
412
412
  export declare const AspectRatio$outboundSchema: z.ZodType<string, AspectRatio>;
413
413
  /** @internal */
414
- export type Options$Outbound = {
414
+ export type VideoGenerationRequestOptions$Outbound = {
415
415
  "01ai"?: {
416
416
  [k: string]: any | null;
417
417
  } | undefined;
@@ -735,15 +735,15 @@ export type Options$Outbound = {
735
735
  } | undefined;
736
736
  };
737
737
  /** @internal */
738
- export declare const Options$outboundSchema: z.ZodType<Options$Outbound, Options>;
739
- export declare function optionsToJSON(options: Options): string;
738
+ export declare const VideoGenerationRequestOptions$outboundSchema: z.ZodType<VideoGenerationRequestOptions$Outbound, VideoGenerationRequestOptions>;
739
+ export declare function videoGenerationRequestOptionsToJSON(videoGenerationRequestOptions: VideoGenerationRequestOptions): string;
740
740
  /** @internal */
741
- export type Provider$Outbound = {
742
- options?: Options$Outbound | undefined;
741
+ export type VideoGenerationRequestProvider$Outbound = {
742
+ options?: VideoGenerationRequestOptions$Outbound | undefined;
743
743
  };
744
744
  /** @internal */
745
- export declare const Provider$outboundSchema: z.ZodType<Provider$Outbound, Provider>;
746
- export declare function providerToJSON(provider: Provider): string;
745
+ export declare const VideoGenerationRequestProvider$outboundSchema: z.ZodType<VideoGenerationRequestProvider$Outbound, VideoGenerationRequestProvider>;
746
+ export declare function videoGenerationRequestProviderToJSON(videoGenerationRequestProvider: VideoGenerationRequestProvider): string;
747
747
  /** @internal */
748
748
  export declare const Resolution$outboundSchema: z.ZodType<string, Resolution>;
749
749
  /** @internal */
@@ -755,7 +755,7 @@ export type VideoGenerationRequest$Outbound = {
755
755
  input_references?: Array<ContentPartImage$Outbound> | undefined;
756
756
  model: string;
757
757
  prompt: string;
758
- provider?: Provider$Outbound | undefined;
758
+ provider?: VideoGenerationRequestProvider$Outbound | undefined;
759
759
  resolution?: string | undefined;
760
760
  seed?: number | undefined;
761
761
  size?: string | undefined;
@@ -33,8 +33,7 @@ export const Resolution = {
33
33
  /** @internal */
34
34
  export const AspectRatio$outboundSchema = openEnums.outboundSchema(AspectRatio);
35
35
  /** @internal */
36
- export const Options$outboundSchema = z
37
- .object({
36
+ export const VideoGenerationRequestOptions$outboundSchema = z.object({
38
37
  oneai: z.record(z.string(), z.nullable(z.any())).optional(),
39
38
  ai21: z.record(z.string(), z.nullable(z.any())).optional(),
40
39
  aionLabs: z.record(z.string(), z.nullable(z.any())).optional(),
@@ -166,16 +165,16 @@ export const Options$outboundSchema = z
166
165
  zAi: "z-ai",
167
166
  });
168
167
  });
169
- export function optionsToJSON(options) {
170
- return JSON.stringify(Options$outboundSchema.parse(options));
168
+ export function videoGenerationRequestOptionsToJSON(videoGenerationRequestOptions) {
169
+ return JSON.stringify(VideoGenerationRequestOptions$outboundSchema.parse(videoGenerationRequestOptions));
171
170
  }
172
171
  /** @internal */
173
- export const Provider$outboundSchema = z
174
- .object({
175
- options: z.lazy(() => Options$outboundSchema).optional(),
172
+ export const VideoGenerationRequestProvider$outboundSchema = z.object({
173
+ options: z.lazy(() => VideoGenerationRequestOptions$outboundSchema)
174
+ .optional(),
176
175
  });
177
- export function providerToJSON(provider) {
178
- return JSON.stringify(Provider$outboundSchema.parse(provider));
176
+ export function videoGenerationRequestProviderToJSON(videoGenerationRequestProvider) {
177
+ return JSON.stringify(VideoGenerationRequestProvider$outboundSchema.parse(videoGenerationRequestProvider));
179
178
  }
180
179
  /** @internal */
181
180
  export const Resolution$outboundSchema = openEnums.outboundSchema(Resolution);
@@ -188,7 +187,8 @@ export const VideoGenerationRequest$outboundSchema = z.object({
188
187
  inputReferences: z.array(ContentPartImage$outboundSchema).optional(),
189
188
  model: z.string(),
190
189
  prompt: z.string(),
191
- provider: z.lazy(() => Provider$outboundSchema).optional(),
190
+ provider: z.lazy(() => VideoGenerationRequestProvider$outboundSchema)
191
+ .optional(),
192
192
  resolution: Resolution$outboundSchema.optional(),
193
193
  seed: z.int().optional(),
194
194
  size: z.string().optional(),
@@ -0,0 +1,19 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ /**
4
+ * Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API (supports BYOK). "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK).
5
+ */
6
+ export declare const WebFetchEngineEnum: {
7
+ readonly Auto: "auto";
8
+ readonly Native: "native";
9
+ readonly Openrouter: "openrouter";
10
+ readonly Firecrawl: "firecrawl";
11
+ readonly Exa: "exa";
12
+ };
13
+ /**
14
+ * Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API (supports BYOK). "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK).
15
+ */
16
+ export type WebFetchEngineEnum = OpenEnum<typeof WebFetchEngineEnum>;
17
+ /** @internal */
18
+ export declare const WebFetchEngineEnum$outboundSchema: z.ZodType<string, WebFetchEngineEnum>;
19
+ //# sourceMappingURL=webfetchengineenum.d.ts.map
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 9cc8d81a8f6c
4
+ */
5
+ import * as openEnums from "../types/enums.js";
6
+ /**
7
+ * Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API (supports BYOK). "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK).
8
+ */
9
+ export const WebFetchEngineEnum = {
10
+ Auto: "auto",
11
+ Native: "native",
12
+ Openrouter: "openrouter",
13
+ Firecrawl: "firecrawl",
14
+ Exa: "exa",
15
+ };
16
+ /** @internal */
17
+ export const WebFetchEngineEnum$outboundSchema = openEnums.outboundSchema(WebFetchEngineEnum);
18
+ //# sourceMappingURL=webfetchengineenum.js.map
@@ -0,0 +1,28 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../types/enums.js";
3
+ import { WebFetchServerToolConfig, WebFetchServerToolConfig$Outbound } from "./webfetchservertoolconfig.js";
4
+ export declare const WebFetchServerToolType: {
5
+ readonly OpenrouterWebFetch: "openrouter:web_fetch";
6
+ };
7
+ export type WebFetchServerToolType = ClosedEnum<typeof WebFetchServerToolType>;
8
+ /**
9
+ * OpenRouter built-in server tool: fetches full content from a URL (web page or PDF)
10
+ */
11
+ export type WebFetchServerTool = {
12
+ /**
13
+ * Configuration for the openrouter:web_fetch server tool
14
+ */
15
+ parameters?: WebFetchServerToolConfig | undefined;
16
+ type: WebFetchServerToolType;
17
+ };
18
+ /** @internal */
19
+ export declare const WebFetchServerToolType$outboundSchema: z.ZodEnum<typeof WebFetchServerToolType>;
20
+ /** @internal */
21
+ export type WebFetchServerTool$Outbound = {
22
+ parameters?: WebFetchServerToolConfig$Outbound | undefined;
23
+ type: string;
24
+ };
25
+ /** @internal */
26
+ export declare const WebFetchServerTool$outboundSchema: z.ZodType<WebFetchServerTool$Outbound, WebFetchServerTool>;
27
+ export declare function webFetchServerToolToJSON(webFetchServerTool: WebFetchServerTool): string;
28
+ //# sourceMappingURL=webfetchservertool.d.ts.map
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 6d6cb09da873
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { WebFetchServerToolConfig$outboundSchema, } from "./webfetchservertoolconfig.js";
7
+ export const WebFetchServerToolType = {
8
+ OpenrouterWebFetch: "openrouter:web_fetch",
9
+ };
10
+ /** @internal */
11
+ export const WebFetchServerToolType$outboundSchema = z.enum(WebFetchServerToolType);
12
+ /** @internal */
13
+ export const WebFetchServerTool$outboundSchema = z.object({
14
+ parameters: WebFetchServerToolConfig$outboundSchema.optional(),
15
+ type: WebFetchServerToolType$outboundSchema,
16
+ });
17
+ export function webFetchServerToolToJSON(webFetchServerTool) {
18
+ return JSON.stringify(WebFetchServerTool$outboundSchema.parse(webFetchServerTool));
19
+ }
20
+ //# sourceMappingURL=webfetchservertool.js.map
@@ -0,0 +1,39 @@
1
+ import * as z from "zod/v4";
2
+ import { WebFetchEngineEnum } from "./webfetchengineenum.js";
3
+ /**
4
+ * Configuration for the openrouter:web_fetch server tool
5
+ */
6
+ export type WebFetchServerToolConfig = {
7
+ /**
8
+ * Only fetch from these domains.
9
+ */
10
+ allowedDomains?: Array<string> | undefined;
11
+ /**
12
+ * Never fetch from these domains.
13
+ */
14
+ blockedDomains?: Array<string> | undefined;
15
+ /**
16
+ * Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API (supports BYOK). "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK).
17
+ */
18
+ engine?: WebFetchEngineEnum | undefined;
19
+ /**
20
+ * Maximum content length in approximate tokens. Content exceeding this limit is truncated.
21
+ */
22
+ maxContentTokens?: number | undefined;
23
+ /**
24
+ * Maximum number of web fetches per request. Once exceeded, the tool returns an error.
25
+ */
26
+ maxUses?: number | undefined;
27
+ };
28
+ /** @internal */
29
+ export type WebFetchServerToolConfig$Outbound = {
30
+ allowed_domains?: Array<string> | undefined;
31
+ blocked_domains?: Array<string> | undefined;
32
+ engine?: string | undefined;
33
+ max_content_tokens?: number | undefined;
34
+ max_uses?: number | undefined;
35
+ };
36
+ /** @internal */
37
+ export declare const WebFetchServerToolConfig$outboundSchema: z.ZodType<WebFetchServerToolConfig$Outbound, WebFetchServerToolConfig>;
38
+ export declare function webFetchServerToolConfigToJSON(webFetchServerToolConfig: WebFetchServerToolConfig): string;
39
+ //# sourceMappingURL=webfetchservertoolconfig.d.ts.map
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: a65999aa9fc4
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { WebFetchEngineEnum$outboundSchema, } from "./webfetchengineenum.js";
8
+ /** @internal */
9
+ export const WebFetchServerToolConfig$outboundSchema = z.object({
10
+ allowedDomains: z.array(z.string()).optional(),
11
+ blockedDomains: z.array(z.string()).optional(),
12
+ engine: WebFetchEngineEnum$outboundSchema.optional(),
13
+ maxContentTokens: z.int().optional(),
14
+ maxUses: z.int().optional(),
15
+ }).transform((v) => {
16
+ return remap$(v, {
17
+ allowedDomains: "allowed_domains",
18
+ blockedDomains: "blocked_domains",
19
+ maxContentTokens: "max_content_tokens",
20
+ maxUses: "max_uses",
21
+ });
22
+ });
23
+ export function webFetchServerToolConfigToJSON(webFetchServerToolConfig) {
24
+ return JSON.stringify(WebFetchServerToolConfig$outboundSchema.parse(webFetchServerToolConfig));
25
+ }
26
+ //# sourceMappingURL=webfetchservertoolconfig.js.map
package/esm/sdk/sdk.d.ts CHANGED
@@ -25,6 +25,8 @@ export { ToolType };
25
25
  export declare class OpenRouter extends ClientSDK {
26
26
  private _analytics?;
27
27
  get analytics(): Analytics;
28
+ private _tts?;
29
+ get tts(): Tts;
28
30
  private _oAuth?;
29
31
  get oAuth(): OAuth;
30
32
  private _chat?;
@@ -51,8 +53,6 @@ export declare class OpenRouter extends ClientSDK {
51
53
  get rerank(): Rerank;
52
54
  private _beta?;
53
55
  get beta(): Beta;
54
- private _tts?;
55
- get tts(): Tts;
56
56
  private _videoGeneration?;
57
57
  get videoGeneration(): VideoGeneration;
58
58
  private _workspaces?;
package/esm/sdk/sdk.js CHANGED
@@ -28,6 +28,9 @@ export class OpenRouter extends ClientSDK {
28
28
  get analytics() {
29
29
  return (this._analytics ?? (this._analytics = new Analytics(this._options)));
30
30
  }
31
+ get tts() {
32
+ return (this._tts ?? (this._tts = new Tts(this._options)));
33
+ }
31
34
  get oAuth() {
32
35
  return (this._oAuth ?? (this._oAuth = new OAuth(this._options)));
33
36
  }
@@ -67,9 +70,6 @@ export class OpenRouter extends ClientSDK {
67
70
  get beta() {
68
71
  return (this._beta ?? (this._beta = new Beta(this._options)));
69
72
  }
70
- get tts() {
71
- return (this._tts ?? (this._tts = new Tts(this._options)));
72
- }
73
73
  get videoGeneration() {
74
74
  return (this._videoGeneration ?? (this._videoGeneration = new VideoGeneration(this._options)));
75
75
  }
package/esm/sdk/tts.d.ts CHANGED
@@ -7,6 +7,6 @@ export declare class Tts extends ClientSDK {
7
7
  * @remarks
8
8
  * Synthesizes audio from the input text
9
9
  */
10
- createSpeech(request: operations.CreateTtsRequest, options?: RequestOptions): Promise<ReadableStream<Uint8Array>>;
10
+ createSpeech(request: operations.CreateAudioSpeechRequest, options?: RequestOptions): Promise<ReadableStream<Uint8Array>>;
11
11
  }
12
12
  //# sourceMappingURL=tts.d.ts.map
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.12.17",
5
+ "version": "0.12.19",
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.12.17",
3
+ "version": "0.12.19",
4
4
  "author": "OpenRouter",
5
5
  "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
6
6
  "keywords": [
@@ -71,13 +71,13 @@
71
71
  "prepublishOnly": "npm run build",
72
72
  "compile": "tsc",
73
73
  "postinstall": "node scripts/check-types.js || true",
74
- "test": "vitest --run --project unit",
75
- "test:e2e": "vitest --run --project e2e",
76
- "test:watch": "vitest --watch --project unit",
77
- "typecheck:transit": "exit 0",
78
74
  "prepare": "npm run build",
75
+ "test": "vitest --run --project unit",
79
76
  "test:transit": "exit 0",
80
- "typecheck": "tsc --noEmit"
77
+ "test:watch": "vitest --watch --project unit",
78
+ "typecheck": "tsc --noEmit",
79
+ "test:e2e": "vitest --run --project e2e",
80
+ "typecheck:transit": "exit 0"
81
81
  },
82
82
  "peerDependencies": {},
83
83
  "devDependencies": {