@openrouter/sdk 1.2.97 → 1.2.98

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.2.97";
53
+ readonly sdkVersion: "1.2.98";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.97 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.2.98 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.2.97",
32
+ sdkVersion: "1.2.98",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.97 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.2.98 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -1,8 +1,13 @@
1
1
  import * as z from "zod/v4";
2
2
  import { ContentFilterBuiltinEntryInput, ContentFilterBuiltinEntryInput$Outbound } from "./contentfilterbuiltinentryinput.js";
3
3
  import { ContentFilterEntry, ContentFilterEntry$Outbound } from "./contentfilterentry.js";
4
+ import { GuardrailDataRegion } from "./guardraildataregion.js";
4
5
  import { GuardrailInterval } from "./guardrailinterval.js";
5
6
  export type CreateGuardrailRequest = {
7
+ /**
8
+ * Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.
9
+ */
10
+ allowedDataRegions?: Array<GuardrailDataRegion> | null | undefined;
6
11
  /**
7
12
  * Array of model identifiers (slug or canonical_slug accepted)
8
13
  */
@@ -92,6 +97,7 @@ export type CreateGuardrailRequest = {
92
97
  };
93
98
  /** @internal */
94
99
  export type CreateGuardrailRequest$Outbound = {
100
+ allowed_data_regions?: Array<string> | null | undefined;
95
101
  allowed_models?: Array<string> | null | undefined;
96
102
  allowed_providers?: Array<string> | null | undefined;
97
103
  content_filter_builtins?: Array<ContentFilterBuiltinEntryInput$Outbound> | null | undefined;
@@ -6,9 +6,12 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { ContentFilterBuiltinEntryInput$outboundSchema, } from "./contentfilterbuiltinentryinput.js";
8
8
  import { ContentFilterEntry$outboundSchema, } from "./contentfilterentry.js";
9
+ import { GuardrailDataRegion$outboundSchema, } from "./guardraildataregion.js";
9
10
  import { GuardrailInterval$outboundSchema, } from "./guardrailinterval.js";
10
11
  /** @internal */
11
12
  export const CreateGuardrailRequest$outboundSchema = z.object({
13
+ allowedDataRegions: z.nullable(z.array(GuardrailDataRegion$outboundSchema))
14
+ .optional(),
12
15
  allowedModels: z.nullable(z.array(z.string())).optional(),
13
16
  allowedProviders: z.nullable(z.array(z.string())).optional(),
14
17
  contentFilterBuiltins: z.nullable(z.array(ContentFilterBuiltinEntryInput$outboundSchema)).optional(),
@@ -33,6 +36,7 @@ export const CreateGuardrailRequest$outboundSchema = z.object({
33
36
  workspaceId: z.string().optional(),
34
37
  }).transform((v) => {
35
38
  return remap$(v, {
39
+ allowedDataRegions: "allowed_data_regions",
36
40
  allowedModels: "allowed_models",
37
41
  allowedProviders: "allowed_providers",
38
42
  contentFilterBuiltins: "content_filter_builtins",
@@ -3,8 +3,13 @@ import { Result as SafeParseResult } from "../types/fp.js";
3
3
  import { ContentFilterBuiltinEntry } from "./contentfilterbuiltinentry.js";
4
4
  import { ContentFilterEntry } from "./contentfilterentry.js";
5
5
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
6
+ import { GuardrailDataRegion } from "./guardraildataregion.js";
6
7
  import { GuardrailInterval } from "./guardrailinterval.js";
7
8
  export type Guardrail = {
9
+ /**
10
+ * Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value.
11
+ */
12
+ allowedDataRegions?: Array<GuardrailDataRegion> | null | undefined;
8
13
  /**
9
14
  * Array of model canonical_slugs (immutable identifiers)
10
15
  */
@@ -7,9 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import { ContentFilterBuiltinEntry$inboundSchema, } from "./contentfilterbuiltinentry.js";
9
9
  import { ContentFilterEntry$inboundSchema, } from "./contentfilterentry.js";
10
+ import { GuardrailDataRegion$inboundSchema, } from "./guardraildataregion.js";
10
11
  import { GuardrailInterval$inboundSchema, } from "./guardrailinterval.js";
11
12
  /** @internal */
12
13
  export const Guardrail$inboundSchema = z.object({
14
+ allowed_data_regions: z.nullable(z.array(GuardrailDataRegion$inboundSchema))
15
+ .optional(),
13
16
  allowed_models: z.nullable(z.array(z.string())).optional(),
14
17
  allowed_providers: z.nullable(z.array(z.string())).optional(),
15
18
  content_filter_builtins: z.nullable(z.array(ContentFilterBuiltinEntry$inboundSchema)).optional(),
@@ -37,6 +40,7 @@ export const Guardrail$inboundSchema = z.object({
37
40
  workspace_id: z.nullable(z.string()),
38
41
  }).transform((v) => {
39
42
  return remap$(v, {
43
+ "allowed_data_regions": "allowedDataRegions",
40
44
  "allowed_models": "allowedModels",
41
45
  "allowed_providers": "allowedProviders",
42
46
  "content_filter_builtins": "contentFilterBuiltins",
@@ -0,0 +1,19 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ /**
4
+ * An OpenRouter data region: `global` (https://openrouter.ai), `europe` (https://eu.openrouter.ai), or `us` (https://us.openrouter.ai)
5
+ */
6
+ export declare const GuardrailDataRegion: {
7
+ readonly Global: "global";
8
+ readonly Europe: "europe";
9
+ readonly Us: "us";
10
+ };
11
+ /**
12
+ * An OpenRouter data region: `global` (https://openrouter.ai), `europe` (https://eu.openrouter.ai), or `us` (https://us.openrouter.ai)
13
+ */
14
+ export type GuardrailDataRegion = OpenEnum<typeof GuardrailDataRegion>;
15
+ /** @internal */
16
+ export declare const GuardrailDataRegion$inboundSchema: z.ZodType<GuardrailDataRegion, unknown>;
17
+ /** @internal */
18
+ export declare const GuardrailDataRegion$outboundSchema: z.ZodType<string, GuardrailDataRegion>;
19
+ //# sourceMappingURL=guardraildataregion.d.ts.map
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 5e2e4801b177
4
+ */
5
+ import * as openEnums from "../types/enums.js";
6
+ /**
7
+ * An OpenRouter data region: `global` (https://openrouter.ai), `europe` (https://eu.openrouter.ai), or `us` (https://us.openrouter.ai)
8
+ */
9
+ export const GuardrailDataRegion = {
10
+ Global: "global",
11
+ Europe: "europe",
12
+ Us: "us",
13
+ };
14
+ /** @internal */
15
+ export const GuardrailDataRegion$inboundSchema = openEnums.inboundSchema(GuardrailDataRegion);
16
+ /** @internal */
17
+ export const GuardrailDataRegion$outboundSchema = openEnums.outboundSchema(GuardrailDataRegion);
18
+ //# sourceMappingURL=guardraildataregion.js.map
@@ -257,6 +257,7 @@ export * from "./getscimgroupmappingresponse.js";
257
257
  export * from "./getworkspacebudgetresponse.js";
258
258
  export * from "./getworkspaceresponse.js";
259
259
  export * from "./guardrail.js";
260
+ export * from "./guardraildataregion.js";
260
261
  export * from "./guardrailinterval.js";
261
262
  export * from "./imageconfig.js";
262
263
  export * from "./imageendpoint.js";
@@ -261,6 +261,7 @@ export * from "./getscimgroupmappingresponse.js";
261
261
  export * from "./getworkspacebudgetresponse.js";
262
262
  export * from "./getworkspaceresponse.js";
263
263
  export * from "./guardrail.js";
264
+ export * from "./guardraildataregion.js";
264
265
  export * from "./guardrailinterval.js";
265
266
  export * from "./imageconfig.js";
266
267
  export * from "./imageendpoint.js";
@@ -1,8 +1,13 @@
1
1
  import * as z from "zod/v4";
2
2
  import { ContentFilterBuiltinEntryInput, ContentFilterBuiltinEntryInput$Outbound } from "./contentfilterbuiltinentryinput.js";
3
3
  import { ContentFilterEntry, ContentFilterEntry$Outbound } from "./contentfilterentry.js";
4
+ import { GuardrailDataRegion } from "./guardraildataregion.js";
4
5
  import { GuardrailInterval } from "./guardrailinterval.js";
5
6
  export type UpdateGuardrailRequest = {
7
+ /**
8
+ * Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.
9
+ */
10
+ allowedDataRegions?: Array<GuardrailDataRegion> | null | undefined;
6
11
  /**
7
12
  * Array of model identifiers (slug or canonical_slug accepted)
8
13
  */
@@ -88,6 +93,7 @@ export type UpdateGuardrailRequest = {
88
93
  };
89
94
  /** @internal */
90
95
  export type UpdateGuardrailRequest$Outbound = {
96
+ allowed_data_regions?: Array<string> | null | undefined;
91
97
  allowed_models?: Array<string> | null | undefined;
92
98
  allowed_providers?: Array<string> | null | undefined;
93
99
  content_filter_builtins?: Array<ContentFilterBuiltinEntryInput$Outbound> | null | undefined;
@@ -6,9 +6,12 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { ContentFilterBuiltinEntryInput$outboundSchema, } from "./contentfilterbuiltinentryinput.js";
8
8
  import { ContentFilterEntry$outboundSchema, } from "./contentfilterentry.js";
9
+ import { GuardrailDataRegion$outboundSchema, } from "./guardraildataregion.js";
9
10
  import { GuardrailInterval$outboundSchema, } from "./guardrailinterval.js";
10
11
  /** @internal */
11
12
  export const UpdateGuardrailRequest$outboundSchema = z.object({
13
+ allowedDataRegions: z.nullable(z.array(GuardrailDataRegion$outboundSchema))
14
+ .optional(),
12
15
  allowedModels: z.nullable(z.array(z.string())).optional(),
13
16
  allowedProviders: z.nullable(z.array(z.string())).optional(),
14
17
  contentFilterBuiltins: z.nullable(z.array(ContentFilterBuiltinEntryInput$outboundSchema)).optional(),
@@ -32,6 +35,7 @@ export const UpdateGuardrailRequest$outboundSchema = z.object({
32
35
  resetInterval: z.nullable(GuardrailInterval$outboundSchema).optional(),
33
36
  }).transform((v) => {
34
37
  return remap$(v, {
38
+ allowedDataRegions: "allowed_data_regions",
35
39
  allowedModels: "allowed_models",
36
40
  allowedProviders: "allowed_providers",
37
41
  contentFilterBuiltins: "content_filter_builtins",
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.97",
5
+ "version": "1.2.98",
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.2.97",
3
+ "version": "1.2.98",
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
- "access": "public",
25
- "provenance": true
24
+ "provenance": true,
25
+ "access": "public"
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
- "postinstall": "node scripts/check-types.js || true",
77
- "prepare": "npm run build",
76
+ "test": "vitest --run --project unit",
78
77
  "test:e2e": "vitest --run --project e2e",
79
- "test:transit": "exit 0",
80
- "test:watch": "vitest --watch --project unit",
81
78
  "typecheck": "tsc --noEmit",
79
+ "typecheck:transit": "exit 0",
82
80
  "compile": "tsc",
83
- "test": "vitest --run --project unit",
84
- "typecheck:transit": "exit 0"
81
+ "postinstall": "node scripts/check-types.js || true",
82
+ "test:transit": "exit 0",
83
+ "test:watch": "vitest --watch --project unit",
84
+ "prepare": "npm run build"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {