@openrouter/sdk 1.2.113 → 1.2.115
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/byokkey.d.ts +9 -1
- package/esm/models/byokkey.js +4 -0
- package/esm/models/byokproviderslug.d.ts +1 -0
- package/esm/models/byokproviderslug.js +1 -0
- package/esm/models/createbyokkeyrequest.d.ts +11 -1
- package/esm/models/createbyokkeyrequest.js +4 -0
- package/esm/models/imagegenerationproviderpreferences.d.ts +6 -0
- package/esm/models/imagegenerationproviderpreferences.js +2 -0
- package/esm/models/operations/listbyokkeys.d.ts +1 -0
- package/esm/models/operations/listbyokkeys.js +1 -0
- package/esm/models/providername.d.ts +1 -0
- package/esm/models/providername.js +1 -0
- package/esm/models/provideroptions.d.ts +6 -0
- package/esm/models/provideroptions.js +2 -0
- package/esm/models/providerresponse.d.ts +1 -0
- package/esm/models/providerresponse.js +1 -0
- package/esm/models/updatebyokkeyrequest.d.ts +11 -1
- package/esm/models/updatebyokkeyrequest.js +4 -0
- package/esm/models/videogenerationrequest.d.ts +6 -0
- package/esm/models/videogenerationrequest.js +2 -0
- package/jsr.json +1 -1
- package/package.json +5 -5
package/esm/lib/config.d.ts
CHANGED
|
@@ -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.
|
|
53
|
+
readonly sdkVersion: "1.2.115";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.115 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.
|
|
32
|
+
sdkVersion: "1.2.115",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.115 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
package/esm/models/byokkey.d.ts
CHANGED
|
@@ -28,9 +28,17 @@ export type BYOKKey = {
|
|
|
28
28
|
*/
|
|
29
29
|
id: string;
|
|
30
30
|
/**
|
|
31
|
-
* Whether this
|
|
31
|
+
* Whether OpenRouter's shared endpoints on this provider are removed for every model, including models outside `allowed_models` and after all of your keys for the provider fail. The provider is skipped instead of spending OpenRouter credits. Only valid on non-fallback credentials.
|
|
32
|
+
*/
|
|
33
|
+
isByokOnly: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. Cannot be combined with `is_byok_only`.
|
|
32
36
|
*/
|
|
33
37
|
isFallback: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether OpenRouter's shared endpoints on this provider are removed for the models this credential applies to (its `allowed_models`, or every model when `null`). Requests for those models run only on your keys; models outside the allowlist may still fall back to shared capacity on this provider.
|
|
40
|
+
*/
|
|
41
|
+
isRequired: boolean;
|
|
34
42
|
/**
|
|
35
43
|
* Short masked snippet of the key (e.g. the first/last few characters) used to identify it in the UI.
|
|
36
44
|
*/
|
package/esm/models/byokkey.js
CHANGED
|
@@ -14,7 +14,9 @@ export const BYOKKey$inboundSchema = z.object({
|
|
|
14
14
|
created_at: z.string(),
|
|
15
15
|
disabled: z.boolean(),
|
|
16
16
|
id: z.string(),
|
|
17
|
+
is_byok_only: z.boolean(),
|
|
17
18
|
is_fallback: z.boolean(),
|
|
19
|
+
is_required: z.boolean(),
|
|
18
20
|
label: z.string(),
|
|
19
21
|
name: z.nullable(z.string()).optional(),
|
|
20
22
|
provider: BYOKProviderSlug$inboundSchema,
|
|
@@ -26,7 +28,9 @@ export const BYOKKey$inboundSchema = z.object({
|
|
|
26
28
|
"allowed_models": "allowedModels",
|
|
27
29
|
"allowed_user_ids": "allowedUserIds",
|
|
28
30
|
"created_at": "createdAt",
|
|
31
|
+
"is_byok_only": "isByokOnly",
|
|
29
32
|
"is_fallback": "isFallback",
|
|
33
|
+
"is_required": "isRequired",
|
|
30
34
|
"sort_order": "sortOrder",
|
|
31
35
|
"workspace_id": "workspaceId",
|
|
32
36
|
});
|
|
@@ -67,6 +67,7 @@ export declare const BYOKProviderSlug: {
|
|
|
67
67
|
readonly Modular: "modular";
|
|
68
68
|
readonly Moonshotai: "moonshotai";
|
|
69
69
|
readonly Morph: "morph";
|
|
70
|
+
readonly NearAi: "near-ai";
|
|
70
71
|
readonly Nebius: "nebius";
|
|
71
72
|
readonly NexAgi: "nex-agi";
|
|
72
73
|
readonly Nextbit: "nextbit";
|
|
@@ -18,9 +18,17 @@ export type CreateBYOKKeyRequest = {
|
|
|
18
18
|
*/
|
|
19
19
|
disabled?: boolean | undefined;
|
|
20
20
|
/**
|
|
21
|
-
* Whether this
|
|
21
|
+
* Whether OpenRouter's shared endpoints on this provider are removed for every model, including models outside `allowed_models` and after all of your keys for the provider fail. The provider is skipped instead of spending OpenRouter credits. Only valid on non-fallback credentials. Defaults to `false`.
|
|
22
|
+
*/
|
|
23
|
+
isByokOnly?: boolean | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. Cannot be combined with `is_byok_only`.
|
|
22
26
|
*/
|
|
23
27
|
isFallback?: boolean | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Whether OpenRouter's shared endpoints on this provider are removed for the models this credential applies to (its `allowed_models`, or every model when `null`). Requests for those models run only on your keys; models outside the allowlist may still fall back to shared capacity on this provider. Defaults to `false`.
|
|
30
|
+
*/
|
|
31
|
+
isRequired?: boolean | undefined;
|
|
24
32
|
/**
|
|
25
33
|
* The raw provider API key or credential. This value is encrypted at rest and never returned in API responses.
|
|
26
34
|
*/
|
|
@@ -44,7 +52,9 @@ export type CreateBYOKKeyRequest$Outbound = {
|
|
|
44
52
|
allowed_models?: Array<string> | null | undefined;
|
|
45
53
|
allowed_user_ids?: Array<string> | null | undefined;
|
|
46
54
|
disabled?: boolean | undefined;
|
|
55
|
+
is_byok_only?: boolean | undefined;
|
|
47
56
|
is_fallback?: boolean | undefined;
|
|
57
|
+
is_required?: boolean | undefined;
|
|
48
58
|
key: string;
|
|
49
59
|
name?: string | null | undefined;
|
|
50
60
|
provider: string;
|
|
@@ -11,7 +11,9 @@ export const CreateBYOKKeyRequest$outboundSchema = z.object({
|
|
|
11
11
|
allowedModels: z.nullable(z.array(z.string())).optional(),
|
|
12
12
|
allowedUserIds: z.nullable(z.array(z.string())).optional(),
|
|
13
13
|
disabled: z.boolean().optional(),
|
|
14
|
+
isByokOnly: z.boolean().optional(),
|
|
14
15
|
isFallback: z.boolean().optional(),
|
|
16
|
+
isRequired: z.boolean().optional(),
|
|
15
17
|
key: z.string(),
|
|
16
18
|
name: z.nullable(z.string()).optional(),
|
|
17
19
|
provider: BYOKProviderSlug$outboundSchema,
|
|
@@ -21,7 +23,9 @@ export const CreateBYOKKeyRequest$outboundSchema = z.object({
|
|
|
21
23
|
allowedApiKeyHashes: "allowed_api_key_hashes",
|
|
22
24
|
allowedModels: "allowed_models",
|
|
23
25
|
allowedUserIds: "allowed_user_ids",
|
|
26
|
+
isByokOnly: "is_byok_only",
|
|
24
27
|
isFallback: "is_fallback",
|
|
28
|
+
isRequired: "is_required",
|
|
25
29
|
workspaceId: "workspace_id",
|
|
26
30
|
});
|
|
27
31
|
});
|
|
@@ -266,6 +266,9 @@ export type ImageGenerationProviderPreferencesOptions = {
|
|
|
266
266
|
ncompass?: {
|
|
267
267
|
[k: string]: any;
|
|
268
268
|
} | undefined;
|
|
269
|
+
nearAi?: {
|
|
270
|
+
[k: string]: any;
|
|
271
|
+
} | undefined;
|
|
269
272
|
nebius?: {
|
|
270
273
|
[k: string]: any;
|
|
271
274
|
} | undefined;
|
|
@@ -731,6 +734,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
|
|
|
731
734
|
ncompass?: {
|
|
732
735
|
[k: string]: any;
|
|
733
736
|
} | undefined;
|
|
737
|
+
"near-ai"?: {
|
|
738
|
+
[k: string]: any;
|
|
739
|
+
} | undefined;
|
|
734
740
|
nebius?: {
|
|
735
741
|
[k: string]: any;
|
|
736
742
|
} | undefined;
|
|
@@ -105,6 +105,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
|
|
|
105
105
|
moonshotai: z.record(z.string(), z.any()).optional(),
|
|
106
106
|
morph: z.record(z.string(), z.any()).optional(),
|
|
107
107
|
ncompass: z.record(z.string(), z.any()).optional(),
|
|
108
|
+
nearAi: z.record(z.string(), z.any()).optional(),
|
|
108
109
|
nebius: z.record(z.string(), z.any()).optional(),
|
|
109
110
|
nexAgi: z.record(z.string(), z.any()).optional(),
|
|
110
111
|
nextbit: z.record(z.string(), z.any()).optional(),
|
|
@@ -180,6 +181,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
|
|
|
180
181
|
ioNet: "io-net",
|
|
181
182
|
lynnPrivate: "lynn-private",
|
|
182
183
|
mancerOld: "mancer-old",
|
|
184
|
+
nearAi: "near-ai",
|
|
183
185
|
nexAgi: "nex-agi",
|
|
184
186
|
openInference: "open-inference",
|
|
185
187
|
sailResearch: "sail-research",
|
|
@@ -66,6 +66,7 @@ export declare const ProviderName: {
|
|
|
66
66
|
readonly MoonshotAI: "Moonshot AI";
|
|
67
67
|
readonly Morph: "Morph";
|
|
68
68
|
readonly VoyageAIByMongoDB: "VoyageAI by MongoDB";
|
|
69
|
+
readonly NearAI: "Near AI";
|
|
69
70
|
readonly Nebius: "Nebius";
|
|
70
71
|
readonly NexAGI: "Nex AGI";
|
|
71
72
|
readonly NextBit: "NextBit";
|
|
@@ -261,6 +261,9 @@ export type ProviderOptions = {
|
|
|
261
261
|
ncompass?: {
|
|
262
262
|
[k: string]: any;
|
|
263
263
|
} | undefined;
|
|
264
|
+
nearAi?: {
|
|
265
|
+
[k: string]: any;
|
|
266
|
+
} | undefined;
|
|
264
267
|
nebius?: {
|
|
265
268
|
[k: string]: any;
|
|
266
269
|
} | undefined;
|
|
@@ -681,6 +684,9 @@ export type ProviderOptions$Outbound = {
|
|
|
681
684
|
ncompass?: {
|
|
682
685
|
[k: string]: any;
|
|
683
686
|
} | undefined;
|
|
687
|
+
"near-ai"?: {
|
|
688
|
+
[k: string]: any;
|
|
689
|
+
} | undefined;
|
|
684
690
|
nebius?: {
|
|
685
691
|
[k: string]: any;
|
|
686
692
|
} | undefined;
|
|
@@ -92,6 +92,7 @@ export const ProviderOptions$outboundSchema = z.object({
|
|
|
92
92
|
moonshotai: z.record(z.string(), z.any()).optional(),
|
|
93
93
|
morph: z.record(z.string(), z.any()).optional(),
|
|
94
94
|
ncompass: z.record(z.string(), z.any()).optional(),
|
|
95
|
+
nearAi: z.record(z.string(), z.any()).optional(),
|
|
95
96
|
nebius: z.record(z.string(), z.any()).optional(),
|
|
96
97
|
nexAgi: z.record(z.string(), z.any()).optional(),
|
|
97
98
|
nextbit: z.record(z.string(), z.any()).optional(),
|
|
@@ -167,6 +168,7 @@ export const ProviderOptions$outboundSchema = z.object({
|
|
|
167
168
|
ioNet: "io-net",
|
|
168
169
|
lynnPrivate: "lynn-private",
|
|
169
170
|
mancerOld: "mancer-old",
|
|
171
|
+
nearAi: "near-ai",
|
|
170
172
|
nexAgi: "nex-agi",
|
|
171
173
|
openInference: "open-inference",
|
|
172
174
|
sailResearch: "sail-research",
|
|
@@ -99,6 +99,7 @@ export declare const ProviderResponseProviderName: {
|
|
|
99
99
|
readonly MoonshotAI: "Moonshot AI";
|
|
100
100
|
readonly Morph: "Morph";
|
|
101
101
|
readonly VoyageAIByMongoDB: "VoyageAI by MongoDB";
|
|
102
|
+
readonly NearAI: "Near AI";
|
|
102
103
|
readonly Nebius: "Nebius";
|
|
103
104
|
readonly NexAGI: "Nex AGI";
|
|
104
105
|
readonly NextBit: "NextBit";
|
|
@@ -17,9 +17,17 @@ export type UpdateBYOKKeyRequest = {
|
|
|
17
17
|
*/
|
|
18
18
|
disabled?: boolean | undefined;
|
|
19
19
|
/**
|
|
20
|
-
* Whether this
|
|
20
|
+
* Whether OpenRouter's shared endpoints on this provider are removed for every model, including models outside `allowed_models` and after all of your keys for the provider fail. The provider is skipped instead of spending OpenRouter credits. Only valid on non-fallback credentials. Omit to leave the stored value unchanged.
|
|
21
|
+
*/
|
|
22
|
+
isByokOnly?: boolean | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. Cannot be combined with `is_byok_only`. Omit to leave the stored value unchanged.
|
|
21
25
|
*/
|
|
22
26
|
isFallback?: boolean | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Whether OpenRouter's shared endpoints on this provider are removed for the models this credential applies to (its `allowed_models`, or every model when `null`). Requests for those models run only on your keys; models outside the allowlist may still fall back to shared capacity on this provider. Omit to leave the stored value unchanged.
|
|
29
|
+
*/
|
|
30
|
+
isRequired?: boolean | undefined;
|
|
23
31
|
/**
|
|
24
32
|
* A new raw provider API key to rotate the credential in-place. The previous key material is overwritten and the masked label is regenerated. Encrypted at rest and never returned in API responses.
|
|
25
33
|
*/
|
|
@@ -35,7 +43,9 @@ export type UpdateBYOKKeyRequest$Outbound = {
|
|
|
35
43
|
allowed_models?: Array<string> | null | undefined;
|
|
36
44
|
allowed_user_ids?: Array<string> | null | undefined;
|
|
37
45
|
disabled?: boolean | undefined;
|
|
46
|
+
is_byok_only?: boolean | undefined;
|
|
38
47
|
is_fallback?: boolean | undefined;
|
|
48
|
+
is_required?: boolean | undefined;
|
|
39
49
|
key?: string | undefined;
|
|
40
50
|
name?: string | null | undefined;
|
|
41
51
|
};
|
|
@@ -10,7 +10,9 @@ export const UpdateBYOKKeyRequest$outboundSchema = z.object({
|
|
|
10
10
|
allowedModels: z.nullable(z.array(z.string())).optional(),
|
|
11
11
|
allowedUserIds: z.nullable(z.array(z.string())).optional(),
|
|
12
12
|
disabled: z.boolean().optional(),
|
|
13
|
+
isByokOnly: z.boolean().optional(),
|
|
13
14
|
isFallback: z.boolean().optional(),
|
|
15
|
+
isRequired: z.boolean().optional(),
|
|
14
16
|
key: z.string().optional(),
|
|
15
17
|
name: z.nullable(z.string()).optional(),
|
|
16
18
|
}).transform((v) => {
|
|
@@ -18,7 +20,9 @@ export const UpdateBYOKKeyRequest$outboundSchema = z.object({
|
|
|
18
20
|
allowedApiKeyHashes: "allowed_api_key_hashes",
|
|
19
21
|
allowedModels: "allowed_models",
|
|
20
22
|
allowedUserIds: "allowed_user_ids",
|
|
23
|
+
isByokOnly: "is_byok_only",
|
|
21
24
|
isFallback: "is_fallback",
|
|
25
|
+
isRequired: "is_required",
|
|
22
26
|
});
|
|
23
27
|
});
|
|
24
28
|
export function updateBYOKKeyRequestToJSON(updateBYOKKeyRequest) {
|
|
@@ -282,6 +282,9 @@ export type VideoGenerationRequestOptions = {
|
|
|
282
282
|
ncompass?: {
|
|
283
283
|
[k: string]: any;
|
|
284
284
|
} | undefined;
|
|
285
|
+
nearAi?: {
|
|
286
|
+
[k: string]: any;
|
|
287
|
+
} | undefined;
|
|
285
288
|
nebius?: {
|
|
286
289
|
[k: string]: any;
|
|
287
290
|
} | undefined;
|
|
@@ -781,6 +784,9 @@ export type VideoGenerationRequestOptions$Outbound = {
|
|
|
781
784
|
ncompass?: {
|
|
782
785
|
[k: string]: any;
|
|
783
786
|
} | undefined;
|
|
787
|
+
"near-ai"?: {
|
|
788
|
+
[k: string]: any;
|
|
789
|
+
} | undefined;
|
|
784
790
|
nebius?: {
|
|
785
791
|
[k: string]: any;
|
|
786
792
|
} | undefined;
|
|
@@ -123,6 +123,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
123
123
|
moonshotai: z.record(z.string(), z.any()).optional(),
|
|
124
124
|
morph: z.record(z.string(), z.any()).optional(),
|
|
125
125
|
ncompass: z.record(z.string(), z.any()).optional(),
|
|
126
|
+
nearAi: z.record(z.string(), z.any()).optional(),
|
|
126
127
|
nebius: z.record(z.string(), z.any()).optional(),
|
|
127
128
|
nexAgi: z.record(z.string(), z.any()).optional(),
|
|
128
129
|
nextbit: z.record(z.string(), z.any()).optional(),
|
|
@@ -198,6 +199,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
198
199
|
ioNet: "io-net",
|
|
199
200
|
lynnPrivate: "lynn-private",
|
|
200
201
|
mancerOld: "mancer-old",
|
|
202
|
+
nearAi: "near-ai",
|
|
201
203
|
nexAgi: "nex-agi",
|
|
202
204
|
openInference: "open-inference",
|
|
203
205
|
sailResearch: "sail-research",
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.115",
|
|
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": [
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
76
|
"postinstall": "node scripts/check-types.js || true",
|
|
77
|
-
"prepare": "npm run build",
|
|
78
77
|
"test": "vitest --run --project unit",
|
|
79
|
-
"test:
|
|
80
|
-
"test:transit": "exit 0",
|
|
78
|
+
"test:watch": "vitest --watch --project unit",
|
|
81
79
|
"typecheck": "tsc --noEmit",
|
|
82
80
|
"compile": "tsc",
|
|
83
|
-
"
|
|
81
|
+
"prepare": "npm run build",
|
|
82
|
+
"test:e2e": "vitest --run --project e2e",
|
|
83
|
+
"test:transit": "exit 0",
|
|
84
84
|
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|