@openrouter/sdk 1.2.5 → 1.2.7
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/workspacesDeleteBudget.d.ts +1 -1
- package/esm/funcs/workspacesDeleteBudget.js +1 -1
- package/esm/funcs/workspacesGetBudget.d.ts +19 -0
- package/esm/funcs/workspacesGetBudget.js +107 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/getworkspacebudgetresponse.d.ts +15 -0
- package/esm/models/getworkspacebudgetresponse.js +21 -0
- package/esm/models/index.d.ts +5 -0
- package/esm/models/index.js +5 -0
- package/esm/models/operations/getworkspacebudget.d.ts +64 -0
- package/esm/models/operations/getworkspacebudget.js +23 -0
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.js +1 -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/esm/sdk/workspaces.d.ts +7 -0
- package/esm/sdk/workspaces.js +10 -0
- package/jsr.json +1 -1
- package/package.json +5 -5
|
@@ -15,5 +15,5 @@ import { Result } from "../types/fp.js";
|
|
|
15
15
|
* @remarks
|
|
16
16
|
* Remove the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
|
-
export declare function workspacesDeleteBudget(client: OpenRouterCore, request: operations.DeleteWorkspaceBudgetRequest, options?: RequestOptions): APIPromise<Result<models.DeleteWorkspaceBudgetResponse, errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
|
+
export declare function workspacesDeleteBudget(client: OpenRouterCore, request: operations.DeleteWorkspaceBudgetRequest, options?: RequestOptions): APIPromise<Result<models.DeleteWorkspaceBudgetResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=workspacesDeleteBudget.d.ts.map
|
|
@@ -98,7 +98,7 @@ async function $do(client, request, options) {
|
|
|
98
98
|
const responseFields = {
|
|
99
99
|
HttpMeta: { Response: response, Request: req },
|
|
100
100
|
};
|
|
101
|
-
const [result] = await M.match(M.json(200, models.DeleteWorkspaceBudgetResponse$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
101
|
+
const [result] = await M.match(M.json(200, models.DeleteWorkspaceBudgetResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
102
102
|
if (!result.ok) {
|
|
103
103
|
return [result, { status: "complete", request: req, response }];
|
|
104
104
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OpenRouterCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as models from "../models/index.js";
|
|
9
|
+
import * as operations from "../models/operations/index.js";
|
|
10
|
+
import { APIPromise } from "../types/async.js";
|
|
11
|
+
import { Result } from "../types/fp.js";
|
|
12
|
+
/**
|
|
13
|
+
* Get a workspace budget
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Retrieve the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
|
+
*/
|
|
18
|
+
export declare function workspacesGetBudget(client: OpenRouterCore, request: operations.GetWorkspaceBudgetRequest, options?: RequestOptions): APIPromise<Result<models.GetWorkspaceBudgetResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
|
+
//# sourceMappingURL=workspacesGetBudget.d.ts.map
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: cdb084566ab1
|
|
4
|
+
*/
|
|
5
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
6
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { APIPromise } from "../types/async.js";
|
|
16
|
+
/**
|
|
17
|
+
* Get a workspace budget
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Retrieve the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
21
|
+
*/
|
|
22
|
+
export function workspacesGetBudget(client, request, options) {
|
|
23
|
+
return new APIPromise($do(client, request, options));
|
|
24
|
+
}
|
|
25
|
+
async function $do(client, request, options) {
|
|
26
|
+
const parsed = safeParse(request, (value) => operations.GetWorkspaceBudgetRequest$outboundSchema.parse(value), "Input validation failed");
|
|
27
|
+
if (!parsed.ok) {
|
|
28
|
+
return [parsed, { status: "invalid" }];
|
|
29
|
+
}
|
|
30
|
+
const payload = parsed.value;
|
|
31
|
+
const body = null;
|
|
32
|
+
const pathParams = {
|
|
33
|
+
id: encodeSimple("id", payload.id, {
|
|
34
|
+
explode: false,
|
|
35
|
+
charEncoding: "percent",
|
|
36
|
+
}),
|
|
37
|
+
interval: encodeSimple("interval", payload.interval, {
|
|
38
|
+
explode: false,
|
|
39
|
+
charEncoding: "percent",
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
const path = pathToFunc("/workspaces/{id}/budgets/{interval}")(pathParams);
|
|
43
|
+
const headers = new Headers(compactMap({
|
|
44
|
+
Accept: "application/json",
|
|
45
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
46
|
+
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
47
|
+
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
48
|
+
}));
|
|
49
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
50
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
51
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
52
|
+
const context = {
|
|
53
|
+
options: client._options,
|
|
54
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
55
|
+
operationID: "getWorkspaceBudget",
|
|
56
|
+
oAuth2Scopes: null,
|
|
57
|
+
resolvedSecurity: requestSecurity,
|
|
58
|
+
securitySource: client._options.apiKey,
|
|
59
|
+
retryConfig: options?.retries
|
|
60
|
+
|| client._options.retryConfig
|
|
61
|
+
|| {
|
|
62
|
+
strategy: "backoff",
|
|
63
|
+
backoff: {
|
|
64
|
+
initialInterval: 500,
|
|
65
|
+
maxInterval: 60000,
|
|
66
|
+
exponent: 1.5,
|
|
67
|
+
maxElapsedTime: 3600000,
|
|
68
|
+
},
|
|
69
|
+
retryConnectionErrors: true,
|
|
70
|
+
}
|
|
71
|
+
|| { strategy: "none" },
|
|
72
|
+
retryCodes: options?.retryCodes || ["5XX"],
|
|
73
|
+
};
|
|
74
|
+
const requestRes = client._createRequest(context, {
|
|
75
|
+
security: requestSecurity,
|
|
76
|
+
method: "GET",
|
|
77
|
+
baseURL: options?.serverURL,
|
|
78
|
+
path: path,
|
|
79
|
+
headers: headers,
|
|
80
|
+
body: body,
|
|
81
|
+
userAgent: client._options.userAgent,
|
|
82
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
83
|
+
}, options);
|
|
84
|
+
if (!requestRes.ok) {
|
|
85
|
+
return [requestRes, { status: "invalid" }];
|
|
86
|
+
}
|
|
87
|
+
const req = requestRes.value;
|
|
88
|
+
const doResult = await client._do(req, {
|
|
89
|
+
context,
|
|
90
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
91
|
+
retryConfig: context.retryConfig,
|
|
92
|
+
retryCodes: context.retryCodes,
|
|
93
|
+
});
|
|
94
|
+
if (!doResult.ok) {
|
|
95
|
+
return [doResult, { status: "request-error", request: req }];
|
|
96
|
+
}
|
|
97
|
+
const response = doResult.value;
|
|
98
|
+
const responseFields = {
|
|
99
|
+
HttpMeta: { Response: response, Request: req },
|
|
100
|
+
};
|
|
101
|
+
const [result] = await M.match(M.json(200, models.GetWorkspaceBudgetResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
102
|
+
if (!result.ok) {
|
|
103
|
+
return [result, { status: "complete", request: req, response }];
|
|
104
|
+
}
|
|
105
|
+
return [result, { status: "complete", request: req, response }];
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=workspacesGetBudget.js.map
|
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.7";
|
|
53
53
|
readonly genVersion: "2.914.0";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.7 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.7",
|
|
30
30
|
genVersion: "2.914.0",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 1.2.7 2.914.0 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
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 { WorkspaceBudget } from "./workspacebudget.js";
|
|
5
|
+
export type GetWorkspaceBudgetResponse = {
|
|
6
|
+
data: WorkspaceBudget;
|
|
7
|
+
/**
|
|
8
|
+
* Whether BYOK (bring-your-own-key) spend is included when enforcing the workspace's budgets. This is a workspace-wide setting that applies to all budget intervals (daily, weekly, monthly, and lifetime).
|
|
9
|
+
*/
|
|
10
|
+
includeByokInBudgets?: boolean | undefined;
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare const GetWorkspaceBudgetResponse$inboundSchema: z.ZodType<GetWorkspaceBudgetResponse, unknown>;
|
|
14
|
+
export declare function getWorkspaceBudgetResponseFromJSON(jsonString: string): SafeParseResult<GetWorkspaceBudgetResponse, SDKValidationError>;
|
|
15
|
+
//# sourceMappingURL=getworkspacebudgetresponse.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ccd40e25fb1b
|
|
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
|
+
import { WorkspaceBudget$inboundSchema, } from "./workspacebudget.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const GetWorkspaceBudgetResponse$inboundSchema = z.object({
|
|
11
|
+
data: WorkspaceBudget$inboundSchema,
|
|
12
|
+
include_byok_in_budgets: z.boolean().optional(),
|
|
13
|
+
}).transform((v) => {
|
|
14
|
+
return remap$(v, {
|
|
15
|
+
"include_byok_in_budgets": "includeByokInBudgets",
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
export function getWorkspaceBudgetResponseFromJSON(jsonString) {
|
|
19
|
+
return safeParse(jsonString, (x) => GetWorkspaceBudgetResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetWorkspaceBudgetResponse' from JSON`);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=getworkspacebudgetresponse.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -237,6 +237,7 @@ export * from "./getobservabilitydestinationresponse.js";
|
|
|
237
237
|
export * from "./getpresetresponse.js";
|
|
238
238
|
export * from "./getpresetversionresponse.js";
|
|
239
239
|
export * from "./getscimgroupmappingresponse.js";
|
|
240
|
+
export * from "./getworkspacebudgetresponse.js";
|
|
240
241
|
export * from "./getworkspaceresponse.js";
|
|
241
242
|
export * from "./guardrail.js";
|
|
242
243
|
export * from "./guardrailinterval.js";
|
|
@@ -495,6 +496,10 @@ export * from "./shellservertoolconfig.js";
|
|
|
495
496
|
export * from "./shellservertoolengine.js";
|
|
496
497
|
export * from "./shellservertoolenvironment.js";
|
|
497
498
|
export * from "./shellservertoolopenrouter.js";
|
|
499
|
+
export * from "./speechinputreference.js";
|
|
500
|
+
export * from "./speechinputreferenceaudio.js";
|
|
501
|
+
export * from "./speechinputreferenceaudioinput.js";
|
|
502
|
+
export * from "./speechinputreferencetext.js";
|
|
498
503
|
export * from "./speechrequest.js";
|
|
499
504
|
export * from "./stopservertoolswhencondition.js";
|
|
500
505
|
export * from "./stopservertoolswhenfinishreasonis.js";
|
package/esm/models/index.js
CHANGED
|
@@ -241,6 +241,7 @@ export * from "./getobservabilitydestinationresponse.js";
|
|
|
241
241
|
export * from "./getpresetresponse.js";
|
|
242
242
|
export * from "./getpresetversionresponse.js";
|
|
243
243
|
export * from "./getscimgroupmappingresponse.js";
|
|
244
|
+
export * from "./getworkspacebudgetresponse.js";
|
|
244
245
|
export * from "./getworkspaceresponse.js";
|
|
245
246
|
export * from "./guardrail.js";
|
|
246
247
|
export * from "./guardrailinterval.js";
|
|
@@ -499,6 +500,10 @@ export * from "./shellservertoolconfig.js";
|
|
|
499
500
|
export * from "./shellservertoolengine.js";
|
|
500
501
|
export * from "./shellservertoolenvironment.js";
|
|
501
502
|
export * from "./shellservertoolopenrouter.js";
|
|
503
|
+
export * from "./speechinputreference.js";
|
|
504
|
+
export * from "./speechinputreferenceaudio.js";
|
|
505
|
+
export * from "./speechinputreferenceaudioinput.js";
|
|
506
|
+
export * from "./speechinputreferencetext.js";
|
|
502
507
|
export * from "./speechrequest.js";
|
|
503
508
|
export * from "./stopservertoolswhencondition.js";
|
|
504
509
|
export * from "./stopservertoolswhenfinishreasonis.js";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import * as models from "../index.js";
|
|
3
|
+
export type GetWorkspaceBudgetGlobals = {
|
|
4
|
+
/**
|
|
5
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* This is used to track API usage per application.
|
|
9
|
+
*/
|
|
10
|
+
httpReferer?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
*/
|
|
16
|
+
appTitle?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
*/
|
|
22
|
+
appCategories?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
export type GetWorkspaceBudgetRequest = {
|
|
25
|
+
/**
|
|
26
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* This is used to track API usage per application.
|
|
30
|
+
*/
|
|
31
|
+
httpReferer?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
*/
|
|
37
|
+
appTitle?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
*/
|
|
43
|
+
appCategories?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* The workspace ID (UUID) or slug
|
|
46
|
+
*/
|
|
47
|
+
id: string;
|
|
48
|
+
/**
|
|
49
|
+
* Budget reset interval. Use "lifetime" for a one-time budget that never resets.
|
|
50
|
+
*/
|
|
51
|
+
interval: models.WorkspaceBudgetInterval;
|
|
52
|
+
};
|
|
53
|
+
/** @internal */
|
|
54
|
+
export type GetWorkspaceBudgetRequest$Outbound = {
|
|
55
|
+
"HTTP-Referer"?: string | undefined;
|
|
56
|
+
appTitle?: string | undefined;
|
|
57
|
+
appCategories?: string | undefined;
|
|
58
|
+
id: string;
|
|
59
|
+
interval: string;
|
|
60
|
+
};
|
|
61
|
+
/** @internal */
|
|
62
|
+
export declare const GetWorkspaceBudgetRequest$outboundSchema: z.ZodType<GetWorkspaceBudgetRequest$Outbound, GetWorkspaceBudgetRequest>;
|
|
63
|
+
export declare function getWorkspaceBudgetRequestToJSON(getWorkspaceBudgetRequest: GetWorkspaceBudgetRequest): string;
|
|
64
|
+
//# sourceMappingURL=getworkspacebudget.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 0979c0e7d04e
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const GetWorkspaceBudgetRequest$outboundSchema = z.object({
|
|
10
|
+
httpReferer: z.string().optional(),
|
|
11
|
+
appTitle: z.string().optional(),
|
|
12
|
+
appCategories: z.string().optional(),
|
|
13
|
+
id: z.string(),
|
|
14
|
+
interval: models.WorkspaceBudgetInterval$outboundSchema,
|
|
15
|
+
}).transform((v) => {
|
|
16
|
+
return remap$(v, {
|
|
17
|
+
httpReferer: "HTTP-Referer",
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
export function getWorkspaceBudgetRequestToJSON(getWorkspaceBudgetRequest) {
|
|
21
|
+
return JSON.stringify(GetWorkspaceBudgetRequest$outboundSchema.parse(getWorkspaceBudgetRequest));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=getworkspacebudget.js.map
|
|
@@ -53,6 +53,7 @@ export * from "./gettaskclassifications.js";
|
|
|
53
53
|
export * from "./getuseractivity.js";
|
|
54
54
|
export * from "./getvideos.js";
|
|
55
55
|
export * from "./getworkspace.js";
|
|
56
|
+
export * from "./getworkspacebudget.js";
|
|
56
57
|
export * from "./list.js";
|
|
57
58
|
export * from "./listbyokkeys.js";
|
|
58
59
|
export * from "./listembeddingsmodels.js";
|
|
@@ -57,6 +57,7 @@ export * from "./gettaskclassifications.js";
|
|
|
57
57
|
export * from "./getuseractivity.js";
|
|
58
58
|
export * from "./getvideos.js";
|
|
59
59
|
export * from "./getworkspace.js";
|
|
60
|
+
export * from "./getworkspacebudget.js";
|
|
60
61
|
export * from "./list.js";
|
|
61
62
|
export * from "./listbyokkeys.js";
|
|
62
63
|
export * from "./listembeddingsmodels.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/esm/sdk/workspaces.d.ts
CHANGED
|
@@ -54,6 +54,13 @@ export declare class Workspaces extends ClientSDK {
|
|
|
54
54
|
* Remove the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
55
55
|
*/
|
|
56
56
|
deleteBudget(request: operations.DeleteWorkspaceBudgetRequest, options?: RequestOptions): Promise<models.DeleteWorkspaceBudgetResponse>;
|
|
57
|
+
/**
|
|
58
|
+
* Get a workspace budget
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* Retrieve the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
62
|
+
*/
|
|
63
|
+
getBudget(request: operations.GetWorkspaceBudgetRequest, options?: RequestOptions): Promise<models.GetWorkspaceBudgetResponse>;
|
|
57
64
|
/**
|
|
58
65
|
* Create or update a workspace budget
|
|
59
66
|
*
|
package/esm/sdk/workspaces.js
CHANGED
|
@@ -8,6 +8,7 @@ import { workspacesCreate } from "../funcs/workspacesCreate.js";
|
|
|
8
8
|
import { workspacesDelete } from "../funcs/workspacesDelete.js";
|
|
9
9
|
import { workspacesDeleteBudget } from "../funcs/workspacesDeleteBudget.js";
|
|
10
10
|
import { workspacesGet } from "../funcs/workspacesGet.js";
|
|
11
|
+
import { workspacesGetBudget } from "../funcs/workspacesGetBudget.js";
|
|
11
12
|
import { workspacesList } from "../funcs/workspacesList.js";
|
|
12
13
|
import { workspacesListBudgets } from "../funcs/workspacesListBudgets.js";
|
|
13
14
|
import { workspacesListMembers } from "../funcs/workspacesListMembers.js";
|
|
@@ -80,6 +81,15 @@ export class Workspaces extends ClientSDK {
|
|
|
80
81
|
async deleteBudget(request, options) {
|
|
81
82
|
return unwrapAsync(workspacesDeleteBudget(this, request, options));
|
|
82
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Get a workspace budget
|
|
86
|
+
*
|
|
87
|
+
* @remarks
|
|
88
|
+
* Retrieve the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
89
|
+
*/
|
|
90
|
+
async getBudget(request, options) {
|
|
91
|
+
return unwrapAsync(workspacesGetBudget(this, request, options));
|
|
92
|
+
}
|
|
83
93
|
/**
|
|
84
94
|
* Create or update a workspace budget
|
|
85
95
|
*
|
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.7",
|
|
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
|
-
"prepare": "npm run build",
|
|
78
78
|
"test": "vitest --run --project unit",
|
|
79
79
|
"test:watch": "vitest --watch --project unit",
|
|
80
|
-
"typecheck": "tsc --noEmit",
|
|
81
80
|
"typecheck:transit": "exit 0",
|
|
82
|
-
"
|
|
81
|
+
"prepare": "npm run build",
|
|
83
82
|
"test:e2e": "vitest --run --project e2e",
|
|
84
|
-
"test:transit": "exit 0"
|
|
83
|
+
"test:transit": "exit 0",
|
|
84
|
+
"typecheck": "tsc --noEmit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|