@openrouter/sdk 1.3.13 → 1.3.15

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.
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
50
50
  export declare const SDK_METADATA: {
51
51
  readonly language: "typescript";
52
52
  readonly openapiDocVersion: "1.0.0";
53
- readonly sdkVersion: "1.3.13";
53
+ readonly sdkVersion: "1.3.15";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.3.13 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.3.15 2.914.0 1.0.0 @openrouter/sdk";
56
56
  };
57
57
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
29
29
  export const SDK_METADATA = {
30
30
  language: "typescript",
31
31
  openapiDocVersion: "1.0.0",
32
- sdkVersion: "1.3.13",
32
+ sdkVersion: "1.3.15",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.3.13 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.3.15 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -0,0 +1,25 @@
1
+ import * as z from "zod/v4";
2
+ /**
3
+ * A server-side safeguard Anthropic evaluates alongside the completion
4
+ */
5
+ export type AnthropicSafeguard = {
6
+ classifierContext?: {
7
+ [k: string]: any;
8
+ } | undefined;
9
+ type: string;
10
+ additionalProperties?: {
11
+ [k: string]: any;
12
+ } | undefined;
13
+ };
14
+ /** @internal */
15
+ export type AnthropicSafeguard$Outbound = {
16
+ classifier_context?: {
17
+ [k: string]: any;
18
+ } | undefined;
19
+ type: string;
20
+ [additionalProperties: string]: unknown;
21
+ };
22
+ /** @internal */
23
+ export declare const AnthropicSafeguard$outboundSchema: z.ZodType<AnthropicSafeguard$Outbound, AnthropicSafeguard>;
24
+ export declare function anthropicSafeguardToJSON(anthropicSafeguard: AnthropicSafeguard): string;
25
+ //# sourceMappingURL=anthropicsafeguard.d.ts.map
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 607549785460
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ /** @internal */
8
+ export const AnthropicSafeguard$outboundSchema = z.object({
9
+ classifierContext: z.record(z.string(), z.any()).optional(),
10
+ type: z.string(),
11
+ additionalProperties: z.record(z.string(), z.any()).optional(),
12
+ }).transform((v) => {
13
+ return {
14
+ ...v.additionalProperties,
15
+ ...remap$(v, {
16
+ classifierContext: "classifier_context",
17
+ additionalProperties: null,
18
+ }),
19
+ };
20
+ });
21
+ export function anthropicSafeguardToJSON(anthropicSafeguard) {
22
+ return JSON.stringify(AnthropicSafeguard$outboundSchema.parse(anthropicSafeguard));
23
+ }
24
+ //# sourceMappingURL=anthropicsafeguard.js.map
@@ -1,4 +1,20 @@
1
1
  import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ export declare const CreateWorkspaceRequestDisabledServerTool: {
4
+ readonly OpenrouterAdvisor: "openrouter:advisor";
5
+ readonly OpenrouterApplyPatch: "openrouter:apply_patch";
6
+ readonly OpenrouterBash: "openrouter:bash";
7
+ readonly OpenrouterDatetime: "openrouter:datetime";
8
+ readonly OpenrouterFusion: "openrouter:fusion";
9
+ readonly OpenrouterImageGeneration: "openrouter:image_generation";
10
+ readonly OpenrouterExperimentalSearchModels: "openrouter:experimental__search_models";
11
+ readonly OpenrouterShell: "openrouter:shell";
12
+ readonly OpenrouterSubagent: "openrouter:subagent";
13
+ readonly OpenrouterToolSearch: "openrouter:tool_search";
14
+ readonly OpenrouterWebFetch: "openrouter:web_fetch";
15
+ readonly OpenrouterWebSearch: "openrouter:web_search";
16
+ };
17
+ export type CreateWorkspaceRequestDisabledServerTool = OpenEnum<typeof CreateWorkspaceRequestDisabledServerTool>;
2
18
  export type CreateWorkspaceRequest = {
3
19
  /**
4
20
  * Default image model for this workspace
@@ -16,6 +32,10 @@ export type CreateWorkspaceRequest = {
16
32
  * Description of the workspace
17
33
  */
18
34
  description?: string | null | undefined;
35
+ /**
36
+ * OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list.
37
+ */
38
+ disabledServerTools?: Array<CreateWorkspaceRequestDisabledServerTool> | null | undefined;
19
39
  /**
20
40
  * Optional array of API key IDs to filter I/O logging
21
41
  */
@@ -46,11 +66,14 @@ export type CreateWorkspaceRequest = {
46
66
  slug: string;
47
67
  };
48
68
  /** @internal */
69
+ export declare const CreateWorkspaceRequestDisabledServerTool$outboundSchema: z.ZodType<string, CreateWorkspaceRequestDisabledServerTool>;
70
+ /** @internal */
49
71
  export type CreateWorkspaceRequest$Outbound = {
50
72
  default_image_model?: string | null | undefined;
51
73
  default_provider_sort?: string | null | undefined;
52
74
  default_text_model?: string | null | undefined;
53
75
  description?: string | null | undefined;
76
+ disabled_server_tools?: Array<string> | null | undefined;
54
77
  io_logging_api_key_ids?: Array<number> | null | undefined;
55
78
  io_logging_sampling_rate?: number | undefined;
56
79
  is_data_discount_logging_enabled?: boolean | undefined;
@@ -4,12 +4,30 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
+ import * as openEnums from "../types/enums.js";
8
+ export const CreateWorkspaceRequestDisabledServerTool = {
9
+ OpenrouterAdvisor: "openrouter:advisor",
10
+ OpenrouterApplyPatch: "openrouter:apply_patch",
11
+ OpenrouterBash: "openrouter:bash",
12
+ OpenrouterDatetime: "openrouter:datetime",
13
+ OpenrouterFusion: "openrouter:fusion",
14
+ OpenrouterImageGeneration: "openrouter:image_generation",
15
+ OpenrouterExperimentalSearchModels: "openrouter:experimental__search_models",
16
+ OpenrouterShell: "openrouter:shell",
17
+ OpenrouterSubagent: "openrouter:subagent",
18
+ OpenrouterToolSearch: "openrouter:tool_search",
19
+ OpenrouterWebFetch: "openrouter:web_fetch",
20
+ OpenrouterWebSearch: "openrouter:web_search",
21
+ };
22
+ /** @internal */
23
+ export const CreateWorkspaceRequestDisabledServerTool$outboundSchema = openEnums.outboundSchema(CreateWorkspaceRequestDisabledServerTool);
7
24
  /** @internal */
8
25
  export const CreateWorkspaceRequest$outboundSchema = z.object({
9
26
  defaultImageModel: z.nullable(z.string()).optional(),
10
27
  defaultProviderSort: z.nullable(z.string()).optional(),
11
28
  defaultTextModel: z.nullable(z.string()).optional(),
12
29
  description: z.nullable(z.string()).optional(),
30
+ disabledServerTools: z.nullable(z.array(CreateWorkspaceRequestDisabledServerTool$outboundSchema)).optional(),
13
31
  ioLoggingApiKeyIds: z.nullable(z.array(z.int())).optional(),
14
32
  ioLoggingSamplingRate: z.number().optional(),
15
33
  isDataDiscountLoggingEnabled: z.boolean().optional(),
@@ -22,6 +40,7 @@ export const CreateWorkspaceRequest$outboundSchema = z.object({
22
40
  defaultImageModel: "default_image_model",
23
41
  defaultProviderSort: "default_provider_sort",
24
42
  defaultTextModel: "default_text_model",
43
+ disabledServerTools: "disabled_server_tools",
25
44
  ioLoggingApiKeyIds: "io_logging_api_key_ids",
26
45
  ioLoggingSamplingRate: "io_logging_sampling_rate",
27
46
  isDataDiscountLoggingEnabled: "is_data_discount_logging_enabled",
@@ -34,6 +34,7 @@ export * from "./anthropicmessageoutputconfig.js";
34
34
  export * from "./anthropicmessageusageiteration.js";
35
35
  export * from "./anthropicoutputeffort.js";
36
36
  export * from "./anthropicplaintextsource.js";
37
+ export * from "./anthropicsafeguard.js";
37
38
  export * from "./anthropicsearchresultblockparam.js";
38
39
  export * from "./anthropicspeed.js";
39
40
  export * from "./anthropicsystemclearat.js";
@@ -38,6 +38,7 @@ export * from "./anthropicmessageoutputconfig.js";
38
38
  export * from "./anthropicmessageusageiteration.js";
39
39
  export * from "./anthropicoutputeffort.js";
40
40
  export * from "./anthropicplaintextsource.js";
41
+ export * from "./anthropicsafeguard.js";
41
42
  export * from "./anthropicsearchresultblockparam.js";
42
43
  export * from "./anthropicspeed.js";
43
44
  export * from "./anthropicsystemclearat.js";
@@ -4,6 +4,7 @@ import { AnthropicAllowedCallers } from "./anthropicallowedcallers.js";
4
4
  import { AnthropicCacheControlDirective, AnthropicCacheControlDirective$Outbound } from "./anthropiccachecontroldirective.js";
5
5
  import { AnthropicInputTokensClearAtLeast, AnthropicInputTokensClearAtLeast$Outbound } from "./anthropicinputtokensclearatleast.js";
6
6
  import { AnthropicInputTokensTrigger, AnthropicInputTokensTrigger$Outbound } from "./anthropicinputtokenstrigger.js";
7
+ import { AnthropicSafeguard, AnthropicSafeguard$Outbound } from "./anthropicsafeguard.js";
7
8
  import { AnthropicTextBlockParam, AnthropicTextBlockParam$Outbound } from "./anthropictextblockparam.js";
8
9
  import { AnthropicThinkingBlockBinding, AnthropicThinkingBlockBinding$Outbound } from "./anthropicthinkingblockbinding.js";
9
10
  import { AnthropicThinkingDisplay } from "./anthropicthinkingdisplay.js";
@@ -283,6 +284,7 @@ export type MessagesRequest = {
283
284
  * When multiple model providers are available, optionally indicate your routing preference.
284
285
  */
285
286
  provider?: ProviderPreferences | null | undefined;
287
+ safeguards?: Array<AnthropicSafeguard> | null | undefined;
286
288
  serviceTier?: string | undefined;
287
289
  /**
288
290
  * A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
@@ -605,6 +607,7 @@ export type MessagesRequest$Outbound = {
605
607
  output_config?: MessagesOutputConfig$Outbound | undefined;
606
608
  plugins?: Array<AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
607
609
  provider?: ProviderPreferences$Outbound | null | undefined;
610
+ safeguards?: Array<AnthropicSafeguard$Outbound> | null | undefined;
608
611
  service_tier?: string | undefined;
609
612
  session_id?: string | undefined;
610
613
  speed?: string | null | undefined;
@@ -9,6 +9,7 @@ import { AnthropicAllowedCallers$outboundSchema, } from "./anthropicallowedcalle
9
9
  import { AnthropicCacheControlDirective$outboundSchema, } from "./anthropiccachecontroldirective.js";
10
10
  import { AnthropicInputTokensClearAtLeast$outboundSchema, } from "./anthropicinputtokensclearatleast.js";
11
11
  import { AnthropicInputTokensTrigger$outboundSchema, } from "./anthropicinputtokenstrigger.js";
12
+ import { AnthropicSafeguard$outboundSchema, } from "./anthropicsafeguard.js";
12
13
  import { AnthropicTextBlockParam$outboundSchema, } from "./anthropictextblockparam.js";
13
14
  import { AnthropicThinkingBlockBinding$outboundSchema, } from "./anthropicthinkingblockbinding.js";
14
15
  import { AnthropicThinkingDisplay$outboundSchema, } from "./anthropicthinkingdisplay.js";
@@ -560,6 +561,7 @@ export const MessagesRequest$outboundSchema = z.object({
560
561
  WebFetchPlugin$outboundSchema,
561
562
  ])).optional(),
562
563
  provider: z.nullable(ProviderPreferences$outboundSchema).optional(),
564
+ safeguards: z.nullable(z.array(AnthropicSafeguard$outboundSchema)).optional(),
563
565
  serviceTier: z.string().optional(),
564
566
  sessionId: z.string().optional(),
565
567
  speed: z.nullable(Speed$outboundSchema).optional(),
@@ -1,4 +1,20 @@
1
1
  import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ export declare const UpdateWorkspaceRequestDisabledServerTool: {
4
+ readonly OpenrouterAdvisor: "openrouter:advisor";
5
+ readonly OpenrouterApplyPatch: "openrouter:apply_patch";
6
+ readonly OpenrouterBash: "openrouter:bash";
7
+ readonly OpenrouterDatetime: "openrouter:datetime";
8
+ readonly OpenrouterFusion: "openrouter:fusion";
9
+ readonly OpenrouterImageGeneration: "openrouter:image_generation";
10
+ readonly OpenrouterExperimentalSearchModels: "openrouter:experimental__search_models";
11
+ readonly OpenrouterShell: "openrouter:shell";
12
+ readonly OpenrouterSubagent: "openrouter:subagent";
13
+ readonly OpenrouterToolSearch: "openrouter:tool_search";
14
+ readonly OpenrouterWebFetch: "openrouter:web_fetch";
15
+ readonly OpenrouterWebSearch: "openrouter:web_search";
16
+ };
17
+ export type UpdateWorkspaceRequestDisabledServerTool = OpenEnum<typeof UpdateWorkspaceRequestDisabledServerTool>;
2
18
  export type UpdateWorkspaceRequest = {
3
19
  /**
4
20
  * Default image model for this workspace
@@ -16,6 +32,10 @@ export type UpdateWorkspaceRequest = {
16
32
  * New description for the workspace
17
33
  */
18
34
  description?: string | null | undefined;
35
+ /**
36
+ * OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list.
37
+ */
38
+ disabledServerTools?: Array<UpdateWorkspaceRequestDisabledServerTool> | null | undefined;
19
39
  /**
20
40
  * Optional array of API key IDs to filter I/O logging
21
41
  */
@@ -46,11 +66,14 @@ export type UpdateWorkspaceRequest = {
46
66
  slug?: string | undefined;
47
67
  };
48
68
  /** @internal */
69
+ export declare const UpdateWorkspaceRequestDisabledServerTool$outboundSchema: z.ZodType<string, UpdateWorkspaceRequestDisabledServerTool>;
70
+ /** @internal */
49
71
  export type UpdateWorkspaceRequest$Outbound = {
50
72
  default_image_model?: string | null | undefined;
51
73
  default_provider_sort?: string | null | undefined;
52
74
  default_text_model?: string | null | undefined;
53
75
  description?: string | null | undefined;
76
+ disabled_server_tools?: Array<string> | null | undefined;
54
77
  io_logging_api_key_ids?: Array<number> | null | undefined;
55
78
  io_logging_sampling_rate?: number | undefined;
56
79
  is_data_discount_logging_enabled?: boolean | undefined;
@@ -4,12 +4,30 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
+ import * as openEnums from "../types/enums.js";
8
+ export const UpdateWorkspaceRequestDisabledServerTool = {
9
+ OpenrouterAdvisor: "openrouter:advisor",
10
+ OpenrouterApplyPatch: "openrouter:apply_patch",
11
+ OpenrouterBash: "openrouter:bash",
12
+ OpenrouterDatetime: "openrouter:datetime",
13
+ OpenrouterFusion: "openrouter:fusion",
14
+ OpenrouterImageGeneration: "openrouter:image_generation",
15
+ OpenrouterExperimentalSearchModels: "openrouter:experimental__search_models",
16
+ OpenrouterShell: "openrouter:shell",
17
+ OpenrouterSubagent: "openrouter:subagent",
18
+ OpenrouterToolSearch: "openrouter:tool_search",
19
+ OpenrouterWebFetch: "openrouter:web_fetch",
20
+ OpenrouterWebSearch: "openrouter:web_search",
21
+ };
22
+ /** @internal */
23
+ export const UpdateWorkspaceRequestDisabledServerTool$outboundSchema = openEnums.outboundSchema(UpdateWorkspaceRequestDisabledServerTool);
7
24
  /** @internal */
8
25
  export const UpdateWorkspaceRequest$outboundSchema = z.object({
9
26
  defaultImageModel: z.nullable(z.string()).optional(),
10
27
  defaultProviderSort: z.nullable(z.string()).optional(),
11
28
  defaultTextModel: z.nullable(z.string()).optional(),
12
29
  description: z.nullable(z.string()).optional(),
30
+ disabledServerTools: z.nullable(z.array(UpdateWorkspaceRequestDisabledServerTool$outboundSchema)).optional(),
13
31
  ioLoggingApiKeyIds: z.nullable(z.array(z.int())).optional(),
14
32
  ioLoggingSamplingRate: z.number().optional(),
15
33
  isDataDiscountLoggingEnabled: z.boolean().optional(),
@@ -22,6 +40,7 @@ export const UpdateWorkspaceRequest$outboundSchema = z.object({
22
40
  defaultImageModel: "default_image_model",
23
41
  defaultProviderSort: "default_provider_sort",
24
42
  defaultTextModel: "default_text_model",
43
+ disabledServerTools: "disabled_server_tools",
25
44
  ioLoggingApiKeyIds: "io_logging_api_key_ids",
26
45
  ioLoggingSamplingRate: "io_logging_sampling_rate",
27
46
  isDataDiscountLoggingEnabled: "is_data_discount_logging_enabled",
@@ -30,6 +30,10 @@ export type Workspace = {
30
30
  * Description of the workspace
31
31
  */
32
32
  description: string | null;
33
+ /**
34
+ * OpenRouter server tools (e.g. openrouter:web_search) that requests in this workspace may not invoke. Null means no tools are disabled.
35
+ */
36
+ disabledServerTools?: Array<string> | null | undefined;
33
37
  /**
34
38
  * Unique identifier for the workspace
35
39
  */
@@ -14,6 +14,7 @@ export const Workspace$inboundSchema = z.object({
14
14
  default_provider_sort: z.nullable(z.string()),
15
15
  default_text_model: z.nullable(z.string()),
16
16
  description: z.nullable(z.string()),
17
+ disabled_server_tools: z.nullable(z.array(z.string())).optional(),
17
18
  id: z.string(),
18
19
  include_byok_in_budgets: z.boolean().optional(),
19
20
  io_logging_api_key_ids: z.nullable(z.array(z.int())),
@@ -32,6 +33,7 @@ export const Workspace$inboundSchema = z.object({
32
33
  "default_image_model": "defaultImageModel",
33
34
  "default_provider_sort": "defaultProviderSort",
34
35
  "default_text_model": "defaultTextModel",
36
+ "disabled_server_tools": "disabledServerTools",
35
37
  "include_byok_in_budgets": "includeByokInBudgets",
36
38
  "io_logging_api_key_ids": "ioLoggingApiKeyIds",
37
39
  "io_logging_sampling_rate": "ioLoggingSamplingRate",
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.3.13",
5
+ "version": "1.3.15",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "1.3.13",
3
+ "version": "1.3.15",
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",
77
- "postinstall": "node scripts/check-types.js || true",
78
- "test": "vitest --run --project unit",
79
76
  "test:e2e": "vitest --run --project e2e",
80
77
  "test:watch": "vitest --watch --project unit",
81
- "prepare": "npm run build",
78
+ "compile": "tsc",
82
79
  "test:transit": "exit 0",
83
80
  "typecheck": "tsc --noEmit",
84
- "typecheck:transit": "exit 0"
81
+ "typecheck:transit": "exit 0",
82
+ "postinstall": "node scripts/check-types.js || true",
83
+ "prepare": "npm run build",
84
+ "test": "vitest --run --project unit"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {