@openrouter/sdk 1.3.27 → 1.3.29

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.
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
13
13
  * Get an intern's daemon access
14
14
  *
15
15
  * @remarks
16
- * Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: the response is sent with `Cache-Control: no-store`, each reveal is logged by caller and intern, and a caller may make 10 reveals per minute. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
16
+ * Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: the response is sent with `Cache-Control: no-store`, and each reveal is logged by caller and intern. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
17
17
  *
18
18
  * If set, this operation will use {@link Security.apiKey} from the global security.
19
19
  */
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
17
17
  * Get an intern's daemon access
18
18
  *
19
19
  * @remarks
20
- * Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: the response is sent with `Cache-Control: no-store`, each reveal is logged by caller and intern, and a caller may make 10 reveals per minute. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
20
+ * Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: the response is sent with `Cache-Control: no-store`, and each reveal is logged by caller and intern. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
21
21
  *
22
22
  * If set, this operation will use {@link Security.apiKey} from the global security.
23
23
  */
@@ -96,7 +96,7 @@ async function $do(client, request, options) {
96
96
  const responseFields = {
97
97
  HttpMeta: { Response: response, Request: req },
98
98
  };
99
- const [result] = await M.match(M.json(200, models_InternDaemonAccess$inboundSchema), M.jsonErr([401, 403, 404, 408, 409, 429], errors_InternLifecycleError$inboundSchema), M.jsonErr(500, errors_InternLifecycleError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
99
+ const [result] = await M.match(M.json(200, models_InternDaemonAccess$inboundSchema), M.jsonErr([401, 403, 404, 408, 409], errors_InternLifecycleError$inboundSchema), M.jsonErr(500, errors_InternLifecycleError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
100
100
  if (!result.ok) {
101
101
  return [result, { status: "complete", request: req, response }];
102
102
  }
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
50
50
  export declare const SDK_METADATA: {
51
51
  readonly language: "typescript";
52
52
  readonly openapiDocVersion: "1.0.0";
53
- readonly sdkVersion: "1.3.27";
53
+ readonly sdkVersion: "1.3.29";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.3.27 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.3.29 2.914.0 1.0.0 @openrouter/sdk";
56
56
  };
57
57
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
29
29
  export const SDK_METADATA = {
30
30
  language: "typescript",
31
31
  openapiDocVersion: "1.0.0",
32
- sdkVersion: "1.3.27",
32
+ sdkVersion: "1.3.29",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.3.27 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.3.29 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -583,6 +583,8 @@ export * from "./shellservertoolopenrouter.js";
583
583
  export * from "./speechinputreference.js";
584
584
  export * from "./speechinputreferenceaudio.js";
585
585
  export * from "./speechinputreferenceaudioinput.js";
586
+ export * from "./speechinputreferenceimage.js";
587
+ export * from "./speechinputreferenceimageinput.js";
586
588
  export * from "./speechinputreferencetext.js";
587
589
  export * from "./speechrequest.js";
588
590
  export * from "./stopservertoolswhencondition.js";
@@ -587,6 +587,8 @@ export * from "./shellservertoolopenrouter.js";
587
587
  export * from "./speechinputreference.js";
588
588
  export * from "./speechinputreferenceaudio.js";
589
589
  export * from "./speechinputreferenceaudioinput.js";
590
+ export * from "./speechinputreferenceimage.js";
591
+ export * from "./speechinputreferenceimageinput.js";
590
592
  export * from "./speechinputreferencetext.js";
591
593
  export * from "./speechrequest.js";
592
594
  export * from "./stopservertoolswhencondition.js";
@@ -189,7 +189,15 @@ export type PublicEndpoint = {
189
189
  quantization: Quantization | null;
190
190
  status?: EndpointStatus | undefined;
191
191
  supportedParameters: Array<Parameter>;
192
+ /**
193
+ * Whether this TTS endpoint accepts an `image_url` reference describing the desired voice. Requests carrying an image reference are only routed to endpoints where this is true.
194
+ */
195
+ supportsImageReference: boolean;
192
196
  supportsImplicitCaching: boolean;
197
+ /**
198
+ * Whether this TTS endpoint accepts more than one `input_audio` reference clip per request. Requests carrying several clips are only routed to endpoints where this is true.
199
+ */
200
+ supportsMultipleAudioReferences: boolean;
193
201
  /**
194
202
  * Per-variant `tool_choice` support. `tool_choice` in `supported_parameters` only says the parameter is accepted; these flags say which of its values passed testing.
195
203
  */
@@ -201,7 +201,9 @@ export const PublicEndpoint$inboundSchema = z.object({
201
201
  quantization: z.nullable(Quantization$inboundSchema),
202
202
  status: EndpointStatus$inboundSchema.optional(),
203
203
  supported_parameters: z.array(Parameter$inboundSchema),
204
+ supports_image_reference: z.boolean().default(false),
204
205
  supports_implicit_caching: z.boolean(),
206
+ supports_multiple_audio_references: z.boolean().default(false),
205
207
  supports_tool_choice: ToolChoiceSupport$inboundSchema,
206
208
  supports_voice_cloning: z.boolean().default(false),
207
209
  tag: z.string(),
@@ -220,7 +222,9 @@ export const PublicEndpoint$inboundSchema = z.object({
220
222
  "perf_last_30m_by_workload": "perfLast30mByWorkload",
221
223
  "provider_name": "providerName",
222
224
  "supported_parameters": "supportedParameters",
225
+ "supports_image_reference": "supportsImageReference",
223
226
  "supports_implicit_caching": "supportsImplicitCaching",
227
+ "supports_multiple_audio_references": "supportsMultipleAudioReferences",
224
228
  "supports_tool_choice": "supportsToolChoice",
225
229
  "supports_voice_cloning": "supportsVoiceCloning",
226
230
  "throughput_last_30m": "throughputLast30m",
@@ -1,12 +1,13 @@
1
1
  import * as z from "zod/v4";
2
2
  import { SpeechInputReferenceAudio, SpeechInputReferenceAudio$Outbound } from "./speechinputreferenceaudio.js";
3
+ import { SpeechInputReferenceImage, SpeechInputReferenceImage$Outbound } from "./speechinputreferenceimage.js";
3
4
  import { SpeechInputReferenceText, SpeechInputReferenceText$Outbound } from "./speechinputreferencetext.js";
4
5
  /**
5
- * Reference content part for stateless voice cloning
6
+ * Reference content part for stateless voice cloning or voice design
6
7
  */
7
- export type SpeechInputReference = SpeechInputReferenceAudio | SpeechInputReferenceText;
8
+ export type SpeechInputReference = SpeechInputReferenceImage | SpeechInputReferenceAudio | SpeechInputReferenceText;
8
9
  /** @internal */
9
- export type SpeechInputReference$Outbound = SpeechInputReferenceAudio$Outbound | SpeechInputReferenceText$Outbound;
10
+ export type SpeechInputReference$Outbound = SpeechInputReferenceImage$Outbound | SpeechInputReferenceAudio$Outbound | SpeechInputReferenceText$Outbound;
10
11
  /** @internal */
11
12
  export declare const SpeechInputReference$outboundSchema: z.ZodType<SpeechInputReference$Outbound, SpeechInputReference>;
12
13
  export declare function speechInputReferenceToJSON(speechInputReference: SpeechInputReference): string;
@@ -4,9 +4,11 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { SpeechInputReferenceAudio$outboundSchema, } from "./speechinputreferenceaudio.js";
7
+ import { SpeechInputReferenceImage$outboundSchema, } from "./speechinputreferenceimage.js";
7
8
  import { SpeechInputReferenceText$outboundSchema, } from "./speechinputreferencetext.js";
8
9
  /** @internal */
9
10
  export const SpeechInputReference$outboundSchema = z.union([
11
+ SpeechInputReferenceImage$outboundSchema,
10
12
  SpeechInputReferenceAudio$outboundSchema,
11
13
  SpeechInputReferenceText$outboundSchema,
12
14
  ]);
@@ -1,7 +1,7 @@
1
1
  import * as z from "zod/v4";
2
2
  import { SpeechInputReferenceAudioInput, SpeechInputReferenceAudioInput$Outbound } from "./speechinputreferenceaudioinput.js";
3
3
  /**
4
- * Reference audio input for stateless voice cloning
4
+ * Reference audio input for stateless voice cloning. Up to three parts per request; the Nth audio part is addressable from `input` as `@AudioN` on providers that support multiple references.
5
5
  */
6
6
  export type SpeechInputReferenceAudio = {
7
7
  /**
@@ -4,18 +4,23 @@ import * as z from "zod/v4";
4
4
  */
5
5
  export type SpeechInputReferenceAudioInput = {
6
6
  /**
7
- * Base64-encoded reference audio (optionally a data URI). Supported audio formats are provider-specific. Limited to 20 MiB of base64 (15 MiB of decoded audio).
7
+ * Base64-encoded reference audio (optionally a data URI). Supported audio formats are provider-specific. Limited to 20 MiB of base64 (15 MiB of decoded audio). Exactly one of `data` or `url` is required.
8
8
  */
9
- data: string;
9
+ data?: string | undefined;
10
10
  /**
11
11
  * Audio format of the reference audio (e.g., wav, mp3). Optional; most providers detect the format from the audio bytes.
12
12
  */
13
13
  format?: string | undefined;
14
+ /**
15
+ * Public http(s) URL of the reference audio. OpenRouter downloads it (15 MiB max) and forwards the bytes, never the URL. Exactly one of `data` or `url` is required.
16
+ */
17
+ url?: string | undefined;
14
18
  };
15
19
  /** @internal */
16
20
  export type SpeechInputReferenceAudioInput$Outbound = {
17
- data: string;
21
+ data?: string | undefined;
18
22
  format?: string | undefined;
23
+ url?: string | undefined;
19
24
  };
20
25
  /** @internal */
21
26
  export declare const SpeechInputReferenceAudioInput$outboundSchema: z.ZodType<SpeechInputReferenceAudioInput$Outbound, SpeechInputReferenceAudioInput>;
@@ -5,8 +5,9 @@
5
5
  import * as z from "zod/v4";
6
6
  /** @internal */
7
7
  export const SpeechInputReferenceAudioInput$outboundSchema = z.object({
8
- data: z.string(),
8
+ data: z.string().optional(),
9
9
  format: z.string().optional(),
10
+ url: z.string().optional(),
10
11
  });
11
12
  export function speechInputReferenceAudioInputToJSON(speechInputReferenceAudioInput) {
12
13
  return JSON.stringify(SpeechInputReferenceAudioInput$outboundSchema.parse(speechInputReferenceAudioInput));
@@ -0,0 +1,21 @@
1
+ import * as z from "zod/v4";
2
+ import { SpeechInputReferenceImageInput, SpeechInputReferenceImageInput$Outbound } from "./speechinputreferenceimageinput.js";
3
+ /**
4
+ * Reference image describing the desired voice. Cannot be combined with `input_audio` parts. Only routed to endpoints that support image references.
5
+ */
6
+ export type SpeechInputReferenceImage = {
7
+ /**
8
+ * Reference image input object
9
+ */
10
+ imageUrl: SpeechInputReferenceImageInput;
11
+ type: "image_url";
12
+ };
13
+ /** @internal */
14
+ export type SpeechInputReferenceImage$Outbound = {
15
+ image_url: SpeechInputReferenceImageInput$Outbound;
16
+ type: "image_url";
17
+ };
18
+ /** @internal */
19
+ export declare const SpeechInputReferenceImage$outboundSchema: z.ZodType<SpeechInputReferenceImage$Outbound, SpeechInputReferenceImage>;
20
+ export declare function speechInputReferenceImageToJSON(speechInputReferenceImage: SpeechInputReferenceImage): string;
21
+ //# sourceMappingURL=speechinputreferenceimage.d.ts.map
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: ee7097a5c9df
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { SpeechInputReferenceImageInput$outboundSchema, } from "./speechinputreferenceimageinput.js";
8
+ /** @internal */
9
+ export const SpeechInputReferenceImage$outboundSchema = z.object({
10
+ imageUrl: SpeechInputReferenceImageInput$outboundSchema,
11
+ type: z.literal("image_url"),
12
+ }).transform((v) => {
13
+ return remap$(v, {
14
+ imageUrl: "image_url",
15
+ });
16
+ });
17
+ export function speechInputReferenceImageToJSON(speechInputReferenceImage) {
18
+ return JSON.stringify(SpeechInputReferenceImage$outboundSchema.parse(speechInputReferenceImage));
19
+ }
20
+ //# sourceMappingURL=speechinputreferenceimage.js.map
@@ -0,0 +1,18 @@
1
+ import * as z from "zod/v4";
2
+ /**
3
+ * Reference image input object
4
+ */
5
+ export type SpeechInputReferenceImageInput = {
6
+ /**
7
+ * JPEG, PNG, or WebP reference image as a base64 data URI or a public http(s) URL. Remote images are downloaded (15 MiB max) and forwarded as bytes, never as the URL.
8
+ */
9
+ url: string;
10
+ };
11
+ /** @internal */
12
+ export type SpeechInputReferenceImageInput$Outbound = {
13
+ url: string;
14
+ };
15
+ /** @internal */
16
+ export declare const SpeechInputReferenceImageInput$outboundSchema: z.ZodType<SpeechInputReferenceImageInput$Outbound, SpeechInputReferenceImageInput>;
17
+ export declare function speechInputReferenceImageInputToJSON(speechInputReferenceImageInput: SpeechInputReferenceImageInput): string;
18
+ //# sourceMappingURL=speechinputreferenceimageinput.d.ts.map
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 36100583e975
4
+ */
5
+ import * as z from "zod/v4";
6
+ /** @internal */
7
+ export const SpeechInputReferenceImageInput$outboundSchema = z.object({
8
+ url: z.string(),
9
+ });
10
+ export function speechInputReferenceImageInputToJSON(speechInputReferenceImageInput) {
11
+ return JSON.stringify(SpeechInputReferenceImageInput$outboundSchema.parse(speechInputReferenceImageInput));
12
+ }
13
+ //# sourceMappingURL=speechinputreferenceimageinput.js.map
@@ -1,10 +1,10 @@
1
1
  import * as z from "zod/v4";
2
2
  /**
3
- * Transcript of the accompanying reference audio
3
+ * Transcript of an `input_audio` part
4
4
  */
5
5
  export type SpeechInputReferenceText = {
6
6
  /**
7
- * Transcript of the accompanying reference audio.
7
+ * Transcript of an `input_audio` part. With a single clip it may appear before or after the clip; with multiple clips it must immediately follow the clip it transcribes.
8
8
  */
9
9
  text: string;
10
10
  type: "text";
@@ -32,7 +32,7 @@ export type SpeechRequest = {
32
32
  */
33
33
  input: string;
34
34
  /**
35
- * Reference content for stateless voice cloning: one `input_audio` part carrying the voice sample, optionally accompanied by one `text` part with its transcript. Only routed to endpoints that support voice cloning.
35
+ * Reference content for stateless voice cloning or voice design. Audio mode: one to three `input_audio` parts, each optionally paired with a `text` part carrying its transcript (a single clip accepts its transcript before or after it; with multiple clips each transcript immediately follows its clip); only routed to endpoints that support voice cloning (and multiple references when more than one part is sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. The two modes cannot be mixed. An empty array is treated as no reference.
36
36
  */
37
37
  inputReferences?: Array<SpeechInputReference> | undefined;
38
38
  /**
@@ -41,7 +41,7 @@ export declare class Interns extends ClientSDK {
41
41
  * Get an intern's daemon access
42
42
  *
43
43
  * @remarks
44
- * Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: the response is sent with `Cache-Control: no-store`, each reveal is logged by caller and intern, and a caller may make 10 reveals per minute. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
44
+ * Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: the response is sent with `Cache-Control: no-store`, and each reveal is logged by caller and intern. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
45
45
  */
46
46
  getInternDaemonAccess(request: operations.GetInternDaemonAccessRequest, options?: RequestOptions): Promise<models.InternDaemonAccess>;
47
47
  /**
@@ -64,7 +64,7 @@ export class Interns extends ClientSDK {
64
64
  * Get an intern's daemon access
65
65
  *
66
66
  * @remarks
67
- * Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: the response is sent with `Cache-Control: no-store`, each reveal is logged by caller and intern, and a caller may make 10 reveals per minute. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
67
+ * Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: the response is sent with `Cache-Control: no-store`, and each reveal is logged by caller and intern. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
68
68
  */
69
69
  async getInternDaemonAccess(request, options) {
70
70
  return unwrapAsync(internsGetInternDaemonAccess(this, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.3.27",
5
+ "version": "1.3.29",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "1.3.27",
3
+ "version": "1.3.29",
4
4
  "author": "OpenRouter",
5
5
  "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
6
6
  "keywords": [
@@ -73,15 +73,15 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
- "compile": "tsc && node scripts/unbarrel-imports.js",
77
- "postinstall": "node scripts/check-types.js || true",
78
76
  "prepare": "npm run build",
79
- "test": "vitest --run --project unit",
80
77
  "test:e2e": "vitest --run --project e2e",
81
78
  "test:transit": "exit 0",
82
79
  "test:watch": "vitest --watch --project unit",
80
+ "typecheck:transit": "exit 0",
81
+ "test": "vitest --run --project unit",
83
82
  "typecheck": "tsc --noEmit",
84
- "typecheck:transit": "exit 0"
83
+ "compile": "tsc && node scripts/unbarrel-imports.js",
84
+ "postinstall": "node scripts/check-types.js || true"
85
85
  },
86
86
  "peerDependencies": {
87
87