@openrouter/sdk 1.5.119 → 1.5.120
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/funcs/ttsGetModel.d.ts +19 -0
- package/esm/funcs/ttsGetModel.js +101 -0
- package/esm/funcs/ttsListModels.d.ts +19 -0
- package/esm/funcs/ttsListModels.js +91 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/index.d.ts +11 -0
- package/esm/models/index.js +11 -0
- package/esm/models/operations/getspeechmodel.d.ts +63 -0
- package/esm/models/operations/getspeechmodel.js +21 -0
- package/esm/models/operations/index.d.ts +2 -0
- package/esm/models/operations/index.js +2 -0
- package/esm/models/operations/listspeechmodels.d.ts +53 -0
- package/esm/models/operations/listspeechmodels.js +19 -0
- package/esm/models/speechenumparameter.d.ts +18 -0
- package/esm/models/speechenumparameter.js +19 -0
- package/esm/models/speechinputmodality.d.ts +89 -0
- package/esm/models/speechinputmodality.js +86 -0
- package/esm/models/speechmodelendpoint.d.ts +24 -0
- package/esm/models/speechmodelendpoint.js +26 -0
- package/esm/models/speechmodelresponse.d.ts +31 -0
- package/esm/models/speechmodelresponse.js +28 -0
- package/esm/models/speechmodelslistresponse.d.ts +14 -0
- package/esm/models/speechmodelslistresponse.js +14 -0
- package/esm/models/speechoutputmodality.d.ts +19 -0
- package/esm/models/speechoutputmodality.js +25 -0
- package/esm/models/speechrangeparameter.d.ts +22 -0
- package/esm/models/speechrangeparameter.js +20 -0
- package/esm/models/speechreferencecount.d.ts +19 -0
- package/esm/models/speechreferencecount.js +20 -0
- package/esm/models/speechsupportedparameters.d.ts +23 -0
- package/esm/models/speechsupportedparameters.js +25 -0
- package/esm/models/speechunknownparameter.d.ts +17 -0
- package/esm/models/speechunknownparameter.js +18 -0
- package/esm/models/speechvoiceparameter.d.ts +38 -0
- package/esm/models/speechvoiceparameter.js +30 -0
- package/esm/sdk/tts.d.ts +15 -0
- package/esm/sdk/tts.js +20 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
import { SpeechReferenceCount$inboundSchema, } from "./speechreferencecount.js";
|
|
10
|
+
/**
|
|
11
|
+
* `required`: an image reference is accepted only together with an audio reference. `excluded`: only without one. Absent: either.
|
|
12
|
+
*/
|
|
13
|
+
export const AudioEnum = {
|
|
14
|
+
Required: "required",
|
|
15
|
+
Excluded: "excluded",
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* `optional`: `input` may also be a multi-speaker turn array, which cannot be combined with `input_references`. `required`: `input` must be a turn array with at least two distinct voices. Absent: `input` is a string.
|
|
19
|
+
*/
|
|
20
|
+
export const Turns = {
|
|
21
|
+
Required: "required",
|
|
22
|
+
Optional: "optional",
|
|
23
|
+
};
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const AudioEnum$inboundSchema = openEnums
|
|
26
|
+
.inboundSchema(AudioEnum);
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const SupportedInputs2$inboundSchema = z.object({
|
|
29
|
+
audio: AudioEnum$inboundSchema.optional(),
|
|
30
|
+
references: SpeechReferenceCount$inboundSchema,
|
|
31
|
+
});
|
|
32
|
+
export function supportedInputs2FromJSON(jsonString) {
|
|
33
|
+
return safeParse(jsonString, (x) => SupportedInputs2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportedInputs2' from JSON`);
|
|
34
|
+
}
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const SpeechInputModalityImage$inboundSchema = z.object({
|
|
37
|
+
supported_inputs: z.lazy(() => SupportedInputs2$inboundSchema),
|
|
38
|
+
type: z.literal("image"),
|
|
39
|
+
}).transform((v) => {
|
|
40
|
+
return remap$(v, {
|
|
41
|
+
"supported_inputs": "supportedInputs",
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
export function speechInputModalityImageFromJSON(jsonString) {
|
|
45
|
+
return safeParse(jsonString, (x) => SpeechInputModalityImage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechInputModalityImage' from JSON`);
|
|
46
|
+
}
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const SupportedInputs1$inboundSchema = z.object({
|
|
49
|
+
references: SpeechReferenceCount$inboundSchema,
|
|
50
|
+
});
|
|
51
|
+
export function supportedInputs1FromJSON(jsonString) {
|
|
52
|
+
return safeParse(jsonString, (x) => SupportedInputs1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportedInputs1' from JSON`);
|
|
53
|
+
}
|
|
54
|
+
/** @internal */
|
|
55
|
+
export const SpeechInputModalityAudio$inboundSchema = z.object({
|
|
56
|
+
supported_inputs: z.lazy(() => SupportedInputs1$inboundSchema),
|
|
57
|
+
type: z.literal("audio"),
|
|
58
|
+
}).transform((v) => {
|
|
59
|
+
return remap$(v, {
|
|
60
|
+
"supported_inputs": "supportedInputs",
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
export function speechInputModalityAudioFromJSON(jsonString) {
|
|
64
|
+
return safeParse(jsonString, (x) => SpeechInputModalityAudio$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechInputModalityAudio' from JSON`);
|
|
65
|
+
}
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const Turns$inboundSchema = openEnums
|
|
68
|
+
.inboundSchema(Turns);
|
|
69
|
+
/** @internal */
|
|
70
|
+
export const SpeechInputModalityText$inboundSchema = z.object({
|
|
71
|
+
turns: Turns$inboundSchema.optional(),
|
|
72
|
+
type: z.literal("text"),
|
|
73
|
+
});
|
|
74
|
+
export function speechInputModalityTextFromJSON(jsonString) {
|
|
75
|
+
return safeParse(jsonString, (x) => SpeechInputModalityText$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechInputModalityText' from JSON`);
|
|
76
|
+
}
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const SpeechInputModality$inboundSchema = discriminatedUnion("type", {
|
|
79
|
+
text: z.lazy(() => SpeechInputModalityText$inboundSchema),
|
|
80
|
+
audio: z.lazy(() => SpeechInputModalityAudio$inboundSchema),
|
|
81
|
+
image: z.lazy(() => SpeechInputModalityImage$inboundSchema),
|
|
82
|
+
});
|
|
83
|
+
export function speechInputModalityFromJSON(jsonString) {
|
|
84
|
+
return safeParse(jsonString, (x) => SpeechInputModality$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechInputModality' from JSON`);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=speechinputmodality.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { SpeechInputModality } from "./speechinputmodality.js";
|
|
5
|
+
import { SpeechOutputModality } from "./speechoutputmodality.js";
|
|
6
|
+
/**
|
|
7
|
+
* One endpoint serving a speech model, with the inputs and parameters it accepts.
|
|
8
|
+
*/
|
|
9
|
+
export type SpeechModelEndpoint = {
|
|
10
|
+
inputModalities: Array<SpeechInputModality>;
|
|
11
|
+
outputModalities: Array<SpeechOutputModality>;
|
|
12
|
+
/**
|
|
13
|
+
* Provider display name
|
|
14
|
+
*/
|
|
15
|
+
providerName: string;
|
|
16
|
+
/**
|
|
17
|
+
* Provider slug
|
|
18
|
+
*/
|
|
19
|
+
providerSlug: string;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const SpeechModelEndpoint$inboundSchema: z.ZodType<SpeechModelEndpoint, unknown>;
|
|
23
|
+
export declare function speechModelEndpointFromJSON(jsonString: string): SafeParseResult<SpeechModelEndpoint, SDKValidationError>;
|
|
24
|
+
//# sourceMappingURL=speechmodelendpoint.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { SpeechInputModality$inboundSchema, } from "./speechinputmodality.js";
|
|
8
|
+
import { SpeechOutputModality$inboundSchema, } from "./speechoutputmodality.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const SpeechModelEndpoint$inboundSchema = z.object({
|
|
11
|
+
input_modalities: z.array(SpeechInputModality$inboundSchema),
|
|
12
|
+
output_modalities: z.array(SpeechOutputModality$inboundSchema),
|
|
13
|
+
provider_name: z.string(),
|
|
14
|
+
provider_slug: z.string(),
|
|
15
|
+
}).transform((v) => {
|
|
16
|
+
return remap$(v, {
|
|
17
|
+
"input_modalities": "inputModalities",
|
|
18
|
+
"output_modalities": "outputModalities",
|
|
19
|
+
"provider_name": "providerName",
|
|
20
|
+
"provider_slug": "providerSlug",
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
export function speechModelEndpointFromJSON(jsonString) {
|
|
24
|
+
return safeParse(jsonString, (x) => SpeechModelEndpoint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechModelEndpoint' from JSON`);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=speechmodelendpoint.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { SpeechInputModality } from "./speechinputmodality.js";
|
|
5
|
+
import { SpeechModelEndpoint } from "./speechmodelendpoint.js";
|
|
6
|
+
import { SpeechOutputModality } from "./speechoutputmodality.js";
|
|
7
|
+
/**
|
|
8
|
+
* A text-to-speech model. Its members are the envelope of its endpoints': enums are unioned and ranges widened, so a value inside a range may be accepted by no single endpoint. Each record in `endpoints` lists exactly what that endpoint accepts.
|
|
9
|
+
*/
|
|
10
|
+
export type SpeechModelResponse = {
|
|
11
|
+
/**
|
|
12
|
+
* Unix timestamp (seconds) of when the model was created
|
|
13
|
+
*/
|
|
14
|
+
created: number;
|
|
15
|
+
description: string;
|
|
16
|
+
/**
|
|
17
|
+
* Each endpoint serving the model, with exactly the inputs and parameters it accepts. Some endpoints route only after the caller accepts a provider requirement such as a self-attestation; until then, a request to them is rejected with a 403 that names the requirement.
|
|
18
|
+
*/
|
|
19
|
+
endpoints: Array<SpeechModelEndpoint>;
|
|
20
|
+
/**
|
|
21
|
+
* Model slug
|
|
22
|
+
*/
|
|
23
|
+
id: string;
|
|
24
|
+
inputModalities: Array<SpeechInputModality>;
|
|
25
|
+
name: string;
|
|
26
|
+
outputModalities: Array<SpeechOutputModality>;
|
|
27
|
+
};
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const SpeechModelResponse$inboundSchema: z.ZodType<SpeechModelResponse, unknown>;
|
|
30
|
+
export declare function speechModelResponseFromJSON(jsonString: string): SafeParseResult<SpeechModelResponse, SDKValidationError>;
|
|
31
|
+
//# sourceMappingURL=speechmodelresponse.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { SpeechInputModality$inboundSchema, } from "./speechinputmodality.js";
|
|
8
|
+
import { SpeechModelEndpoint$inboundSchema, } from "./speechmodelendpoint.js";
|
|
9
|
+
import { SpeechOutputModality$inboundSchema, } from "./speechoutputmodality.js";
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const SpeechModelResponse$inboundSchema = z.object({
|
|
12
|
+
created: z.int(),
|
|
13
|
+
description: z.string(),
|
|
14
|
+
endpoints: z.array(SpeechModelEndpoint$inboundSchema),
|
|
15
|
+
id: z.string(),
|
|
16
|
+
input_modalities: z.array(SpeechInputModality$inboundSchema),
|
|
17
|
+
name: z.string(),
|
|
18
|
+
output_modalities: z.array(SpeechOutputModality$inboundSchema),
|
|
19
|
+
}).transform((v) => {
|
|
20
|
+
return remap$(v, {
|
|
21
|
+
"input_modalities": "inputModalities",
|
|
22
|
+
"output_modalities": "outputModalities",
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
export function speechModelResponseFromJSON(jsonString) {
|
|
26
|
+
return safeParse(jsonString, (x) => SpeechModelResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechModelResponse' from JSON`);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=speechmodelresponse.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { SpeechModelResponse } from "./speechmodelresponse.js";
|
|
5
|
+
/**
|
|
6
|
+
* List of text-to-speech models, each with its endpoints.
|
|
7
|
+
*/
|
|
8
|
+
export type SpeechModelsListResponse = {
|
|
9
|
+
data: Array<SpeechModelResponse>;
|
|
10
|
+
};
|
|
11
|
+
/** @internal */
|
|
12
|
+
export declare const SpeechModelsListResponse$inboundSchema: z.ZodType<SpeechModelsListResponse, unknown>;
|
|
13
|
+
export declare function speechModelsListResponseFromJSON(jsonString: string): SafeParseResult<SpeechModelsListResponse, SDKValidationError>;
|
|
14
|
+
//# sourceMappingURL=speechmodelslistresponse.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import { SpeechModelResponse$inboundSchema, } from "./speechmodelresponse.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const SpeechModelsListResponse$inboundSchema = z.object({
|
|
9
|
+
data: z.array(SpeechModelResponse$inboundSchema),
|
|
10
|
+
});
|
|
11
|
+
export function speechModelsListResponseFromJSON(jsonString) {
|
|
12
|
+
return safeParse(jsonString, (x) => SpeechModelsListResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechModelsListResponse' from JSON`);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=speechmodelslistresponse.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { SpeechSupportedParameters } from "./speechsupportedparameters.js";
|
|
6
|
+
export declare const SpeechOutputModalityType: {
|
|
7
|
+
readonly Speech: "speech";
|
|
8
|
+
};
|
|
9
|
+
export type SpeechOutputModalityType = ClosedEnum<typeof SpeechOutputModalityType>;
|
|
10
|
+
export type SpeechOutputModality = {
|
|
11
|
+
supportedParameters: SpeechSupportedParameters;
|
|
12
|
+
type: SpeechOutputModalityType;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const SpeechOutputModalityType$inboundSchema: z.ZodEnum<typeof SpeechOutputModalityType>;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const SpeechOutputModality$inboundSchema: z.ZodType<SpeechOutputModality, unknown>;
|
|
18
|
+
export declare function speechOutputModalityFromJSON(jsonString: string): SafeParseResult<SpeechOutputModality, SDKValidationError>;
|
|
19
|
+
//# sourceMappingURL=speechoutputmodality.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { SpeechSupportedParameters$inboundSchema, } from "./speechsupportedparameters.js";
|
|
8
|
+
export const SpeechOutputModalityType = {
|
|
9
|
+
Speech: "speech",
|
|
10
|
+
};
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const SpeechOutputModalityType$inboundSchema = z.enum(SpeechOutputModalityType);
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const SpeechOutputModality$inboundSchema = z.object({
|
|
15
|
+
supported_parameters: SpeechSupportedParameters$inboundSchema,
|
|
16
|
+
type: SpeechOutputModalityType$inboundSchema,
|
|
17
|
+
}).transform((v) => {
|
|
18
|
+
return remap$(v, {
|
|
19
|
+
"supported_parameters": "supportedParameters",
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
export function speechOutputModalityFromJSON(jsonString) {
|
|
23
|
+
return safeParse(jsonString, (x) => SpeechOutputModality$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechOutputModality' from JSON`);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=speechoutputmodality.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const SpeechRangeParameterType: {
|
|
6
|
+
readonly Range: "range";
|
|
7
|
+
};
|
|
8
|
+
export type SpeechRangeParameterType = ClosedEnum<typeof SpeechRangeParameterType>;
|
|
9
|
+
/**
|
|
10
|
+
* The accepted `speed` range. Absent: the provider documents no range; some providers still forward `speed`.
|
|
11
|
+
*/
|
|
12
|
+
export type SpeechRangeParameter = {
|
|
13
|
+
max: number;
|
|
14
|
+
min: number;
|
|
15
|
+
type: SpeechRangeParameterType;
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const SpeechRangeParameterType$inboundSchema: z.ZodEnum<typeof SpeechRangeParameterType>;
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const SpeechRangeParameter$inboundSchema: z.ZodType<SpeechRangeParameter, unknown>;
|
|
21
|
+
export declare function speechRangeParameterFromJSON(jsonString: string): SafeParseResult<SpeechRangeParameter, SDKValidationError>;
|
|
22
|
+
//# sourceMappingURL=speechrangeparameter.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
export const SpeechRangeParameterType = {
|
|
7
|
+
Range: "range",
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const SpeechRangeParameterType$inboundSchema = z.enum(SpeechRangeParameterType);
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const SpeechRangeParameter$inboundSchema = z.object({
|
|
13
|
+
max: z.number(),
|
|
14
|
+
min: z.number(),
|
|
15
|
+
type: SpeechRangeParameterType$inboundSchema,
|
|
16
|
+
});
|
|
17
|
+
export function speechRangeParameterFromJSON(jsonString) {
|
|
18
|
+
return safeParse(jsonString, (x) => SpeechRangeParameter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechRangeParameter' from JSON`);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=speechrangeparameter.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const SpeechReferenceCountType: {
|
|
6
|
+
readonly Integer: "integer";
|
|
7
|
+
};
|
|
8
|
+
export type SpeechReferenceCountType = ClosedEnum<typeof SpeechReferenceCountType>;
|
|
9
|
+
export type SpeechReferenceCount = {
|
|
10
|
+
max?: number | undefined;
|
|
11
|
+
min: number;
|
|
12
|
+
type: SpeechReferenceCountType;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const SpeechReferenceCountType$inboundSchema: z.ZodEnum<typeof SpeechReferenceCountType>;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const SpeechReferenceCount$inboundSchema: z.ZodType<SpeechReferenceCount, unknown>;
|
|
18
|
+
export declare function speechReferenceCountFromJSON(jsonString: string): SafeParseResult<SpeechReferenceCount, SDKValidationError>;
|
|
19
|
+
//# sourceMappingURL=speechreferencecount.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
export const SpeechReferenceCountType = {
|
|
7
|
+
Integer: "integer",
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const SpeechReferenceCountType$inboundSchema = z.enum(SpeechReferenceCountType);
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const SpeechReferenceCount$inboundSchema = z.object({
|
|
13
|
+
max: z.int().optional(),
|
|
14
|
+
min: z.int(),
|
|
15
|
+
type: SpeechReferenceCountType$inboundSchema,
|
|
16
|
+
});
|
|
17
|
+
export function speechReferenceCountFromJSON(jsonString) {
|
|
18
|
+
return safeParse(jsonString, (x) => SpeechReferenceCount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechReferenceCount' from JSON`);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=speechreferencecount.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { SpeechEnumParameter } from "./speechenumparameter.js";
|
|
5
|
+
import { SpeechRangeParameter } from "./speechrangeparameter.js";
|
|
6
|
+
import { SpeechUnknownParameter } from "./speechunknownparameter.js";
|
|
7
|
+
import { SpeechVoiceParameter } from "./speechvoiceparameter.js";
|
|
8
|
+
export type SpeechSupportedParameters = {
|
|
9
|
+
instructions?: SpeechUnknownParameter | undefined;
|
|
10
|
+
responseFormat?: SpeechEnumParameter | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The accepted `speed` range. Absent: the provider documents no range; some providers still forward `speed`.
|
|
13
|
+
*/
|
|
14
|
+
speed?: SpeechRangeParameter | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* `enum` lists the documented voices in `values`; some providers also accept voice IDs not listed there (custom or cloned voices). `unknown` means the field is accepted but no voices are listed.
|
|
17
|
+
*/
|
|
18
|
+
voice?: SpeechVoiceParameter | undefined;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const SpeechSupportedParameters$inboundSchema: z.ZodType<SpeechSupportedParameters, unknown>;
|
|
22
|
+
export declare function speechSupportedParametersFromJSON(jsonString: string): SafeParseResult<SpeechSupportedParameters, SDKValidationError>;
|
|
23
|
+
//# sourceMappingURL=speechsupportedparameters.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { SpeechEnumParameter$inboundSchema, } from "./speechenumparameter.js";
|
|
8
|
+
import { SpeechRangeParameter$inboundSchema, } from "./speechrangeparameter.js";
|
|
9
|
+
import { SpeechUnknownParameter$inboundSchema, } from "./speechunknownparameter.js";
|
|
10
|
+
import { SpeechVoiceParameter$inboundSchema, } from "./speechvoiceparameter.js";
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const SpeechSupportedParameters$inboundSchema = z.object({
|
|
13
|
+
instructions: SpeechUnknownParameter$inboundSchema.optional(),
|
|
14
|
+
response_format: SpeechEnumParameter$inboundSchema.optional(),
|
|
15
|
+
speed: SpeechRangeParameter$inboundSchema.optional(),
|
|
16
|
+
voice: SpeechVoiceParameter$inboundSchema.optional(),
|
|
17
|
+
}).transform((v) => {
|
|
18
|
+
return remap$(v, {
|
|
19
|
+
"response_format": "responseFormat",
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
export function speechSupportedParametersFromJSON(jsonString) {
|
|
23
|
+
return safeParse(jsonString, (x) => SpeechSupportedParameters$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechSupportedParameters' from JSON`);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=speechsupportedparameters.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const SpeechUnknownParameterType: {
|
|
6
|
+
readonly Unknown: "unknown";
|
|
7
|
+
};
|
|
8
|
+
export type SpeechUnknownParameterType = ClosedEnum<typeof SpeechUnknownParameterType>;
|
|
9
|
+
export type SpeechUnknownParameter = {
|
|
10
|
+
type: SpeechUnknownParameterType;
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare const SpeechUnknownParameterType$inboundSchema: z.ZodEnum<typeof SpeechUnknownParameterType>;
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const SpeechUnknownParameter$inboundSchema: z.ZodType<SpeechUnknownParameter, unknown>;
|
|
16
|
+
export declare function speechUnknownParameterFromJSON(jsonString: string): SafeParseResult<SpeechUnknownParameter, SDKValidationError>;
|
|
17
|
+
//# sourceMappingURL=speechunknownparameter.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
export const SpeechUnknownParameterType = {
|
|
7
|
+
Unknown: "unknown",
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const SpeechUnknownParameterType$inboundSchema = z.enum(SpeechUnknownParameterType);
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const SpeechUnknownParameter$inboundSchema = z.object({
|
|
13
|
+
type: SpeechUnknownParameterType$inboundSchema,
|
|
14
|
+
});
|
|
15
|
+
export function speechUnknownParameterFromJSON(jsonString) {
|
|
16
|
+
return safeParse(jsonString, (x) => SpeechUnknownParameter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechUnknownParameter' from JSON`);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=speechunknownparameter.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
/**
|
|
6
|
+
* `excluded`: `voice` is rejected when the request also sends a nonempty `input_references`. Absent: they can be combined.
|
|
7
|
+
*/
|
|
8
|
+
export declare const References: {
|
|
9
|
+
readonly Excluded: "excluded";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* `excluded`: `voice` is rejected when the request also sends a nonempty `input_references`. Absent: they can be combined.
|
|
13
|
+
*/
|
|
14
|
+
export type References = ClosedEnum<typeof References>;
|
|
15
|
+
export declare const SpeechVoiceParameterType: {
|
|
16
|
+
readonly Enum: "enum";
|
|
17
|
+
readonly Unknown: "unknown";
|
|
18
|
+
};
|
|
19
|
+
export type SpeechVoiceParameterType = OpenEnum<typeof SpeechVoiceParameterType>;
|
|
20
|
+
/**
|
|
21
|
+
* `enum` lists the documented voices in `values`; some providers also accept voice IDs not listed there (custom or cloned voices). `unknown` means the field is accepted but no voices are listed.
|
|
22
|
+
*/
|
|
23
|
+
export type SpeechVoiceParameter = {
|
|
24
|
+
/**
|
|
25
|
+
* `excluded`: `voice` is rejected when the request also sends a nonempty `input_references`. Absent: they can be combined.
|
|
26
|
+
*/
|
|
27
|
+
references?: References | undefined;
|
|
28
|
+
type: SpeechVoiceParameterType;
|
|
29
|
+
values?: Array<string> | undefined;
|
|
30
|
+
};
|
|
31
|
+
/** @internal */
|
|
32
|
+
export declare const References$inboundSchema: z.ZodEnum<typeof References>;
|
|
33
|
+
/** @internal */
|
|
34
|
+
export declare const SpeechVoiceParameterType$inboundSchema: z.ZodType<SpeechVoiceParameterType, unknown>;
|
|
35
|
+
/** @internal */
|
|
36
|
+
export declare const SpeechVoiceParameter$inboundSchema: z.ZodType<SpeechVoiceParameter, unknown>;
|
|
37
|
+
export declare function speechVoiceParameterFromJSON(jsonString: string): SafeParseResult<SpeechVoiceParameter, SDKValidationError>;
|
|
38
|
+
//# sourceMappingURL=speechvoiceparameter.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
7
|
+
/**
|
|
8
|
+
* `excluded`: `voice` is rejected when the request also sends a nonempty `input_references`. Absent: they can be combined.
|
|
9
|
+
*/
|
|
10
|
+
export const References = {
|
|
11
|
+
Excluded: "excluded",
|
|
12
|
+
};
|
|
13
|
+
export const SpeechVoiceParameterType = {
|
|
14
|
+
Enum: "enum",
|
|
15
|
+
Unknown: "unknown",
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const References$inboundSchema = z.enum(References);
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const SpeechVoiceParameterType$inboundSchema = openEnums.inboundSchema(SpeechVoiceParameterType);
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const SpeechVoiceParameter$inboundSchema = z.object({
|
|
23
|
+
references: References$inboundSchema.optional(),
|
|
24
|
+
type: SpeechVoiceParameterType$inboundSchema,
|
|
25
|
+
values: z.array(z.string()).optional(),
|
|
26
|
+
});
|
|
27
|
+
export function speechVoiceParameterFromJSON(jsonString) {
|
|
28
|
+
return safeParse(jsonString, (x) => SpeechVoiceParameter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SpeechVoiceParameter' from JSON`);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=speechvoiceparameter.js.map
|
package/esm/sdk/tts.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
+
import * as models from "../models/index.js";
|
|
2
3
|
import * as operations from "../models/operations/index.js";
|
|
3
4
|
export declare class TTS extends ClientSDK {
|
|
4
5
|
/**
|
|
@@ -8,5 +9,19 @@ export declare class TTS extends ClientSDK {
|
|
|
8
9
|
* Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).
|
|
9
10
|
*/
|
|
10
11
|
createSpeech(request: operations.CreateAudioSpeechRequest, options?: RequestOptions): Promise<ReadableStream<Uint8Array>>;
|
|
12
|
+
/**
|
|
13
|
+
* List text-to-speech models
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Lists every text-to-speech model with the inputs it accepts and its speech output parameters, merged across its endpoints, plus each endpoint with its own.
|
|
17
|
+
*/
|
|
18
|
+
listModels(request?: operations.ListSpeechModelsRequest | undefined, options?: RequestOptions): Promise<models.SpeechModelsListResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Get a text-to-speech model
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* Returns a text-to-speech model with each endpoint's own inputs and speech output parameters.
|
|
24
|
+
*/
|
|
25
|
+
getModel(request: operations.GetSpeechModelRequest, options?: RequestOptions): Promise<models.SpeechModelResponse>;
|
|
11
26
|
}
|
|
12
27
|
//# sourceMappingURL=tts.d.ts.map
|
package/esm/sdk/tts.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import { ttsCreateSpeech } from "../funcs/ttsCreateSpeech.js";
|
|
5
|
+
import { ttsGetModel } from "../funcs/ttsGetModel.js";
|
|
6
|
+
import { ttsListModels } from "../funcs/ttsListModels.js";
|
|
5
7
|
import { ClientSDK } from "../lib/sdks.js";
|
|
6
8
|
import { unwrapAsync } from "../types/fp.js";
|
|
7
9
|
export class TTS extends ClientSDK {
|
|
@@ -14,5 +16,23 @@ export class TTS extends ClientSDK {
|
|
|
14
16
|
async createSpeech(request, options) {
|
|
15
17
|
return unwrapAsync(ttsCreateSpeech(this, request, options));
|
|
16
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* List text-to-speech models
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* Lists every text-to-speech model with the inputs it accepts and its speech output parameters, merged across its endpoints, plus each endpoint with its own.
|
|
24
|
+
*/
|
|
25
|
+
async listModels(request, options) {
|
|
26
|
+
return unwrapAsync(ttsListModels(this, request, options));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get a text-to-speech model
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Returns a text-to-speech model with each endpoint's own inputs and speech output parameters.
|
|
33
|
+
*/
|
|
34
|
+
async getModel(request, options) {
|
|
35
|
+
return unwrapAsync(ttsGetModel(this, request, options));
|
|
36
|
+
}
|
|
17
37
|
}
|
|
18
38
|
//# sourceMappingURL=tts.js.map
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.120",
|
|
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": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"
|
|
77
|
-
"compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
|
|
78
|
-
"prepare": "npm run build",
|
|
79
|
-
"test": "vitest --run --project unit",
|
|
80
|
-
"test:e2e": "vitest --run --project e2e",
|
|
76
|
+
"test:transit": "exit 0",
|
|
81
77
|
"test:watch": "vitest --watch --project unit",
|
|
82
78
|
"typecheck:transit": "exit 0",
|
|
83
79
|
"postinstall": "node scripts/check-types.js || true",
|
|
84
|
-
"test
|
|
80
|
+
"test": "vitest --run --project unit",
|
|
81
|
+
"typecheck": "tsc --noEmit",
|
|
82
|
+
"compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
|
|
83
|
+
"prepare": "npm run build",
|
|
84
|
+
"test:e2e": "vitest --run --project e2e"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|