@openrouter/sdk 1.0.14 → 1.0.16

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.
@@ -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.0.14";
52
+ readonly sdkVersion: "1.0.16";
53
53
  readonly genVersion: "2.914.0";
54
- readonly userAgent: "speakeasy-sdk/typescript 1.0.14 2.914.0 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 1.0.16 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.0.14",
29
+ sdkVersion: "1.0.16",
30
30
  genVersion: "2.914.0",
31
- userAgent: "speakeasy-sdk/typescript 1.0.14 2.914.0 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 1.0.16 2.914.0 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -57,6 +57,10 @@ export type CreateGuardrailRequest = {
57
57
  * List of provider IDs to exclude from routing
58
58
  */
59
59
  ignoredProviders?: Array<string> | null | undefined;
60
+ /**
61
+ * Whether BYOK (bring-your-own-key) inference spend counts toward this guardrail's limit_usd, in addition to OpenRouter credit spend. Defaults to false.
62
+ */
63
+ includeByokInBudgets?: boolean | undefined;
60
64
  /**
61
65
  * Spending limit in USD
62
66
  */
@@ -89,6 +93,7 @@ export type CreateGuardrailRequest$Outbound = {
89
93
  enforce_zdr_xai?: boolean | null | undefined;
90
94
  ignored_models?: Array<string> | null | undefined;
91
95
  ignored_providers?: Array<string> | null | undefined;
96
+ include_byok_in_budgets?: boolean | undefined;
92
97
  limit_usd?: number | null | undefined;
93
98
  name: string;
94
99
  reset_interval?: string | null | undefined;
@@ -23,6 +23,7 @@ export const CreateGuardrailRequest$outboundSchema = z.object({
23
23
  enforceZdrXai: z.nullable(z.boolean()).optional(),
24
24
  ignoredModels: z.nullable(z.array(z.string())).optional(),
25
25
  ignoredProviders: z.nullable(z.array(z.string())).optional(),
26
+ includeByokInBudgets: z.boolean().optional(),
26
27
  limitUsd: z.nullable(z.number()).optional(),
27
28
  name: z.string(),
28
29
  resetInterval: z.nullable(GuardrailInterval$outboundSchema).optional(),
@@ -41,6 +42,7 @@ export const CreateGuardrailRequest$outboundSchema = z.object({
41
42
  enforceZdrXai: "enforce_zdr_xai",
42
43
  ignoredModels: "ignored_models",
43
44
  ignoredProviders: "ignored_providers",
45
+ includeByokInBudgets: "include_byok_in_budgets",
44
46
  limitUsd: "limit_usd",
45
47
  resetInterval: "reset_interval",
46
48
  workspaceId: "workspace_id",
@@ -67,6 +67,10 @@ export type Guardrail = {
67
67
  * List of provider IDs to exclude from routing
68
68
  */
69
69
  ignoredProviders?: Array<string> | null | undefined;
70
+ /**
71
+ * Whether BYOK (bring-your-own-key) inference spend counts toward this guardrail's limit_usd, in addition to OpenRouter credit spend.
72
+ */
73
+ includeByokInBudgets: boolean;
70
74
  /**
71
75
  * Spending limit in USD
72
76
  */
@@ -26,6 +26,7 @@ export const Guardrail$inboundSchema = z.object({
26
26
  id: z.string(),
27
27
  ignored_models: z.nullable(z.array(z.string())).optional(),
28
28
  ignored_providers: z.nullable(z.array(z.string())).optional(),
29
+ include_byok_in_budgets: z.boolean(),
29
30
  limit_usd: z.nullable(z.number()).optional(),
30
31
  name: z.string(),
31
32
  reset_interval: z.nullable(GuardrailInterval$inboundSchema).optional(),
@@ -46,6 +47,7 @@ export const Guardrail$inboundSchema = z.object({
46
47
  "enforce_zdr_xai": "enforceZdrXai",
47
48
  "ignored_models": "ignoredModels",
48
49
  "ignored_providers": "ignoredProviders",
50
+ "include_byok_in_budgets": "includeByokInBudgets",
49
51
  "limit_usd": "limitUsd",
50
52
  "reset_interval": "resetInterval",
51
53
  "updated_at": "updatedAt",
@@ -57,6 +57,10 @@ export type UpdateGuardrailRequest = {
57
57
  * List of provider IDs to exclude from routing
58
58
  */
59
59
  ignoredProviders?: Array<string> | null | undefined;
60
+ /**
61
+ * Whether BYOK (bring-your-own-key) inference spend counts toward this guardrail's limit_usd, in addition to OpenRouter credit spend. Omit to leave unchanged.
62
+ */
63
+ includeByokInBudgets?: boolean | undefined;
60
64
  /**
61
65
  * New spending limit in USD
62
66
  */
@@ -85,6 +89,7 @@ export type UpdateGuardrailRequest$Outbound = {
85
89
  enforce_zdr_xai?: boolean | null | undefined;
86
90
  ignored_models?: Array<string> | null | undefined;
87
91
  ignored_providers?: Array<string> | null | undefined;
92
+ include_byok_in_budgets?: boolean | undefined;
88
93
  limit_usd?: number | null | undefined;
89
94
  name?: string | undefined;
90
95
  reset_interval?: string | null | undefined;
@@ -23,6 +23,7 @@ export const UpdateGuardrailRequest$outboundSchema = z.object({
23
23
  enforceZdrXai: z.nullable(z.boolean()).optional(),
24
24
  ignoredModels: z.nullable(z.array(z.string())).optional(),
25
25
  ignoredProviders: z.nullable(z.array(z.string())).optional(),
26
+ includeByokInBudgets: z.boolean().optional(),
26
27
  limitUsd: z.nullable(z.number()).optional(),
27
28
  name: z.string().optional(),
28
29
  resetInterval: z.nullable(GuardrailInterval$outboundSchema).optional(),
@@ -40,6 +41,7 @@ export const UpdateGuardrailRequest$outboundSchema = z.object({
40
41
  enforceZdrXai: "enforce_zdr_xai",
41
42
  ignoredModels: "ignored_models",
42
43
  ignoredProviders: "ignored_providers",
44
+ includeByokInBudgets: "include_byok_in_budgets",
43
45
  limitUsd: "limit_usd",
44
46
  resetInterval: "reset_interval",
45
47
  });
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.0.14",
5
+ "version": "1.0.16",
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.0.14",
3
+ "version": "1.0.16",
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,13 +73,13 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
- "compile": "tsc",
76
+ "postinstall": "node scripts/check-types.js || true",
77
77
  "prepare": "npm run build",
78
+ "test:transit": "exit 0",
79
+ "typecheck:transit": "exit 0",
80
+ "compile": "tsc",
78
81
  "test": "vitest --run --project unit",
79
82
  "test:e2e": "vitest --run --project e2e",
80
- "typecheck:transit": "exit 0",
81
- "postinstall": "node scripts/check-types.js || true",
82
- "test:transit": "exit 0",
83
83
  "test:watch": "vitest --watch --project unit",
84
84
  "typecheck": "tsc --noEmit"
85
85
  },