@openrouter/sdk 1.5.137 → 1.5.138

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.5.137";
52
+ readonly sdkVersion: "1.5.138";
53
53
  readonly genVersion: "2.960.8";
54
- readonly userAgent: "speakeasy-sdk/typescript 1.5.137 2.960.8 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.138 2.960.8 1.0.0 @openrouter/sdk";
55
55
  };
56
56
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -25,8 +25,8 @@ export function serverURLFromOptions(options) {
25
25
  export const SDK_METADATA = {
26
26
  language: "typescript",
27
27
  openapiDocVersion: "1.0.0",
28
- sdkVersion: "1.5.137",
28
+ sdkVersion: "1.5.138",
29
29
  genVersion: "2.960.8",
30
- userAgent: "speakeasy-sdk/typescript 1.5.137 2.960.8 1.0.0 @openrouter/sdk",
30
+ userAgent: "speakeasy-sdk/typescript 1.5.138 2.960.8 1.0.0 @openrouter/sdk",
31
31
  };
32
32
  //# sourceMappingURL=config.js.map
@@ -12,6 +12,10 @@ export type CreateGuardrailRequest = {
12
12
  * Whether ZDR-only requests to google/* models may also use Safety Retention endpoints, which may retain prompts and responses from any request, only to prevent abuse, and do not use them for training. false allows only ZDR endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.
13
13
  */
14
14
  allowSafetyRetentionGoogle?: boolean | null | undefined;
15
+ /**
16
+ * Whether ZDR-only requests to openai/* models may also use Safety Retention endpoints, which may retain prompts and responses from any request, only to prevent abuse, and do not use them for training. false allows only ZDR endpoints. Applies only while OpenAI ZDR is on for the account or this guardrail; otherwise allow_safety_retention_other applies. Follows allow_safety_retention_other when null; on update, null clears a saved choice and omitting the field leaves it unchanged. While the account enforces ZDR for OpenAI or for other models, a guardrail can only be more restrictive than that account setting.
17
+ */
18
+ allowSafetyRetentionOpenai?: boolean | null | undefined;
15
19
  /**
16
20
  * Whether ZDR-only requests to models outside the named providers (for example open-weight models on Vertex) may also use Safety Retention endpoints, which may retain prompts and responses from any request, only to prevent abuse, and do not use them for training. false allows only ZDR endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.
17
21
  */
@@ -115,6 +119,7 @@ export type CreateGuardrailRequest = {
115
119
  export type CreateGuardrailRequest$Outbound = {
116
120
  allow_provisional_providers?: boolean | null | undefined;
117
121
  allow_safety_retention_google?: boolean | null | undefined;
122
+ allow_safety_retention_openai?: boolean | null | undefined;
118
123
  allow_safety_retention_other?: boolean | null | undefined;
119
124
  allowed_data_regions?: Array<string> | null | undefined;
120
125
  allowed_models?: Array<string> | null | undefined;
@@ -11,6 +11,7 @@ import { GuardrailInterval$outboundSchema, } from "./guardrailinterval.js";
11
11
  export const CreateGuardrailRequest$outboundSchema = z.object({
12
12
  allowProvisionalProviders: z.nullable(z.boolean()).optional(),
13
13
  allowSafetyRetentionGoogle: z.nullable(z.boolean()).optional(),
14
+ allowSafetyRetentionOpenai: z.nullable(z.boolean()).optional(),
14
15
  allowSafetyRetentionOther: z.nullable(z.boolean()).optional(),
15
16
  allowedDataRegions: z.nullable(z.array(GuardrailDataRegion$outboundSchema))
16
17
  .optional(),
@@ -41,6 +42,7 @@ export const CreateGuardrailRequest$outboundSchema = z.object({
41
42
  return remap$(v, {
42
43
  allowProvisionalProviders: "allow_provisional_providers",
43
44
  allowSafetyRetentionGoogle: "allow_safety_retention_google",
45
+ allowSafetyRetentionOpenai: "allow_safety_retention_openai",
44
46
  allowSafetyRetentionOther: "allow_safety_retention_other",
45
47
  allowedDataRegions: "allowed_data_regions",
46
48
  allowedModels: "allowed_models",
@@ -14,6 +14,10 @@ export type Guardrail = {
14
14
  * Whether ZDR-only requests to google/* models may also use Safety Retention endpoints, which may retain prompts and responses from any request, only to prevent abuse, and do not use them for training. false allows only ZDR endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.
15
15
  */
16
16
  allowSafetyRetentionGoogle?: boolean | null | undefined;
17
+ /**
18
+ * Whether ZDR-only requests to openai/* models may also use Safety Retention endpoints, which may retain prompts and responses from any request, only to prevent abuse, and do not use them for training. false allows only ZDR endpoints. Applies only while OpenAI ZDR is on for the account or this guardrail; otherwise allow_safety_retention_other applies. Follows allow_safety_retention_other when null; on update, null clears a saved choice and omitting the field leaves it unchanged. While the account enforces ZDR for OpenAI or for other models, a guardrail can only be more restrictive than that account setting.
19
+ */
20
+ allowSafetyRetentionOpenai?: boolean | null | undefined;
17
21
  /**
18
22
  * Whether ZDR-only requests to models outside the named providers (for example open-weight models on Vertex) may also use Safety Retention endpoints, which may retain prompts and responses from any request, only to prevent abuse, and do not use them for training. false allows only ZDR endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.
19
23
  */
@@ -12,6 +12,7 @@ import { GuardrailInterval$inboundSchema, } from "./guardrailinterval.js";
12
12
  export const Guardrail$inboundSchema = z.object({
13
13
  allow_provisional_providers: z.nullable(z.boolean()).optional(),
14
14
  allow_safety_retention_google: z.nullable(z.boolean()).optional(),
15
+ allow_safety_retention_openai: z.nullable(z.boolean()).optional(),
15
16
  allow_safety_retention_other: z.nullable(z.boolean()).optional(),
16
17
  allowed_data_regions: z.nullable(z.array(GuardrailDataRegion$inboundSchema))
17
18
  .optional(),
@@ -45,6 +46,7 @@ export const Guardrail$inboundSchema = z.object({
45
46
  return remap$(v, {
46
47
  "allow_provisional_providers": "allowProvisionalProviders",
47
48
  "allow_safety_retention_google": "allowSafetyRetentionGoogle",
49
+ "allow_safety_retention_openai": "allowSafetyRetentionOpenai",
48
50
  "allow_safety_retention_other": "allowSafetyRetentionOther",
49
51
  "allowed_data_regions": "allowedDataRegions",
50
52
  "allowed_models": "allowedModels",
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
2
2
  export type GuardrailModelAvailabilityPolicyAuthoringConfig = {
3
3
  allowProvisionalProviders?: boolean | null | undefined;
4
4
  allowSafetyRetentionGoogle?: boolean | null | undefined;
5
+ allowSafetyRetentionOpenai?: boolean | null | undefined;
5
6
  allowSafetyRetentionOther?: boolean | null | undefined;
6
7
  allowedDataRegions?: Array<string> | null | undefined;
7
8
  allowedModels?: Array<string> | null | undefined;
@@ -27,6 +28,7 @@ export type GuardrailModelAvailabilityPolicyAuthoringConfig = {
27
28
  export type GuardrailModelAvailabilityPolicyAuthoringConfig$Outbound = {
28
29
  allow_provisional_providers?: boolean | null | undefined;
29
30
  allow_safety_retention_google?: boolean | null | undefined;
31
+ allow_safety_retention_openai?: boolean | null | undefined;
30
32
  allow_safety_retention_other?: boolean | null | undefined;
31
33
  allowed_data_regions?: Array<string> | null | undefined;
32
34
  allowed_models?: Array<string> | null | undefined;
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  export const GuardrailModelAvailabilityPolicyAuthoringConfig$outboundSchema = z.object({
8
8
  allowProvisionalProviders: z.nullable(z.boolean()).optional(),
9
9
  allowSafetyRetentionGoogle: z.nullable(z.boolean()).optional(),
10
+ allowSafetyRetentionOpenai: z.nullable(z.boolean()).optional(),
10
11
  allowSafetyRetentionOther: z.nullable(z.boolean()).optional(),
11
12
  allowedDataRegions: z.nullable(z.array(z.string())).optional(),
12
13
  allowedModels: z.nullable(z.array(z.string())).optional(),
@@ -31,6 +32,7 @@ export const GuardrailModelAvailabilityPolicyAuthoringConfig$outboundSchema = z.
31
32
  return remap$(v, {
32
33
  allowProvisionalProviders: "allow_provisional_providers",
33
34
  allowSafetyRetentionGoogle: "allow_safety_retention_google",
35
+ allowSafetyRetentionOpenai: "allow_safety_retention_openai",
34
36
  allowSafetyRetentionOther: "allow_safety_retention_other",
35
37
  allowedDataRegions: "allowed_data_regions",
36
38
  allowedModels: "allowed_models",
@@ -4,6 +4,7 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
4
  export type GuardrailModelAvailabilityPolicyConfig = {
5
5
  allowProvisionalProviders?: boolean | null | undefined;
6
6
  allowSafetyRetentionGoogle?: boolean | null | undefined;
7
+ allowSafetyRetentionOpenai?: boolean | null | undefined;
7
8
  allowSafetyRetentionOther?: boolean | null | undefined;
8
9
  allowedDataRegions?: Array<string> | null | undefined;
9
10
  allowedModels?: Array<string> | null | undefined;
@@ -8,6 +8,7 @@ import { safeParse } from "../lib/schemas.js";
8
8
  export const GuardrailModelAvailabilityPolicyConfig$inboundSchema = z.object({
9
9
  allow_provisional_providers: z.nullable(z.boolean()).optional(),
10
10
  allow_safety_retention_google: z.nullable(z.boolean()).optional(),
11
+ allow_safety_retention_openai: z.nullable(z.boolean()).optional(),
11
12
  allow_safety_retention_other: z.nullable(z.boolean()).optional(),
12
13
  allowed_data_regions: z.nullable(z.array(z.string())).optional(),
13
14
  allowed_models: z.nullable(z.array(z.string())).optional(),
@@ -32,6 +33,7 @@ export const GuardrailModelAvailabilityPolicyConfig$inboundSchema = z.object({
32
33
  return remap$(v, {
33
34
  "allow_provisional_providers": "allowProvisionalProviders",
34
35
  "allow_safety_retention_google": "allowSafetyRetentionGoogle",
36
+ "allow_safety_retention_openai": "allowSafetyRetentionOpenai",
35
37
  "allow_safety_retention_other": "allowSafetyRetentionOther",
36
38
  "allowed_data_regions": "allowedDataRegions",
37
39
  "allowed_models": "allowedModels",
@@ -12,6 +12,10 @@ export type UpdateGuardrailRequest = {
12
12
  * Whether ZDR-only requests to google/* models may also use Safety Retention endpoints, which may retain prompts and responses from any request, only to prevent abuse, and do not use them for training. false allows only ZDR endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.
13
13
  */
14
14
  allowSafetyRetentionGoogle?: boolean | null | undefined;
15
+ /**
16
+ * Whether ZDR-only requests to openai/* models may also use Safety Retention endpoints, which may retain prompts and responses from any request, only to prevent abuse, and do not use them for training. false allows only ZDR endpoints. Applies only while OpenAI ZDR is on for the account or this guardrail; otherwise allow_safety_retention_other applies. Follows allow_safety_retention_other when null; on update, null clears a saved choice and omitting the field leaves it unchanged. While the account enforces ZDR for OpenAI or for other models, a guardrail can only be more restrictive than that account setting.
17
+ */
18
+ allowSafetyRetentionOpenai?: boolean | null | undefined;
15
19
  /**
16
20
  * Whether ZDR-only requests to models outside the named providers (for example open-weight models on Vertex) may also use Safety Retention endpoints, which may retain prompts and responses from any request, only to prevent abuse, and do not use them for training. false allows only ZDR endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.
17
21
  */
@@ -111,6 +115,7 @@ export type UpdateGuardrailRequest = {
111
115
  export type UpdateGuardrailRequest$Outbound = {
112
116
  allow_provisional_providers?: boolean | null | undefined;
113
117
  allow_safety_retention_google?: boolean | null | undefined;
118
+ allow_safety_retention_openai?: boolean | null | undefined;
114
119
  allow_safety_retention_other?: boolean | null | undefined;
115
120
  allowed_data_regions?: Array<string> | null | undefined;
116
121
  allowed_models?: Array<string> | null | undefined;
@@ -11,6 +11,7 @@ import { GuardrailInterval$outboundSchema, } from "./guardrailinterval.js";
11
11
  export const UpdateGuardrailRequest$outboundSchema = z.object({
12
12
  allowProvisionalProviders: z.nullable(z.boolean()).optional(),
13
13
  allowSafetyRetentionGoogle: z.nullable(z.boolean()).optional(),
14
+ allowSafetyRetentionOpenai: z.nullable(z.boolean()).optional(),
14
15
  allowSafetyRetentionOther: z.nullable(z.boolean()).optional(),
15
16
  allowedDataRegions: z.nullable(z.array(GuardrailDataRegion$outboundSchema))
16
17
  .optional(),
@@ -40,6 +41,7 @@ export const UpdateGuardrailRequest$outboundSchema = z.object({
40
41
  return remap$(v, {
41
42
  allowProvisionalProviders: "allow_provisional_providers",
42
43
  allowSafetyRetentionGoogle: "allow_safety_retention_google",
44
+ allowSafetyRetentionOpenai: "allow_safety_retention_openai",
43
45
  allowSafetyRetentionOther: "allow_safety_retention_other",
44
46
  allowedDataRegions: "allowed_data_regions",
45
47
  allowedModels: "allowed_models",
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.137",
5
+ "version": "1.5.138",
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.5.137",
3
+ "version": "1.5.138",
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": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
+ "typecheck:transit": "exit 0",
76
77
  "compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
77
- "postinstall": "node scripts/check-types.js || true",
78
78
  "prepare": "npm run build",
79
- "test": "vitest --run --project unit",
80
79
  "test:e2e": "vitest --run --project e2e",
81
- "test:transit": "exit 0",
82
80
  "test:watch": "vitest --watch --project unit",
83
- "typecheck": "tsc --noEmit",
84
- "typecheck:transit": "exit 0"
81
+ "postinstall": "node scripts/check-types.js || true",
82
+ "test": "vitest --run --project unit",
83
+ "test:transit": "exit 0",
84
+ "typecheck": "tsc --noEmit"
85
85
  },
86
86
  "peerDependencies": {
87
87