@openrouter/sdk 1.5.137 → 1.5.139
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.
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/createguardrailrequest.d.ts +5 -0
- package/esm/models/createguardrailrequest.js +2 -0
- package/esm/models/guardrail.d.ts +4 -0
- package/esm/models/guardrail.js +2 -0
- package/esm/models/guardrailmodelavailabilitypolicyauthoringconfig.d.ts +2 -0
- package/esm/models/guardrailmodelavailabilitypolicyauthoringconfig.js +2 -0
- package/esm/models/guardrailmodelavailabilitypolicyconfig.d.ts +1 -0
- package/esm/models/guardrailmodelavailabilitypolicyconfig.js +2 -0
- package/esm/models/updateguardrailrequest.d.ts +5 -0
- package/esm/models/updateguardrailrequest.js +2 -0
- package/esm/models/videogenerationrequest.d.ts +3 -3
- package/jsr.json +1 -1
- package/package.json +5 -5
package/esm/lib/config.d.ts
CHANGED
|
@@ -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.
|
|
52
|
+
readonly sdkVersion: "1.5.139";
|
|
53
53
|
readonly genVersion: "2.960.8";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.139 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.
|
|
28
|
+
sdkVersion: "1.5.139",
|
|
29
29
|
genVersion: "2.960.8",
|
|
30
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
30
|
+
userAgent: "speakeasy-sdk/typescript 1.5.139 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
|
*/
|
package/esm/models/guardrail.js
CHANGED
|
@@ -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",
|
|
@@ -528,7 +528,7 @@ export type VideoGenerationRequestOptions = {
|
|
|
528
528
|
};
|
|
529
529
|
export type VideoGenerationRequestOrder = ProviderName | string;
|
|
530
530
|
/**
|
|
531
|
-
* Provider routing preferences (order, only, ignore), request-level data policy (zdr, data_collection) and provider-specific passthrough configuration. No video endpoint currently offers Zero Data Retention, so `zdr: true` fails routing.
|
|
531
|
+
* Provider routing preferences (order, only, ignore), request-level data policy (zdr, data_collection) and provider-specific passthrough configuration. Sorting by price, latency, or throughput and automatic provider fallbacks are not supported. No video endpoint currently offers Zero Data Retention, so `zdr: true` fails routing.
|
|
532
532
|
*/
|
|
533
533
|
export type VideoGenerationRequestProvider = {
|
|
534
534
|
/**
|
|
@@ -550,7 +550,7 @@ export type VideoGenerationRequestProvider = {
|
|
|
550
550
|
only?: Array<ProviderName | string> | null | undefined;
|
|
551
551
|
options?: VideoGenerationRequestOptions | undefined;
|
|
552
552
|
/**
|
|
553
|
-
* An ordered list of provider slugs
|
|
553
|
+
* An ordered list of provider slugs to prefer when choosing an eligible video endpoint. The request is submitted to one endpoint and is not retried on another provider if submission fails.
|
|
554
554
|
*/
|
|
555
555
|
order?: Array<ProviderName | string> | null | undefined;
|
|
556
556
|
/**
|
|
@@ -614,7 +614,7 @@ export type VideoGenerationRequest = {
|
|
|
614
614
|
*/
|
|
615
615
|
prompt?: string | undefined;
|
|
616
616
|
/**
|
|
617
|
-
* Provider routing preferences (order, only, ignore), request-level data policy (zdr, data_collection) and provider-specific passthrough configuration. No video endpoint currently offers Zero Data Retention, so `zdr: true` fails routing.
|
|
617
|
+
* Provider routing preferences (order, only, ignore), request-level data policy (zdr, data_collection) and provider-specific passthrough configuration. Sorting by price, latency, or throughput and automatic provider fallbacks are not supported. No video endpoint currently offers Zero Data Retention, so `zdr: true` fails routing.
|
|
618
618
|
*/
|
|
619
619
|
provider?: VideoGenerationRequestProvider | undefined;
|
|
620
620
|
/**
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.139",
|
|
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
|
-
"compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
|
|
77
76
|
"postinstall": "node scripts/check-types.js || true",
|
|
78
77
|
"prepare": "npm run build",
|
|
79
|
-
"test": "vitest --run --project unit",
|
|
80
78
|
"test:e2e": "vitest --run --project e2e",
|
|
79
|
+
"typecheck": "tsc --noEmit",
|
|
80
|
+
"test": "vitest --run --project unit",
|
|
81
81
|
"test:transit": "exit 0",
|
|
82
82
|
"test:watch": "vitest --watch --project unit",
|
|
83
|
-
"typecheck": "
|
|
84
|
-
"
|
|
83
|
+
"typecheck:transit": "exit 0",
|
|
84
|
+
"compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|