@openrouter/sdk 1.2.5 → 1.2.6
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/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/index.d.ts +4 -0
- package/esm/models/index.js +4 -0
- package/esm/models/publicendpoint.d.ts +4 -0
- package/esm/models/publicendpoint.js +2 -0
- package/esm/models/speechinputreference.d.ts +13 -0
- package/esm/models/speechinputreference.js +16 -0
- package/esm/models/speechinputreferenceaudio.d.ts +21 -0
- package/esm/models/speechinputreferenceaudio.js +20 -0
- package/esm/models/speechinputreferenceaudioinput.d.ts +23 -0
- package/esm/models/speechinputreferenceaudioinput.js +14 -0
- package/esm/models/speechinputreferencetext.d.ts +20 -0
- package/esm/models/speechinputreferencetext.js +14 -0
- package/esm/models/speechrequest.d.ts +6 -0
- package/esm/models/speechrequest.js +3 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
package/esm/lib/config.d.ts
CHANGED
|
@@ -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: "1.2.
|
|
52
|
+
readonly sdkVersion: "1.2.6";
|
|
53
53
|
readonly genVersion: "2.914.0";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.6 2.914.0 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: "1.2.
|
|
29
|
+
sdkVersion: "1.2.6",
|
|
30
30
|
genVersion: "2.914.0",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 1.2.6 2.914.0 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -495,6 +495,10 @@ export * from "./shellservertoolconfig.js";
|
|
|
495
495
|
export * from "./shellservertoolengine.js";
|
|
496
496
|
export * from "./shellservertoolenvironment.js";
|
|
497
497
|
export * from "./shellservertoolopenrouter.js";
|
|
498
|
+
export * from "./speechinputreference.js";
|
|
499
|
+
export * from "./speechinputreferenceaudio.js";
|
|
500
|
+
export * from "./speechinputreferenceaudioinput.js";
|
|
501
|
+
export * from "./speechinputreferencetext.js";
|
|
498
502
|
export * from "./speechrequest.js";
|
|
499
503
|
export * from "./stopservertoolswhencondition.js";
|
|
500
504
|
export * from "./stopservertoolswhenfinishreasonis.js";
|
package/esm/models/index.js
CHANGED
|
@@ -499,6 +499,10 @@ export * from "./shellservertoolconfig.js";
|
|
|
499
499
|
export * from "./shellservertoolengine.js";
|
|
500
500
|
export * from "./shellservertoolenvironment.js";
|
|
501
501
|
export * from "./shellservertoolopenrouter.js";
|
|
502
|
+
export * from "./speechinputreference.js";
|
|
503
|
+
export * from "./speechinputreferenceaudio.js";
|
|
504
|
+
export * from "./speechinputreferenceaudioinput.js";
|
|
505
|
+
export * from "./speechinputreferencetext.js";
|
|
502
506
|
export * from "./speechrequest.js";
|
|
503
507
|
export * from "./stopservertoolswhencondition.js";
|
|
504
508
|
export * from "./stopservertoolswhenfinishreasonis.js";
|
|
@@ -96,6 +96,10 @@ export type PublicEndpoint = {
|
|
|
96
96
|
status?: EndpointStatus | undefined;
|
|
97
97
|
supportedParameters: Array<Parameter>;
|
|
98
98
|
supportsImplicitCaching: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Whether this TTS endpoint accepts inline reference audio (`input_references`) for stateless voice cloning. Requests carrying reference audio are only routed to endpoints where this is true.
|
|
101
|
+
*/
|
|
102
|
+
supportsVoiceCloning: boolean;
|
|
99
103
|
tag: string;
|
|
100
104
|
throughputLast30m: PercentileStats | null;
|
|
101
105
|
/**
|
|
@@ -60,6 +60,7 @@ export const PublicEndpoint$inboundSchema = z.object({
|
|
|
60
60
|
status: EndpointStatus$inboundSchema.optional(),
|
|
61
61
|
supported_parameters: z.array(Parameter$inboundSchema),
|
|
62
62
|
supports_implicit_caching: z.boolean(),
|
|
63
|
+
supports_voice_cloning: z.boolean().default(false),
|
|
63
64
|
tag: z.string(),
|
|
64
65
|
throughput_last_30m: z.nullable(PercentileStats$inboundSchema),
|
|
65
66
|
uptime_last_1d: z.nullable(z.number()),
|
|
@@ -76,6 +77,7 @@ export const PublicEndpoint$inboundSchema = z.object({
|
|
|
76
77
|
"provider_name": "providerName",
|
|
77
78
|
"supported_parameters": "supportedParameters",
|
|
78
79
|
"supports_implicit_caching": "supportsImplicitCaching",
|
|
80
|
+
"supports_voice_cloning": "supportsVoiceCloning",
|
|
79
81
|
"throughput_last_30m": "throughputLast30m",
|
|
80
82
|
"uptime_last_1d": "uptimeLast1d",
|
|
81
83
|
"uptime_last_30m": "uptimeLast30m",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { SpeechInputReferenceAudio, SpeechInputReferenceAudio$Outbound } from "./speechinputreferenceaudio.js";
|
|
3
|
+
import { SpeechInputReferenceText, SpeechInputReferenceText$Outbound } from "./speechinputreferencetext.js";
|
|
4
|
+
/**
|
|
5
|
+
* Reference content part for stateless voice cloning
|
|
6
|
+
*/
|
|
7
|
+
export type SpeechInputReference = SpeechInputReferenceAudio | SpeechInputReferenceText;
|
|
8
|
+
/** @internal */
|
|
9
|
+
export type SpeechInputReference$Outbound = SpeechInputReferenceAudio$Outbound | SpeechInputReferenceText$Outbound;
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare const SpeechInputReference$outboundSchema: z.ZodType<SpeechInputReference$Outbound, SpeechInputReference>;
|
|
12
|
+
export declare function speechInputReferenceToJSON(speechInputReference: SpeechInputReference): string;
|
|
13
|
+
//# sourceMappingURL=speechinputreference.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 25b19e4fa954
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { SpeechInputReferenceAudio$outboundSchema, } from "./speechinputreferenceaudio.js";
|
|
7
|
+
import { SpeechInputReferenceText$outboundSchema, } from "./speechinputreferencetext.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const SpeechInputReference$outboundSchema = z.union([
|
|
10
|
+
SpeechInputReferenceAudio$outboundSchema,
|
|
11
|
+
SpeechInputReferenceText$outboundSchema,
|
|
12
|
+
]);
|
|
13
|
+
export function speechInputReferenceToJSON(speechInputReference) {
|
|
14
|
+
return JSON.stringify(SpeechInputReference$outboundSchema.parse(speechInputReference));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=speechinputreference.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { SpeechInputReferenceAudioInput, SpeechInputReferenceAudioInput$Outbound } from "./speechinputreferenceaudioinput.js";
|
|
3
|
+
/**
|
|
4
|
+
* Reference audio input for stateless voice cloning
|
|
5
|
+
*/
|
|
6
|
+
export type SpeechInputReferenceAudio = {
|
|
7
|
+
/**
|
|
8
|
+
* Reference audio input object
|
|
9
|
+
*/
|
|
10
|
+
inputAudio: SpeechInputReferenceAudioInput;
|
|
11
|
+
type: "input_audio";
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export type SpeechInputReferenceAudio$Outbound = {
|
|
15
|
+
input_audio: SpeechInputReferenceAudioInput$Outbound;
|
|
16
|
+
type: "input_audio";
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const SpeechInputReferenceAudio$outboundSchema: z.ZodType<SpeechInputReferenceAudio$Outbound, SpeechInputReferenceAudio>;
|
|
20
|
+
export declare function speechInputReferenceAudioToJSON(speechInputReferenceAudio: SpeechInputReferenceAudio): string;
|
|
21
|
+
//# sourceMappingURL=speechinputreferenceaudio.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: d7299510c0e7
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { SpeechInputReferenceAudioInput$outboundSchema, } from "./speechinputreferenceaudioinput.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const SpeechInputReferenceAudio$outboundSchema = z.object({
|
|
10
|
+
inputAudio: SpeechInputReferenceAudioInput$outboundSchema,
|
|
11
|
+
type: z.literal("input_audio"),
|
|
12
|
+
}).transform((v) => {
|
|
13
|
+
return remap$(v, {
|
|
14
|
+
inputAudio: "input_audio",
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
export function speechInputReferenceAudioToJSON(speechInputReferenceAudio) {
|
|
18
|
+
return JSON.stringify(SpeechInputReferenceAudio$outboundSchema.parse(speechInputReferenceAudio));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=speechinputreferenceaudio.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
/**
|
|
3
|
+
* Reference audio input object
|
|
4
|
+
*/
|
|
5
|
+
export type SpeechInputReferenceAudioInput = {
|
|
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).
|
|
8
|
+
*/
|
|
9
|
+
data: string;
|
|
10
|
+
/**
|
|
11
|
+
* Audio format of the reference audio (e.g., wav, mp3). Optional; most providers detect the format from the audio bytes.
|
|
12
|
+
*/
|
|
13
|
+
format?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type SpeechInputReferenceAudioInput$Outbound = {
|
|
17
|
+
data: string;
|
|
18
|
+
format?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const SpeechInputReferenceAudioInput$outboundSchema: z.ZodType<SpeechInputReferenceAudioInput$Outbound, SpeechInputReferenceAudioInput>;
|
|
22
|
+
export declare function speechInputReferenceAudioInputToJSON(speechInputReferenceAudioInput: SpeechInputReferenceAudioInput): string;
|
|
23
|
+
//# sourceMappingURL=speechinputreferenceaudioinput.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 7f6147039895
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const SpeechInputReferenceAudioInput$outboundSchema = z.object({
|
|
8
|
+
data: z.string(),
|
|
9
|
+
format: z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
export function speechInputReferenceAudioInputToJSON(speechInputReferenceAudioInput) {
|
|
12
|
+
return JSON.stringify(SpeechInputReferenceAudioInput$outboundSchema.parse(speechInputReferenceAudioInput));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=speechinputreferenceaudioinput.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
/**
|
|
3
|
+
* Transcript of the accompanying reference audio
|
|
4
|
+
*/
|
|
5
|
+
export type SpeechInputReferenceText = {
|
|
6
|
+
/**
|
|
7
|
+
* Transcript of the accompanying reference audio.
|
|
8
|
+
*/
|
|
9
|
+
text: string;
|
|
10
|
+
type: "text";
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export type SpeechInputReferenceText$Outbound = {
|
|
14
|
+
text: string;
|
|
15
|
+
type: "text";
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const SpeechInputReferenceText$outboundSchema: z.ZodType<SpeechInputReferenceText$Outbound, SpeechInputReferenceText>;
|
|
19
|
+
export declare function speechInputReferenceTextToJSON(speechInputReferenceText: SpeechInputReferenceText): string;
|
|
20
|
+
//# sourceMappingURL=speechinputreferencetext.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 88f12d1ebfa6
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const SpeechInputReferenceText$outboundSchema = z.object({
|
|
8
|
+
text: z.string(),
|
|
9
|
+
type: z.literal("text"),
|
|
10
|
+
});
|
|
11
|
+
export function speechInputReferenceTextToJSON(speechInputReferenceText) {
|
|
12
|
+
return JSON.stringify(SpeechInputReferenceText$outboundSchema.parse(speechInputReferenceText));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=speechinputreferencetext.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { ProviderOptions, ProviderOptions$Outbound } from "./provideroptions.js";
|
|
4
|
+
import { SpeechInputReference, SpeechInputReference$Outbound } from "./speechinputreference.js";
|
|
4
5
|
/**
|
|
5
6
|
* Provider-specific passthrough configuration
|
|
6
7
|
*/
|
|
@@ -29,6 +30,10 @@ export type SpeechRequest = {
|
|
|
29
30
|
* Text to synthesize
|
|
30
31
|
*/
|
|
31
32
|
input: string;
|
|
33
|
+
/**
|
|
34
|
+
* 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
|
+
*/
|
|
36
|
+
inputReferences?: Array<SpeechInputReference> | undefined;
|
|
32
37
|
/**
|
|
33
38
|
* TTS model identifier
|
|
34
39
|
*/
|
|
@@ -62,6 +67,7 @@ export declare const SpeechRequestResponseFormat$outboundSchema: z.ZodType<strin
|
|
|
62
67
|
/** @internal */
|
|
63
68
|
export type SpeechRequest$Outbound = {
|
|
64
69
|
input: string;
|
|
70
|
+
input_references?: Array<SpeechInputReference$Outbound> | undefined;
|
|
65
71
|
model: string;
|
|
66
72
|
provider?: SpeechRequestProvider$Outbound | undefined;
|
|
67
73
|
response_format: string;
|
|
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
8
|
import { ProviderOptions$outboundSchema, } from "./provideroptions.js";
|
|
9
|
+
import { SpeechInputReference$outboundSchema, } from "./speechinputreference.js";
|
|
9
10
|
/**
|
|
10
11
|
* Audio output format
|
|
11
12
|
*/
|
|
@@ -25,6 +26,7 @@ export const SpeechRequestResponseFormat$outboundSchema = openEnums.outboundSche
|
|
|
25
26
|
/** @internal */
|
|
26
27
|
export const SpeechRequest$outboundSchema = z.object({
|
|
27
28
|
input: z.string(),
|
|
29
|
+
inputReferences: z.array(SpeechInputReference$outboundSchema).optional(),
|
|
28
30
|
model: z.string(),
|
|
29
31
|
provider: z.lazy(() => SpeechRequestProvider$outboundSchema).optional(),
|
|
30
32
|
responseFormat: SpeechRequestResponseFormat$outboundSchema.default("pcm"),
|
|
@@ -32,6 +34,7 @@ export const SpeechRequest$outboundSchema = z.object({
|
|
|
32
34
|
voice: z.string().optional(),
|
|
33
35
|
}).transform((v) => {
|
|
34
36
|
return remap$(v, {
|
|
37
|
+
inputReferences: "input_references",
|
|
35
38
|
responseFormat: "response_format",
|
|
36
39
|
});
|
|
37
40
|
});
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
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",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
+
"compile": "tsc",
|
|
76
77
|
"postinstall": "node scripts/check-types.js || true",
|
|
77
|
-
"
|
|
78
|
-
"test": "vitest --run --project unit",
|
|
78
|
+
"test:e2e": "vitest --run --project e2e",
|
|
79
79
|
"test:watch": "vitest --watch --project unit",
|
|
80
80
|
"typecheck": "tsc --noEmit",
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"test:
|
|
84
|
-
"
|
|
81
|
+
"prepare": "npm run build",
|
|
82
|
+
"test": "vitest --run --project unit",
|
|
83
|
+
"test:transit": "exit 0",
|
|
84
|
+
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|