@openrouter/sdk 0.13.50 → 0.13.52
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/workspacesBulkRemoveMembers.d.ts +1 -1
- package/esm/funcs/workspacesBulkRemoveMembers.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/chatusage.d.ts +1 -20
- package/esm/models/chatusage.js +3 -16
- package/esm/models/createguardrailrequest.d.ts +7 -2
- package/esm/models/createguardrailrequest.js +2 -0
- package/esm/models/guardrail.d.ts +6 -2
- package/esm/models/guardrail.js +2 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/servertoolusedetails.d.ts +24 -0
- package/esm/models/servertoolusedetails.js +23 -0
- package/esm/models/updateguardrailrequest.d.ts +7 -2
- package/esm/models/updateguardrailrequest.js +2 -0
- package/esm/models/usage.d.ts +5 -0
- package/esm/models/usage.js +4 -0
- package/esm/sdk/workspaces.d.ts +1 -1
- package/esm/sdk/workspaces.js +1 -1
- package/jsr.json +1 -1
- package/package.json +8 -8
|
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
|
|
|
13
13
|
* Bulk remove members from a workspace
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
|
+
* Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
18
|
export declare function workspacesBulkRemoveMembers(client: OpenRouterCore, request: operations.BulkRemoveWorkspaceMembersRequest, options?: RequestOptions): APIPromise<Result<models.BulkRemoveWorkspaceMembersResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=workspacesBulkRemoveMembers.d.ts.map
|
|
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
17
17
|
* Bulk remove members from a workspace
|
|
18
18
|
*
|
|
19
19
|
* @remarks
|
|
20
|
-
* Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
20
|
+
* Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
21
21
|
*/
|
|
22
22
|
export function workspacesBulkRemoveMembers(client, request, options) {
|
|
23
23
|
return new APIPromise($do(client, request, options));
|
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: "0.13.
|
|
52
|
+
readonly sdkVersion: "0.13.52";
|
|
53
53
|
readonly genVersion: "2.884.4";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.52 2.884.4 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: "0.13.
|
|
29
|
+
sdkVersion: "0.13.52",
|
|
30
30
|
genVersion: "2.884.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.52 2.884.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { CostDetails } from "./costdetails.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ServerToolUseDetails } from "./servertoolusedetails.js";
|
|
5
6
|
/**
|
|
6
7
|
* Detailed completion token usage
|
|
7
8
|
*/
|
|
@@ -44,23 +45,6 @@ export type ChatUsagePromptTokensDetails = {
|
|
|
44
45
|
*/
|
|
45
46
|
videoTokens?: number | undefined;
|
|
46
47
|
};
|
|
47
|
-
/**
|
|
48
|
-
* Usage for server-side tool execution (e.g., web search)
|
|
49
|
-
*/
|
|
50
|
-
export type ServerToolUseDetails = {
|
|
51
|
-
/**
|
|
52
|
-
* Number of OpenRouter server tool calls that executed and produced a result
|
|
53
|
-
*/
|
|
54
|
-
toolCallsExecuted?: number | null | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here.
|
|
57
|
-
*/
|
|
58
|
-
toolCallsRequested?: number | null | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two.
|
|
61
|
-
*/
|
|
62
|
-
webSearchRequests?: number | null | undefined;
|
|
63
|
-
};
|
|
64
48
|
/**
|
|
65
49
|
* Token usage statistics
|
|
66
50
|
*/
|
|
@@ -109,9 +93,6 @@ export declare function chatUsageCompletionTokensDetailsFromJSON(jsonString: str
|
|
|
109
93
|
export declare const ChatUsagePromptTokensDetails$inboundSchema: z.ZodType<ChatUsagePromptTokensDetails, unknown>;
|
|
110
94
|
export declare function chatUsagePromptTokensDetailsFromJSON(jsonString: string): SafeParseResult<ChatUsagePromptTokensDetails, SDKValidationError>;
|
|
111
95
|
/** @internal */
|
|
112
|
-
export declare const ServerToolUseDetails$inboundSchema: z.ZodType<ServerToolUseDetails, unknown>;
|
|
113
|
-
export declare function serverToolUseDetailsFromJSON(jsonString: string): SafeParseResult<ServerToolUseDetails, SDKValidationError>;
|
|
114
|
-
/** @internal */
|
|
115
96
|
export declare const ChatUsage$inboundSchema: z.ZodType<ChatUsage, unknown>;
|
|
116
97
|
export declare function chatUsageFromJSON(jsonString: string): SafeParseResult<ChatUsage, SDKValidationError>;
|
|
117
98
|
//# sourceMappingURL=chatusage.d.ts.map
|
package/esm/models/chatusage.js
CHANGED
|
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { CostDetails$inboundSchema } from "./costdetails.js";
|
|
9
|
+
import { ServerToolUseDetails$inboundSchema, } from "./servertoolusedetails.js";
|
|
9
10
|
/** @internal */
|
|
10
11
|
export const ChatUsageCompletionTokensDetails$inboundSchema = z.object({
|
|
11
12
|
accepted_prediction_tokens: z.nullable(z.int()).optional(),
|
|
@@ -41,21 +42,6 @@ export function chatUsagePromptTokensDetailsFromJSON(jsonString) {
|
|
|
41
42
|
return safeParse(jsonString, (x) => ChatUsagePromptTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatUsagePromptTokensDetails' from JSON`);
|
|
42
43
|
}
|
|
43
44
|
/** @internal */
|
|
44
|
-
export const ServerToolUseDetails$inboundSchema = z.object({
|
|
45
|
-
tool_calls_executed: z.nullable(z.int()).optional(),
|
|
46
|
-
tool_calls_requested: z.nullable(z.int()).optional(),
|
|
47
|
-
web_search_requests: z.nullable(z.int()).optional(),
|
|
48
|
-
}).transform((v) => {
|
|
49
|
-
return remap$(v, {
|
|
50
|
-
"tool_calls_executed": "toolCallsExecuted",
|
|
51
|
-
"tool_calls_requested": "toolCallsRequested",
|
|
52
|
-
"web_search_requests": "webSearchRequests",
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
export function serverToolUseDetailsFromJSON(jsonString) {
|
|
56
|
-
return safeParse(jsonString, (x) => ServerToolUseDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ServerToolUseDetails' from JSON`);
|
|
57
|
-
}
|
|
58
|
-
/** @internal */
|
|
59
45
|
export const ChatUsage$inboundSchema = z.object({
|
|
60
46
|
completion_tokens: z.int(),
|
|
61
47
|
completion_tokens_details: z.nullable(z.lazy(() => ChatUsageCompletionTokensDetails$inboundSchema)).optional(),
|
|
@@ -64,7 +50,8 @@ export const ChatUsage$inboundSchema = z.object({
|
|
|
64
50
|
is_byok: z.boolean().optional(),
|
|
65
51
|
prompt_tokens: z.int(),
|
|
66
52
|
prompt_tokens_details: z.nullable(z.lazy(() => ChatUsagePromptTokensDetails$inboundSchema)).optional(),
|
|
67
|
-
server_tool_use_details: z.nullable(
|
|
53
|
+
server_tool_use_details: z.nullable(ServerToolUseDetails$inboundSchema)
|
|
54
|
+
.optional(),
|
|
68
55
|
total_tokens: z.int(),
|
|
69
56
|
}).transform((v) => {
|
|
70
57
|
return remap$(v, {
|
|
@@ -24,7 +24,7 @@ export type CreateGuardrailRequest = {
|
|
|
24
24
|
*/
|
|
25
25
|
description?: string | null | undefined;
|
|
26
26
|
/**
|
|
27
|
-
* Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
|
|
27
|
+
* Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
|
|
28
28
|
*
|
|
29
29
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
30
30
|
*/
|
|
@@ -42,9 +42,13 @@ export type CreateGuardrailRequest = {
|
|
|
42
42
|
*/
|
|
43
43
|
enforceZdrOpenai?: boolean | null | undefined;
|
|
44
44
|
/**
|
|
45
|
-
* Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or
|
|
45
|
+
* Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.
|
|
46
46
|
*/
|
|
47
47
|
enforceZdrOther?: boolean | null | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.
|
|
50
|
+
*/
|
|
51
|
+
enforceZdrXai?: boolean | null | undefined;
|
|
48
52
|
/**
|
|
49
53
|
* Array of model identifiers to exclude from routing (slug or canonical_slug accepted)
|
|
50
54
|
*/
|
|
@@ -82,6 +86,7 @@ export type CreateGuardrailRequest$Outbound = {
|
|
|
82
86
|
enforce_zdr_google?: boolean | null | undefined;
|
|
83
87
|
enforce_zdr_openai?: boolean | null | undefined;
|
|
84
88
|
enforce_zdr_other?: boolean | null | undefined;
|
|
89
|
+
enforce_zdr_xai?: boolean | null | undefined;
|
|
85
90
|
ignored_models?: Array<string> | null | undefined;
|
|
86
91
|
ignored_providers?: Array<string> | null | undefined;
|
|
87
92
|
limit_usd?: number | null | undefined;
|
|
@@ -20,6 +20,7 @@ export const CreateGuardrailRequest$outboundSchema = z.object({
|
|
|
20
20
|
enforceZdrGoogle: z.nullable(z.boolean()).optional(),
|
|
21
21
|
enforceZdrOpenai: z.nullable(z.boolean()).optional(),
|
|
22
22
|
enforceZdrOther: z.nullable(z.boolean()).optional(),
|
|
23
|
+
enforceZdrXai: z.nullable(z.boolean()).optional(),
|
|
23
24
|
ignoredModels: z.nullable(z.array(z.string())).optional(),
|
|
24
25
|
ignoredProviders: z.nullable(z.array(z.string())).optional(),
|
|
25
26
|
limitUsd: z.nullable(z.number()).optional(),
|
|
@@ -37,6 +38,7 @@ export const CreateGuardrailRequest$outboundSchema = z.object({
|
|
|
37
38
|
enforceZdrGoogle: "enforce_zdr_google",
|
|
38
39
|
enforceZdrOpenai: "enforce_zdr_openai",
|
|
39
40
|
enforceZdrOther: "enforce_zdr_other",
|
|
41
|
+
enforceZdrXai: "enforce_zdr_xai",
|
|
40
42
|
ignoredModels: "ignored_models",
|
|
41
43
|
ignoredProviders: "ignored_providers",
|
|
42
44
|
limitUsd: "limit_usd",
|
|
@@ -30,7 +30,7 @@ export type Guardrail = {
|
|
|
30
30
|
*/
|
|
31
31
|
description?: string | null | undefined;
|
|
32
32
|
/**
|
|
33
|
-
* Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
|
|
33
|
+
* Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
|
|
34
34
|
*
|
|
35
35
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
36
36
|
*/
|
|
@@ -48,9 +48,13 @@ export type Guardrail = {
|
|
|
48
48
|
*/
|
|
49
49
|
enforceZdrOpenai?: boolean | null | undefined;
|
|
50
50
|
/**
|
|
51
|
-
* Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or
|
|
51
|
+
* Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.
|
|
52
52
|
*/
|
|
53
53
|
enforceZdrOther?: boolean | null | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.
|
|
56
|
+
*/
|
|
57
|
+
enforceZdrXai?: boolean | null | undefined;
|
|
54
58
|
/**
|
|
55
59
|
* Unique identifier for the guardrail
|
|
56
60
|
*/
|
package/esm/models/guardrail.js
CHANGED
|
@@ -22,6 +22,7 @@ export const Guardrail$inboundSchema = z.object({
|
|
|
22
22
|
enforce_zdr_google: z.nullable(z.boolean()).optional(),
|
|
23
23
|
enforce_zdr_openai: z.nullable(z.boolean()).optional(),
|
|
24
24
|
enforce_zdr_other: z.nullable(z.boolean()).optional(),
|
|
25
|
+
enforce_zdr_xai: z.nullable(z.boolean()).optional(),
|
|
25
26
|
id: z.string(),
|
|
26
27
|
ignored_models: z.nullable(z.array(z.string())).optional(),
|
|
27
28
|
ignored_providers: z.nullable(z.array(z.string())).optional(),
|
|
@@ -42,6 +43,7 @@ export const Guardrail$inboundSchema = z.object({
|
|
|
42
43
|
"enforce_zdr_google": "enforceZdrGoogle",
|
|
43
44
|
"enforce_zdr_openai": "enforceZdrOpenai",
|
|
44
45
|
"enforce_zdr_other": "enforceZdrOther",
|
|
46
|
+
"enforce_zdr_xai": "enforceZdrXai",
|
|
45
47
|
"ignored_models": "ignoredModels",
|
|
46
48
|
"ignored_providers": "ignoredProviders",
|
|
47
49
|
"limit_usd": "limitUsd",
|
package/esm/models/index.d.ts
CHANGED
|
@@ -458,6 +458,7 @@ export * from "./searchmodelsservertoolconfig.js";
|
|
|
458
458
|
export * from "./searchmodelsservertoolopenrouter.js";
|
|
459
459
|
export * from "./searchqualitylevel.js";
|
|
460
460
|
export * from "./security.js";
|
|
461
|
+
export * from "./servertoolusedetails.js";
|
|
461
462
|
export * from "./serviceunavailableresponseerrordata.js";
|
|
462
463
|
export * from "./shellcallitem.js";
|
|
463
464
|
export * from "./shellcalloutputitem.js";
|
package/esm/models/index.js
CHANGED
|
@@ -462,6 +462,7 @@ export * from "./searchmodelsservertoolconfig.js";
|
|
|
462
462
|
export * from "./searchmodelsservertoolopenrouter.js";
|
|
463
463
|
export * from "./searchqualitylevel.js";
|
|
464
464
|
export * from "./security.js";
|
|
465
|
+
export * from "./servertoolusedetails.js";
|
|
465
466
|
export * from "./serviceunavailableresponseerrordata.js";
|
|
466
467
|
export * from "./shellcallitem.js";
|
|
467
468
|
export * from "./shellcalloutputitem.js";
|
|
@@ -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
|
+
/**
|
|
5
|
+
* Usage for server-side tool execution (e.g., web search)
|
|
6
|
+
*/
|
|
7
|
+
export type ServerToolUseDetails = {
|
|
8
|
+
/**
|
|
9
|
+
* Number of OpenRouter server tool calls that executed and produced a result.
|
|
10
|
+
*/
|
|
11
|
+
toolCallsExecuted?: number | null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here.
|
|
14
|
+
*/
|
|
15
|
+
toolCallsRequested?: number | null | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two.
|
|
18
|
+
*/
|
|
19
|
+
webSearchRequests?: number | null | undefined;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const ServerToolUseDetails$inboundSchema: z.ZodType<ServerToolUseDetails, unknown>;
|
|
23
|
+
export declare function serverToolUseDetailsFromJSON(jsonString: string): SafeParseResult<ServerToolUseDetails, SDKValidationError>;
|
|
24
|
+
//# sourceMappingURL=servertoolusedetails.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 5d4b052ad0ed
|
|
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 ServerToolUseDetails$inboundSchema = z.object({
|
|
10
|
+
tool_calls_executed: z.nullable(z.int()).optional(),
|
|
11
|
+
tool_calls_requested: z.nullable(z.int()).optional(),
|
|
12
|
+
web_search_requests: z.nullable(z.int()).optional(),
|
|
13
|
+
}).transform((v) => {
|
|
14
|
+
return remap$(v, {
|
|
15
|
+
"tool_calls_executed": "toolCallsExecuted",
|
|
16
|
+
"tool_calls_requested": "toolCallsRequested",
|
|
17
|
+
"web_search_requests": "webSearchRequests",
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
export function serverToolUseDetailsFromJSON(jsonString) {
|
|
21
|
+
return safeParse(jsonString, (x) => ServerToolUseDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ServerToolUseDetails' from JSON`);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=servertoolusedetails.js.map
|
|
@@ -24,7 +24,7 @@ export type UpdateGuardrailRequest = {
|
|
|
24
24
|
*/
|
|
25
25
|
description?: string | null | undefined;
|
|
26
26
|
/**
|
|
27
|
-
* Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
|
|
27
|
+
* Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
|
|
28
28
|
*
|
|
29
29
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
30
30
|
*/
|
|
@@ -42,9 +42,13 @@ export type UpdateGuardrailRequest = {
|
|
|
42
42
|
*/
|
|
43
43
|
enforceZdrOpenai?: boolean | null | undefined;
|
|
44
44
|
/**
|
|
45
|
-
* Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or
|
|
45
|
+
* Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.
|
|
46
46
|
*/
|
|
47
47
|
enforceZdrOther?: boolean | null | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.
|
|
50
|
+
*/
|
|
51
|
+
enforceZdrXai?: boolean | null | undefined;
|
|
48
52
|
/**
|
|
49
53
|
* Array of model identifiers to exclude from routing (slug or canonical_slug accepted)
|
|
50
54
|
*/
|
|
@@ -78,6 +82,7 @@ export type UpdateGuardrailRequest$Outbound = {
|
|
|
78
82
|
enforce_zdr_google?: boolean | null | undefined;
|
|
79
83
|
enforce_zdr_openai?: boolean | null | undefined;
|
|
80
84
|
enforce_zdr_other?: boolean | null | undefined;
|
|
85
|
+
enforce_zdr_xai?: boolean | null | undefined;
|
|
81
86
|
ignored_models?: Array<string> | null | undefined;
|
|
82
87
|
ignored_providers?: Array<string> | null | undefined;
|
|
83
88
|
limit_usd?: number | null | undefined;
|
|
@@ -20,6 +20,7 @@ export const UpdateGuardrailRequest$outboundSchema = z.object({
|
|
|
20
20
|
enforceZdrGoogle: z.nullable(z.boolean()).optional(),
|
|
21
21
|
enforceZdrOpenai: z.nullable(z.boolean()).optional(),
|
|
22
22
|
enforceZdrOther: z.nullable(z.boolean()).optional(),
|
|
23
|
+
enforceZdrXai: z.nullable(z.boolean()).optional(),
|
|
23
24
|
ignoredModels: z.nullable(z.array(z.string())).optional(),
|
|
24
25
|
ignoredProviders: z.nullable(z.array(z.string())).optional(),
|
|
25
26
|
limitUsd: z.nullable(z.number()).optional(),
|
|
@@ -36,6 +37,7 @@ export const UpdateGuardrailRequest$outboundSchema = z.object({
|
|
|
36
37
|
enforceZdrGoogle: "enforce_zdr_google",
|
|
37
38
|
enforceZdrOpenai: "enforce_zdr_openai",
|
|
38
39
|
enforceZdrOther: "enforce_zdr_other",
|
|
40
|
+
enforceZdrXai: "enforce_zdr_xai",
|
|
39
41
|
ignoredModels: "ignored_models",
|
|
40
42
|
ignoredProviders: "ignored_providers",
|
|
41
43
|
limitUsd: "limit_usd",
|
package/esm/models/usage.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { ServerToolUseDetails } from "./servertoolusedetails.js";
|
|
4
5
|
export type InputTokensDetails = {
|
|
5
6
|
cacheWriteTokens?: number | null | undefined;
|
|
6
7
|
cachedTokens: number;
|
|
@@ -31,6 +32,10 @@ export type Usage = {
|
|
|
31
32
|
* Whether a request was made using a Bring Your Own Key configuration
|
|
32
33
|
*/
|
|
33
34
|
isByok?: boolean | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Usage for server-side tool execution (e.g., web search)
|
|
37
|
+
*/
|
|
38
|
+
serverToolUseDetails?: ServerToolUseDetails | null | undefined;
|
|
34
39
|
};
|
|
35
40
|
/** @internal */
|
|
36
41
|
export declare const InputTokensDetails$inboundSchema: z.ZodType<InputTokensDetails, unknown>;
|
package/esm/models/usage.js
CHANGED
|
@@ -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 { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { ServerToolUseDetails$inboundSchema, } from "./servertoolusedetails.js";
|
|
8
9
|
/** @internal */
|
|
9
10
|
export const InputTokensDetails$inboundSchema = z.object({
|
|
10
11
|
cache_write_tokens: z.nullable(z.int()).optional(),
|
|
@@ -54,6 +55,8 @@ export const Usage$inboundSchema = z.object({
|
|
|
54
55
|
cost: z.nullable(z.number()).optional(),
|
|
55
56
|
cost_details: z.lazy(() => UsageCostDetails$inboundSchema).optional(),
|
|
56
57
|
is_byok: z.boolean().optional(),
|
|
58
|
+
server_tool_use_details: z.nullable(ServerToolUseDetails$inboundSchema)
|
|
59
|
+
.optional(),
|
|
57
60
|
}).transform((v) => {
|
|
58
61
|
return remap$(v, {
|
|
59
62
|
"input_tokens": "inputTokens",
|
|
@@ -63,6 +66,7 @@ export const Usage$inboundSchema = z.object({
|
|
|
63
66
|
"total_tokens": "totalTokens",
|
|
64
67
|
"cost_details": "costDetails",
|
|
65
68
|
"is_byok": "isByok",
|
|
69
|
+
"server_tool_use_details": "serverToolUseDetails",
|
|
66
70
|
});
|
|
67
71
|
});
|
|
68
72
|
export function usageFromJSON(jsonString) {
|
package/esm/sdk/workspaces.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export declare class Workspaces extends ClientSDK {
|
|
|
81
81
|
* Bulk remove members from a workspace
|
|
82
82
|
*
|
|
83
83
|
* @remarks
|
|
84
|
-
* Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
84
|
+
* Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
85
85
|
*/
|
|
86
86
|
bulkRemoveMembers(request: operations.BulkRemoveWorkspaceMembersRequest, options?: RequestOptions): Promise<models.BulkRemoveWorkspaceMembersResponse>;
|
|
87
87
|
}
|
package/esm/sdk/workspaces.js
CHANGED
|
@@ -111,7 +111,7 @@ export class Workspaces extends ClientSDK {
|
|
|
111
111
|
* Bulk remove members from a workspace
|
|
112
112
|
*
|
|
113
113
|
* @remarks
|
|
114
|
-
* Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
114
|
+
* Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
115
115
|
*/
|
|
116
116
|
async bulkRemoveMembers(request, options) {
|
|
117
117
|
return unwrapAsync(workspacesBulkRemoveMembers(this, request, options));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.52",
|
|
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": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"
|
|
76
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
77
77
|
"test": "vitest --run --project unit",
|
|
78
|
+
"typecheck:transit": "exit 0",
|
|
79
|
+
"compile": "tsc",
|
|
80
|
+
"prepare": "npm run build",
|
|
78
81
|
"test:e2e": "vitest --run --project e2e",
|
|
79
82
|
"test:transit": "exit 0",
|
|
80
83
|
"test:watch": "vitest --watch --project unit",
|
|
81
|
-
"typecheck": "tsc --noEmit"
|
|
82
|
-
"typecheck:transit": "exit 0",
|
|
83
|
-
"compile": "tsc",
|
|
84
|
-
"postinstall": "node scripts/check-types.js || true"
|
|
84
|
+
"typecheck": "tsc --noEmit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|