@openrouter/sdk 1.5.44 → 1.5.46
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/providersListProviderEndpoints.d.ts +19 -0
- package/esm/funcs/providersListProviderEndpoints.js +108 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/decisionsrefusalanswer.d.ts +13 -0
- package/esm/models/decisionsrefusalanswer.js +14 -0
- package/esm/models/decisionsresponse.d.ts +9 -3
- package/esm/models/decisionsresponse.js +5 -0
- package/esm/models/decisionsurlcitationannotation.d.ts +29 -0
- package/esm/models/decisionsurlcitationannotation.js +34 -0
- package/esm/models/endpointsummary.d.ts +65 -0
- package/esm/models/endpointsummary.js +48 -0
- package/esm/models/endpointtestprofile.d.ts +271 -0
- package/esm/models/endpointtestprofile.js +252 -0
- package/esm/models/index.d.ts +9 -0
- package/esm/models/index.js +9 -0
- package/esm/models/operations/gettaskclassifications.d.ts +4 -4
- package/esm/models/operations/gettaskclassifications.js +3 -3
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/listproviderendpoints.d.ts +106 -0
- package/esm/models/operations/listproviderendpoints.js +55 -0
- package/esm/models/providerendpoints.d.ts +34 -0
- package/esm/models/providerendpoints.js +32 -0
- package/esm/models/providerendpointsresponse.d.ts +11 -0
- package/esm/models/providerendpointsresponse.js +15 -0
- package/esm/models/providerendpointstats.d.ts +11 -0
- package/esm/models/providerendpointstats.js +17 -0
- package/esm/models/providerendpointstatsavailable.d.ts +66 -0
- package/esm/models/providerendpointstatsavailable.js +51 -0
- package/esm/models/providerendpointstatsunavailable.d.ts +10 -0
- package/esm/models/providerendpointstatsunavailable.js +14 -0
- package/esm/models/speechrequest.d.ts +45 -2
- package/esm/models/speechrequest.js +23 -0
- package/esm/models/sttrequest.d.ts +45 -2
- package/esm/models/sttrequest.js +23 -0
- package/esm/sdk/providers.d.ts +8 -0
- package/esm/sdk/providers.js +10 -0
- package/jsr.json +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
3
|
+
export type ListProviderEndpointsGlobals = {
|
|
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
|
+
/**
|
|
25
|
+
* Time window the provider-wide stats cover
|
|
26
|
+
*/
|
|
27
|
+
export declare const ListProviderEndpointsWindow: {
|
|
28
|
+
readonly Onehr: "1hr";
|
|
29
|
+
readonly Oned: "1d";
|
|
30
|
+
readonly Onew: "1w";
|
|
31
|
+
readonly Onemo: "1mo";
|
|
32
|
+
readonly Oney: "1y";
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Time window the provider-wide stats cover
|
|
36
|
+
*/
|
|
37
|
+
export type ListProviderEndpointsWindow = OpenEnum<typeof ListProviderEndpointsWindow>;
|
|
38
|
+
/**
|
|
39
|
+
* Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve
|
|
40
|
+
*/
|
|
41
|
+
export declare const PerfWorkload: {
|
|
42
|
+
readonly TextGeneration: "text_generation";
|
|
43
|
+
readonly ImageGeneration: "image_generation";
|
|
44
|
+
readonly VideoGeneration: "video_generation";
|
|
45
|
+
readonly Embeddings: "embeddings";
|
|
46
|
+
readonly Rerank: "rerank";
|
|
47
|
+
readonly TTS: "tts";
|
|
48
|
+
readonly STT: "stt";
|
|
49
|
+
readonly Decisions: "decisions";
|
|
50
|
+
readonly Extractions: "extractions";
|
|
51
|
+
readonly Unknown: "unknown";
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve
|
|
55
|
+
*/
|
|
56
|
+
export type PerfWorkload = OpenEnum<typeof PerfWorkload>;
|
|
57
|
+
export type ListProviderEndpointsRequest = {
|
|
58
|
+
/**
|
|
59
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* This is used to track API usage per application.
|
|
63
|
+
*/
|
|
64
|
+
httpReferer?: string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
*/
|
|
70
|
+
appTitle?: string | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
*/
|
|
76
|
+
appCategories?: string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* URL-friendly provider identifier (e.g. "openai", "fireworks")
|
|
79
|
+
*/
|
|
80
|
+
providerSlug: string;
|
|
81
|
+
/**
|
|
82
|
+
* Time window the provider-wide stats cover
|
|
83
|
+
*/
|
|
84
|
+
window?: ListProviderEndpointsWindow | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve
|
|
87
|
+
*/
|
|
88
|
+
perfWorkload?: PerfWorkload | undefined;
|
|
89
|
+
};
|
|
90
|
+
/** @internal */
|
|
91
|
+
export declare const ListProviderEndpointsWindow$outboundSchema: z.ZodType<string, ListProviderEndpointsWindow>;
|
|
92
|
+
/** @internal */
|
|
93
|
+
export declare const PerfWorkload$outboundSchema: z.ZodType<string, PerfWorkload>;
|
|
94
|
+
/** @internal */
|
|
95
|
+
export type ListProviderEndpointsRequest$Outbound = {
|
|
96
|
+
"HTTP-Referer"?: string | undefined;
|
|
97
|
+
appTitle?: string | undefined;
|
|
98
|
+
appCategories?: string | undefined;
|
|
99
|
+
provider_slug: string;
|
|
100
|
+
window: string;
|
|
101
|
+
perf_workload?: string | undefined;
|
|
102
|
+
};
|
|
103
|
+
/** @internal */
|
|
104
|
+
export declare const ListProviderEndpointsRequest$outboundSchema: z.ZodType<ListProviderEndpointsRequest$Outbound, ListProviderEndpointsRequest>;
|
|
105
|
+
export declare function listProviderEndpointsRequestToJSON(listProviderEndpointsRequest: ListProviderEndpointsRequest): string;
|
|
106
|
+
//# sourceMappingURL=listproviderendpoints.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 11ea9fe75522
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as openEnums from "../../types/enums.js";
|
|
8
|
+
/**
|
|
9
|
+
* Time window the provider-wide stats cover
|
|
10
|
+
*/
|
|
11
|
+
export const ListProviderEndpointsWindow = {
|
|
12
|
+
Onehr: "1hr",
|
|
13
|
+
Oned: "1d",
|
|
14
|
+
Onew: "1w",
|
|
15
|
+
Onemo: "1mo",
|
|
16
|
+
Oney: "1y",
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve
|
|
20
|
+
*/
|
|
21
|
+
export const PerfWorkload = {
|
|
22
|
+
TextGeneration: "text_generation",
|
|
23
|
+
ImageGeneration: "image_generation",
|
|
24
|
+
VideoGeneration: "video_generation",
|
|
25
|
+
Embeddings: "embeddings",
|
|
26
|
+
Rerank: "rerank",
|
|
27
|
+
TTS: "tts",
|
|
28
|
+
STT: "stt",
|
|
29
|
+
Decisions: "decisions",
|
|
30
|
+
Extractions: "extractions",
|
|
31
|
+
Unknown: "unknown",
|
|
32
|
+
};
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const ListProviderEndpointsWindow$outboundSchema = openEnums.outboundSchema(ListProviderEndpointsWindow);
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const PerfWorkload$outboundSchema = openEnums.outboundSchema(PerfWorkload);
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const ListProviderEndpointsRequest$outboundSchema = z.object({
|
|
39
|
+
httpReferer: z.string().optional(),
|
|
40
|
+
appTitle: z.string().optional(),
|
|
41
|
+
appCategories: z.string().optional(),
|
|
42
|
+
providerSlug: z.string(),
|
|
43
|
+
window: ListProviderEndpointsWindow$outboundSchema.default("1mo"),
|
|
44
|
+
perfWorkload: PerfWorkload$outboundSchema.optional(),
|
|
45
|
+
}).transform((v) => {
|
|
46
|
+
return remap$(v, {
|
|
47
|
+
httpReferer: "HTTP-Referer",
|
|
48
|
+
providerSlug: "provider_slug",
|
|
49
|
+
perfWorkload: "perf_workload",
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
export function listProviderEndpointsRequestToJSON(listProviderEndpointsRequest) {
|
|
53
|
+
return JSON.stringify(ListProviderEndpointsRequest$outboundSchema.parse(listProviderEndpointsRequest));
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=listproviderendpoints.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { EndpointSummary } from "./endpointsummary.js";
|
|
5
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
6
|
+
import { ProviderEndpointStats } from "./providerendpointstats.js";
|
|
7
|
+
/**
|
|
8
|
+
* Time window the provider-wide stats cover
|
|
9
|
+
*/
|
|
10
|
+
export declare const Window: {
|
|
11
|
+
readonly Onehr: "1hr";
|
|
12
|
+
readonly Oned: "1d";
|
|
13
|
+
readonly Onew: "1w";
|
|
14
|
+
readonly Onemo: "1mo";
|
|
15
|
+
readonly Oney: "1y";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Time window the provider-wide stats cover
|
|
19
|
+
*/
|
|
20
|
+
export type Window = OpenEnum<typeof Window>;
|
|
21
|
+
export type ProviderEndpoints = {
|
|
22
|
+
endpoints: Array<EndpointSummary>;
|
|
23
|
+
stats: ProviderEndpointStats;
|
|
24
|
+
/**
|
|
25
|
+
* Time window the provider-wide stats cover
|
|
26
|
+
*/
|
|
27
|
+
window: Window;
|
|
28
|
+
};
|
|
29
|
+
/** @internal */
|
|
30
|
+
export declare const Window$inboundSchema: z.ZodType<Window, unknown>;
|
|
31
|
+
/** @internal */
|
|
32
|
+
export declare const ProviderEndpoints$inboundSchema: z.ZodType<ProviderEndpoints, unknown>;
|
|
33
|
+
export declare function providerEndpointsFromJSON(jsonString: string): SafeParseResult<ProviderEndpoints, SDKValidationError>;
|
|
34
|
+
//# sourceMappingURL=providerendpoints.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 248051591265
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { EndpointSummary$inboundSchema, } from "./endpointsummary.js";
|
|
9
|
+
import { ProviderEndpointStats$inboundSchema, } from "./providerendpointstats.js";
|
|
10
|
+
/**
|
|
11
|
+
* Time window the provider-wide stats cover
|
|
12
|
+
*/
|
|
13
|
+
export const Window = {
|
|
14
|
+
Onehr: "1hr",
|
|
15
|
+
Oned: "1d",
|
|
16
|
+
Onew: "1w",
|
|
17
|
+
Onemo: "1mo",
|
|
18
|
+
Oney: "1y",
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const Window$inboundSchema = openEnums
|
|
22
|
+
.inboundSchema(Window);
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const ProviderEndpoints$inboundSchema = z.object({
|
|
25
|
+
endpoints: z.array(EndpointSummary$inboundSchema),
|
|
26
|
+
stats: ProviderEndpointStats$inboundSchema,
|
|
27
|
+
window: Window$inboundSchema,
|
|
28
|
+
});
|
|
29
|
+
export function providerEndpointsFromJSON(jsonString) {
|
|
30
|
+
return safeParse(jsonString, (x) => ProviderEndpoints$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProviderEndpoints' from JSON`);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=providerendpoints.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
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 { ProviderEndpoints } from "./providerendpoints.js";
|
|
5
|
+
export type ProviderEndpointsResponse = {
|
|
6
|
+
data: ProviderEndpoints;
|
|
7
|
+
};
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare const ProviderEndpointsResponse$inboundSchema: z.ZodType<ProviderEndpointsResponse, unknown>;
|
|
10
|
+
export declare function providerEndpointsResponseFromJSON(jsonString: string): SafeParseResult<ProviderEndpointsResponse, SDKValidationError>;
|
|
11
|
+
//# sourceMappingURL=providerendpointsresponse.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 7e6b90e2ebc2
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { ProviderEndpoints$inboundSchema, } from "./providerendpoints.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const ProviderEndpointsResponse$inboundSchema = z.object({
|
|
10
|
+
data: ProviderEndpoints$inboundSchema,
|
|
11
|
+
});
|
|
12
|
+
export function providerEndpointsResponseFromJSON(jsonString) {
|
|
13
|
+
return safeParse(jsonString, (x) => ProviderEndpointsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProviderEndpointsResponse' from JSON`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=providerendpointsresponse.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ProviderEndpointStatsAvailable } from "./providerendpointstatsavailable.js";
|
|
6
|
+
import { ProviderEndpointStatsUnavailable } from "./providerendpointstatsunavailable.js";
|
|
7
|
+
export type ProviderEndpointStats = ProviderEndpointStatsAvailable | ProviderEndpointStatsUnavailable | discriminatedUnionTypes.Unknown<"status">;
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare const ProviderEndpointStats$inboundSchema: z.ZodType<ProviderEndpointStats, unknown>;
|
|
10
|
+
export declare function providerEndpointStatsFromJSON(jsonString: string): SafeParseResult<ProviderEndpointStats, SDKValidationError>;
|
|
11
|
+
//# sourceMappingURL=providerendpointstats.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 0c878b38826c
|
|
4
|
+
*/
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
7
|
+
import { ProviderEndpointStatsAvailable$inboundSchema, } from "./providerendpointstatsavailable.js";
|
|
8
|
+
import { ProviderEndpointStatsUnavailable$inboundSchema, } from "./providerendpointstatsunavailable.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const ProviderEndpointStats$inboundSchema = discriminatedUnion("status", {
|
|
11
|
+
available: ProviderEndpointStatsAvailable$inboundSchema,
|
|
12
|
+
unavailable: ProviderEndpointStatsUnavailable$inboundSchema,
|
|
13
|
+
});
|
|
14
|
+
export function providerEndpointStatsFromJSON(jsonString) {
|
|
15
|
+
return safeParse(jsonString, (x) => ProviderEndpointStats$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProviderEndpointStats' from JSON`);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=providerendpointstats.js.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Request latency, milliseconds
|
|
6
|
+
*/
|
|
7
|
+
export type LatencyMs = {
|
|
8
|
+
p50: number | null;
|
|
9
|
+
p90: number | null;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Output tokens per second
|
|
13
|
+
*/
|
|
14
|
+
export type ThroughputTokensPerSecond = {
|
|
15
|
+
p50: number | null;
|
|
16
|
+
p90: number | null;
|
|
17
|
+
};
|
|
18
|
+
export type ProviderEndpointStatsAvailable = {
|
|
19
|
+
/**
|
|
20
|
+
* Endpoints the stats cover
|
|
21
|
+
*/
|
|
22
|
+
endpointCount: number;
|
|
23
|
+
/**
|
|
24
|
+
* Errored share of requests that count toward uptime, 0-100
|
|
25
|
+
*/
|
|
26
|
+
errorRatePercent: number;
|
|
27
|
+
/**
|
|
28
|
+
* Request latency, milliseconds
|
|
29
|
+
*/
|
|
30
|
+
latencyMs: LatencyMs;
|
|
31
|
+
/**
|
|
32
|
+
* Routing quality, 0-100
|
|
33
|
+
*/
|
|
34
|
+
qualityPercent: number | null;
|
|
35
|
+
/**
|
|
36
|
+
* Rate-limited share of routed requests, 0-100
|
|
37
|
+
*/
|
|
38
|
+
rateLimitedPercent: number | null;
|
|
39
|
+
/**
|
|
40
|
+
* Routing reliability, 0-100
|
|
41
|
+
*/
|
|
42
|
+
reliabilityPercent: number | null;
|
|
43
|
+
/**
|
|
44
|
+
* Requests in the window
|
|
45
|
+
*/
|
|
46
|
+
requests: number;
|
|
47
|
+
status: "available";
|
|
48
|
+
/**
|
|
49
|
+
* Output tokens per second
|
|
50
|
+
*/
|
|
51
|
+
throughputTokensPerSecond: ThroughputTokensPerSecond;
|
|
52
|
+
/**
|
|
53
|
+
* Successful share of requests that count toward uptime, 0-100
|
|
54
|
+
*/
|
|
55
|
+
uptimePercent: number | null;
|
|
56
|
+
};
|
|
57
|
+
/** @internal */
|
|
58
|
+
export declare const LatencyMs$inboundSchema: z.ZodType<LatencyMs, unknown>;
|
|
59
|
+
export declare function latencyMsFromJSON(jsonString: string): SafeParseResult<LatencyMs, SDKValidationError>;
|
|
60
|
+
/** @internal */
|
|
61
|
+
export declare const ThroughputTokensPerSecond$inboundSchema: z.ZodType<ThroughputTokensPerSecond, unknown>;
|
|
62
|
+
export declare function throughputTokensPerSecondFromJSON(jsonString: string): SafeParseResult<ThroughputTokensPerSecond, SDKValidationError>;
|
|
63
|
+
/** @internal */
|
|
64
|
+
export declare const ProviderEndpointStatsAvailable$inboundSchema: z.ZodType<ProviderEndpointStatsAvailable, unknown>;
|
|
65
|
+
export declare function providerEndpointStatsAvailableFromJSON(jsonString: string): SafeParseResult<ProviderEndpointStatsAvailable, SDKValidationError>;
|
|
66
|
+
//# sourceMappingURL=providerendpointstatsavailable.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 2d30fafcb067
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const LatencyMs$inboundSchema = z.object({
|
|
10
|
+
p50: z.nullable(z.number()),
|
|
11
|
+
p90: z.nullable(z.number()),
|
|
12
|
+
});
|
|
13
|
+
export function latencyMsFromJSON(jsonString) {
|
|
14
|
+
return safeParse(jsonString, (x) => LatencyMs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LatencyMs' from JSON`);
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const ThroughputTokensPerSecond$inboundSchema = z.object({
|
|
18
|
+
p50: z.nullable(z.number()),
|
|
19
|
+
p90: z.nullable(z.number()),
|
|
20
|
+
});
|
|
21
|
+
export function throughputTokensPerSecondFromJSON(jsonString) {
|
|
22
|
+
return safeParse(jsonString, (x) => ThroughputTokensPerSecond$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ThroughputTokensPerSecond' from JSON`);
|
|
23
|
+
}
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const ProviderEndpointStatsAvailable$inboundSchema = z.object({
|
|
26
|
+
endpoint_count: z.int(),
|
|
27
|
+
error_rate_percent: z.number(),
|
|
28
|
+
latency_ms: z.lazy(() => LatencyMs$inboundSchema),
|
|
29
|
+
quality_percent: z.nullable(z.number()),
|
|
30
|
+
rate_limited_percent: z.nullable(z.number()),
|
|
31
|
+
reliability_percent: z.nullable(z.number()),
|
|
32
|
+
requests: z.int(),
|
|
33
|
+
status: z.literal("available"),
|
|
34
|
+
throughput_tokens_per_second: z.lazy(() => ThroughputTokensPerSecond$inboundSchema),
|
|
35
|
+
uptime_percent: z.nullable(z.number()),
|
|
36
|
+
}).transform((v) => {
|
|
37
|
+
return remap$(v, {
|
|
38
|
+
"endpoint_count": "endpointCount",
|
|
39
|
+
"error_rate_percent": "errorRatePercent",
|
|
40
|
+
"latency_ms": "latencyMs",
|
|
41
|
+
"quality_percent": "qualityPercent",
|
|
42
|
+
"rate_limited_percent": "rateLimitedPercent",
|
|
43
|
+
"reliability_percent": "reliabilityPercent",
|
|
44
|
+
"throughput_tokens_per_second": "throughputTokensPerSecond",
|
|
45
|
+
"uptime_percent": "uptimePercent",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
export function providerEndpointStatsAvailableFromJSON(jsonString) {
|
|
49
|
+
return safeParse(jsonString, (x) => ProviderEndpointStatsAvailable$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProviderEndpointStatsAvailable' from JSON`);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=providerendpointstatsavailable.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
export type ProviderEndpointStatsUnavailable = {
|
|
5
|
+
status: "unavailable";
|
|
6
|
+
};
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const ProviderEndpointStatsUnavailable$inboundSchema: z.ZodType<ProviderEndpointStatsUnavailable, unknown>;
|
|
9
|
+
export declare function providerEndpointStatsUnavailableFromJSON(jsonString: string): SafeParseResult<ProviderEndpointStatsUnavailable, SDKValidationError>;
|
|
10
|
+
//# sourceMappingURL=providerendpointstatsunavailable.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f8a0fc50ae42
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const ProviderEndpointStatsUnavailable$inboundSchema = z.object({
|
|
9
|
+
status: z.literal("unavailable"),
|
|
10
|
+
});
|
|
11
|
+
export function providerEndpointStatsUnavailableFromJSON(jsonString) {
|
|
12
|
+
return safeParse(jsonString, (x) => ProviderEndpointStatsUnavailable$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProviderEndpointStatsUnavailable' from JSON`);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=providerendpointstatsunavailable.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { ProviderName } from "./providername.js";
|
|
3
4
|
import { ProviderOptions, ProviderOptions$Outbound } from "./provideroptions.js";
|
|
4
5
|
import { SpeechInput, SpeechInput$Outbound } from "./speechinput.js";
|
|
5
6
|
import { SpeechInputReference, SpeechInputReference$Outbound } from "./speechinputreference.js";
|
|
@@ -25,10 +26,21 @@ export declare const SpeechRequestDataCollection: {
|
|
|
25
26
|
* - deny: use only providers which do not collect user data.
|
|
26
27
|
*/
|
|
27
28
|
export type SpeechRequestDataCollection = OpenEnum<typeof SpeechRequestDataCollection>;
|
|
29
|
+
export type SpeechRequestIgnore = ProviderName | string;
|
|
30
|
+
export type SpeechRequestOnly = ProviderName | string;
|
|
31
|
+
export type SpeechRequestOrder = ProviderName | string;
|
|
28
32
|
/**
|
|
29
|
-
* Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
|
|
33
|
+
* Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
|
|
30
34
|
*/
|
|
31
35
|
export type SpeechRequestProvider = {
|
|
36
|
+
/**
|
|
37
|
+
* Whether to allow backup providers to serve requests
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
|
|
41
|
+
* - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
|
|
42
|
+
*/
|
|
43
|
+
allowFallbacks?: boolean | null | undefined;
|
|
32
44
|
/**
|
|
33
45
|
* Data collection setting. If no available model provider meets the requirement, your request will return an error.
|
|
34
46
|
*
|
|
@@ -38,10 +50,22 @@ export type SpeechRequestProvider = {
|
|
|
38
50
|
* - deny: use only providers which do not collect user data.
|
|
39
51
|
*/
|
|
40
52
|
dataCollection?: SpeechRequestDataCollection | null | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
|
|
55
|
+
*/
|
|
56
|
+
ignore?: Array<ProviderName | string> | null | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
|
|
59
|
+
*/
|
|
60
|
+
only?: Array<ProviderName | string> | null | undefined;
|
|
41
61
|
/**
|
|
42
62
|
* Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.
|
|
43
63
|
*/
|
|
44
64
|
options?: ProviderOptions | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
|
|
67
|
+
*/
|
|
68
|
+
order?: Array<ProviderName | string> | null | undefined;
|
|
45
69
|
/**
|
|
46
70
|
* Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.
|
|
47
71
|
*/
|
|
@@ -79,7 +103,7 @@ export type SpeechRequest = {
|
|
|
79
103
|
*/
|
|
80
104
|
model: string;
|
|
81
105
|
/**
|
|
82
|
-
* Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
|
|
106
|
+
* Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
|
|
83
107
|
*/
|
|
84
108
|
provider?: SpeechRequestProvider | undefined;
|
|
85
109
|
/**
|
|
@@ -110,9 +134,28 @@ export type SpeechRequest = {
|
|
|
110
134
|
/** @internal */
|
|
111
135
|
export declare const SpeechRequestDataCollection$outboundSchema: z.ZodType<string, SpeechRequestDataCollection>;
|
|
112
136
|
/** @internal */
|
|
137
|
+
export type SpeechRequestIgnore$Outbound = string | string;
|
|
138
|
+
/** @internal */
|
|
139
|
+
export declare const SpeechRequestIgnore$outboundSchema: z.ZodType<SpeechRequestIgnore$Outbound, SpeechRequestIgnore>;
|
|
140
|
+
export declare function speechRequestIgnoreToJSON(speechRequestIgnore: SpeechRequestIgnore): string;
|
|
141
|
+
/** @internal */
|
|
142
|
+
export type SpeechRequestOnly$Outbound = string | string;
|
|
143
|
+
/** @internal */
|
|
144
|
+
export declare const SpeechRequestOnly$outboundSchema: z.ZodType<SpeechRequestOnly$Outbound, SpeechRequestOnly>;
|
|
145
|
+
export declare function speechRequestOnlyToJSON(speechRequestOnly: SpeechRequestOnly): string;
|
|
146
|
+
/** @internal */
|
|
147
|
+
export type SpeechRequestOrder$Outbound = string | string;
|
|
148
|
+
/** @internal */
|
|
149
|
+
export declare const SpeechRequestOrder$outboundSchema: z.ZodType<SpeechRequestOrder$Outbound, SpeechRequestOrder>;
|
|
150
|
+
export declare function speechRequestOrderToJSON(speechRequestOrder: SpeechRequestOrder): string;
|
|
151
|
+
/** @internal */
|
|
113
152
|
export type SpeechRequestProvider$Outbound = {
|
|
153
|
+
allow_fallbacks?: boolean | null | undefined;
|
|
114
154
|
data_collection?: string | null | undefined;
|
|
155
|
+
ignore?: Array<string | string> | null | undefined;
|
|
156
|
+
only?: Array<string | string> | null | undefined;
|
|
115
157
|
options?: ProviderOptions$Outbound | undefined;
|
|
158
|
+
order?: Array<string | string> | null | undefined;
|
|
116
159
|
zdr?: boolean | null | undefined;
|
|
117
160
|
};
|
|
118
161
|
/** @internal */
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
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
|
+
import { ProviderName$outboundSchema } from "./providername.js";
|
|
8
9
|
import { ProviderOptions$outboundSchema, } from "./provideroptions.js";
|
|
9
10
|
import { SpeechInput$outboundSchema, } from "./speechinput.js";
|
|
10
11
|
import { SpeechInputReference$outboundSchema, } from "./speechinputreference.js";
|
|
@@ -31,13 +32,35 @@ export const SpeechRequestResponseFormat = {
|
|
|
31
32
|
/** @internal */
|
|
32
33
|
export const SpeechRequestDataCollection$outboundSchema = openEnums.outboundSchema(SpeechRequestDataCollection);
|
|
33
34
|
/** @internal */
|
|
35
|
+
export const SpeechRequestIgnore$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
36
|
+
export function speechRequestIgnoreToJSON(speechRequestIgnore) {
|
|
37
|
+
return JSON.stringify(SpeechRequestIgnore$outboundSchema.parse(speechRequestIgnore));
|
|
38
|
+
}
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const SpeechRequestOnly$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
41
|
+
export function speechRequestOnlyToJSON(speechRequestOnly) {
|
|
42
|
+
return JSON.stringify(SpeechRequestOnly$outboundSchema.parse(speechRequestOnly));
|
|
43
|
+
}
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const SpeechRequestOrder$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
46
|
+
export function speechRequestOrderToJSON(speechRequestOrder) {
|
|
47
|
+
return JSON.stringify(SpeechRequestOrder$outboundSchema.parse(speechRequestOrder));
|
|
48
|
+
}
|
|
49
|
+
/** @internal */
|
|
34
50
|
export const SpeechRequestProvider$outboundSchema = z.object({
|
|
51
|
+
allowFallbacks: z.nullable(z.boolean()).optional(),
|
|
35
52
|
dataCollection: z.nullable(SpeechRequestDataCollection$outboundSchema)
|
|
36
53
|
.optional(),
|
|
54
|
+
ignore: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))).optional(),
|
|
55
|
+
only: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
56
|
+
.optional(),
|
|
37
57
|
options: ProviderOptions$outboundSchema.optional(),
|
|
58
|
+
order: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
59
|
+
.optional(),
|
|
38
60
|
zdr: z.nullable(z.boolean()).optional(),
|
|
39
61
|
}).transform((v) => {
|
|
40
62
|
return remap$(v, {
|
|
63
|
+
allowFallbacks: "allow_fallbacks",
|
|
41
64
|
dataCollection: "data_collection",
|
|
42
65
|
});
|
|
43
66
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { ProviderName } from "./providername.js";
|
|
3
4
|
import { ProviderOptions, ProviderOptions$Outbound } from "./provideroptions.js";
|
|
4
5
|
import { STTInputAudio, STTInputAudio$Outbound } from "./sttinputaudio.js";
|
|
5
6
|
import { STTTimestampGranularity } from "./stttimestampgranularity.js";
|
|
@@ -25,10 +26,21 @@ export declare const STTRequestDataCollection: {
|
|
|
25
26
|
* - deny: use only providers which do not collect user data.
|
|
26
27
|
*/
|
|
27
28
|
export type STTRequestDataCollection = OpenEnum<typeof STTRequestDataCollection>;
|
|
29
|
+
export type STTRequestIgnore = ProviderName | string;
|
|
30
|
+
export type STTRequestOnly = ProviderName | string;
|
|
31
|
+
export type STTRequestOrder = ProviderName | string;
|
|
28
32
|
/**
|
|
29
|
-
* Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
|
|
33
|
+
* Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
|
|
30
34
|
*/
|
|
31
35
|
export type STTRequestProvider = {
|
|
36
|
+
/**
|
|
37
|
+
* Whether to allow backup providers to serve requests
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
|
|
41
|
+
* - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
|
|
42
|
+
*/
|
|
43
|
+
allowFallbacks?: boolean | null | undefined;
|
|
32
44
|
/**
|
|
33
45
|
* Data collection setting. If no available model provider meets the requirement, your request will return an error.
|
|
34
46
|
*
|
|
@@ -38,10 +50,22 @@ export type STTRequestProvider = {
|
|
|
38
50
|
* - deny: use only providers which do not collect user data.
|
|
39
51
|
*/
|
|
40
52
|
dataCollection?: STTRequestDataCollection | null | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
|
|
55
|
+
*/
|
|
56
|
+
ignore?: Array<ProviderName | string> | null | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
|
|
59
|
+
*/
|
|
60
|
+
only?: Array<ProviderName | string> | null | undefined;
|
|
41
61
|
/**
|
|
42
62
|
* Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.
|
|
43
63
|
*/
|
|
44
64
|
options?: ProviderOptions | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
|
|
67
|
+
*/
|
|
68
|
+
order?: Array<ProviderName | string> | null | undefined;
|
|
45
69
|
/**
|
|
46
70
|
* Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.
|
|
47
71
|
*/
|
|
@@ -83,7 +107,7 @@ export type STTRequest = {
|
|
|
83
107
|
*/
|
|
84
108
|
model: string;
|
|
85
109
|
/**
|
|
86
|
-
* Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
|
|
110
|
+
* Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
|
|
87
111
|
*/
|
|
88
112
|
provider?: STTRequestProvider | undefined;
|
|
89
113
|
/**
|
|
@@ -114,9 +138,28 @@ export type STTRequest = {
|
|
|
114
138
|
/** @internal */
|
|
115
139
|
export declare const STTRequestDataCollection$outboundSchema: z.ZodType<string, STTRequestDataCollection>;
|
|
116
140
|
/** @internal */
|
|
141
|
+
export type STTRequestIgnore$Outbound = string | string;
|
|
142
|
+
/** @internal */
|
|
143
|
+
export declare const STTRequestIgnore$outboundSchema: z.ZodType<STTRequestIgnore$Outbound, STTRequestIgnore>;
|
|
144
|
+
export declare function sttRequestIgnoreToJSON(sttRequestIgnore: STTRequestIgnore): string;
|
|
145
|
+
/** @internal */
|
|
146
|
+
export type STTRequestOnly$Outbound = string | string;
|
|
147
|
+
/** @internal */
|
|
148
|
+
export declare const STTRequestOnly$outboundSchema: z.ZodType<STTRequestOnly$Outbound, STTRequestOnly>;
|
|
149
|
+
export declare function sttRequestOnlyToJSON(sttRequestOnly: STTRequestOnly): string;
|
|
150
|
+
/** @internal */
|
|
151
|
+
export type STTRequestOrder$Outbound = string | string;
|
|
152
|
+
/** @internal */
|
|
153
|
+
export declare const STTRequestOrder$outboundSchema: z.ZodType<STTRequestOrder$Outbound, STTRequestOrder>;
|
|
154
|
+
export declare function sttRequestOrderToJSON(sttRequestOrder: STTRequestOrder): string;
|
|
155
|
+
/** @internal */
|
|
117
156
|
export type STTRequestProvider$Outbound = {
|
|
157
|
+
allow_fallbacks?: boolean | null | undefined;
|
|
118
158
|
data_collection?: string | null | undefined;
|
|
159
|
+
ignore?: Array<string | string> | null | undefined;
|
|
160
|
+
only?: Array<string | string> | null | undefined;
|
|
119
161
|
options?: ProviderOptions$Outbound | undefined;
|
|
162
|
+
order?: Array<string | string> | null | undefined;
|
|
120
163
|
zdr?: boolean | null | undefined;
|
|
121
164
|
};
|
|
122
165
|
/** @internal */
|