@openrouter/sdk 1.3.13 → 1.3.14

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.14";
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.14 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.14",
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.14 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
@@ -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(),
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.14",
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.14",
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
+ "prepare": "npm run build",
77
+ "test:transit": "exit 0",
78
+ "typecheck:transit": "exit 0",
76
79
  "compile": "tsc",
77
- "postinstall": "node scripts/check-types.js || true",
78
80
  "test": "vitest --run --project unit",
79
81
  "test:e2e": "vitest --run --project e2e",
80
82
  "test:watch": "vitest --watch --project unit",
81
- "prepare": "npm run build",
82
- "test:transit": "exit 0",
83
83
  "typecheck": "tsc --noEmit",
84
- "typecheck:transit": "exit 0"
84
+ "postinstall": "node scripts/check-types.js || true"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {