@openrouter/sdk 1.2.26 → 1.2.28
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/funcs/modelsListForUser.d.ts +1 -1
- package/esm/funcs/modelsListForUser.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/autobetarouterplugin.d.ts +2 -2
- package/esm/models/autorouterplugin.d.ts +2 -2
- package/esm/models/byokproviderslug.d.ts +1 -0
- package/esm/models/byokproviderslug.js +1 -0
- package/esm/models/imagegenerationproviderpreferences.d.ts +6 -0
- package/esm/models/imagegenerationproviderpreferences.js +1 -0
- package/esm/models/operations/getmodels.d.ts +6 -5
- package/esm/models/operations/getmodels.js +4 -2
- 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 +1 -0
- package/esm/models/providerresponse.d.ts +1 -0
- package/esm/models/providerresponse.js +1 -0
- package/esm/models/videogenerationrequest.d.ts +6 -0
- package/esm/models/videogenerationrequest.js +1 -0
- package/esm/sdk/models.d.ts +1 -1
- package/esm/sdk/models.js +1 -1
- package/jsr.json +1 -1
- package/package.json +8 -8
|
@@ -13,7 +13,7 @@ import { PageIterator } from "../types/operations.js";
|
|
|
13
13
|
* List models filtered by user provider preferences, privacy settings, and guardrails
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through
|
|
16
|
+
* List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region.
|
|
17
17
|
*/
|
|
18
18
|
export declare function modelsListForUser(client: OpenRouterCore, security: operations.ListModelsUserSecurity, request?: operations.ListModelsUserRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListModelsUserResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
|
|
19
19
|
offset: number;
|
|
@@ -17,7 +17,7 @@ import { createPageIterator, haltIterator, } from "../types/operations.js";
|
|
|
17
17
|
* List models filtered by user provider preferences, privacy settings, and guardrails
|
|
18
18
|
*
|
|
19
19
|
* @remarks
|
|
20
|
-
* List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through
|
|
20
|
+
* List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region.
|
|
21
21
|
*/
|
|
22
22
|
export function modelsListForUser(client, security, request, options) {
|
|
23
23
|
return new APIPromise($do(client, security, request, options));
|
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.2.
|
|
52
|
+
readonly sdkVersion: "1.2.28";
|
|
53
53
|
readonly genVersion: "2.914.0";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.28 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.2.
|
|
29
|
+
sdkVersion: "1.2.28",
|
|
30
30
|
genVersion: "2.914.0",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 1.2.28 2.914.0 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -16,7 +16,7 @@ export declare const AutoBetaRouterPluginCostTier: {
|
|
|
16
16
|
export type AutoBetaRouterPluginCostTier = OpenEnum<typeof AutoBetaRouterPluginCostTier>;
|
|
17
17
|
export type AutoBetaRouterPlugin = {
|
|
18
18
|
/**
|
|
19
|
-
* List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.
|
|
19
|
+
* List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.
|
|
20
20
|
*/
|
|
21
21
|
allowedModels?: Array<string> | undefined;
|
|
22
22
|
/**
|
|
@@ -34,7 +34,7 @@ export type AutoBetaRouterPlugin = {
|
|
|
34
34
|
*/
|
|
35
35
|
enabled?: boolean | undefined;
|
|
36
36
|
/**
|
|
37
|
-
* List of model patterns to exclude from auto-beta-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Applied after allowed_models, so an excluded pattern always wins over an allowed one.
|
|
37
|
+
* List of model patterns to exclude from auto-beta-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after allowed_models, so an excluded pattern always wins over an allowed one.
|
|
38
38
|
*/
|
|
39
39
|
excludedModels?: Array<string> | undefined;
|
|
40
40
|
id: "auto-beta-router";
|
|
@@ -16,7 +16,7 @@ export declare const AutoRouterPluginCostTier: {
|
|
|
16
16
|
export type AutoRouterPluginCostTier = OpenEnum<typeof AutoRouterPluginCostTier>;
|
|
17
17
|
export type AutoRouterPlugin = {
|
|
18
18
|
/**
|
|
19
|
-
* List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.
|
|
19
|
+
* List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.
|
|
20
20
|
*/
|
|
21
21
|
allowedModels?: Array<string> | undefined;
|
|
22
22
|
/**
|
|
@@ -34,7 +34,7 @@ export type AutoRouterPlugin = {
|
|
|
34
34
|
*/
|
|
35
35
|
enabled?: boolean | undefined;
|
|
36
36
|
/**
|
|
37
|
-
* List of model patterns to exclude from auto-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Applied after allowed_models, so an excluded pattern always wins over an allowed one.
|
|
37
|
+
* List of model patterns to exclude from auto-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after allowed_models, so an excluded pattern always wins over an allowed one.
|
|
38
38
|
*/
|
|
39
39
|
excludedModels?: Array<string> | undefined;
|
|
40
40
|
id: "auto-router";
|
|
@@ -29,6 +29,7 @@ export declare const BYOKProviderSlug: {
|
|
|
29
29
|
readonly Coreweave: "coreweave";
|
|
30
30
|
readonly Crusoe: "crusoe";
|
|
31
31
|
readonly Darkbloom: "darkbloom";
|
|
32
|
+
readonly Databricks: "databricks";
|
|
32
33
|
readonly Decart: "decart";
|
|
33
34
|
readonly Deepgram: "deepgram";
|
|
34
35
|
readonly Deepinfra: "deepinfra";
|
|
@@ -104,6 +104,9 @@ export type ImageGenerationProviderPreferencesOptions = {
|
|
|
104
104
|
darkbloom?: {
|
|
105
105
|
[k: string]: any;
|
|
106
106
|
} | undefined;
|
|
107
|
+
databricks?: {
|
|
108
|
+
[k: string]: any;
|
|
109
|
+
} | undefined;
|
|
107
110
|
decart?: {
|
|
108
111
|
[k: string]: any;
|
|
109
112
|
} | undefined;
|
|
@@ -548,6 +551,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
|
|
|
548
551
|
darkbloom?: {
|
|
549
552
|
[k: string]: any;
|
|
550
553
|
} | undefined;
|
|
554
|
+
databricks?: {
|
|
555
|
+
[k: string]: any;
|
|
556
|
+
} | undefined;
|
|
551
557
|
decart?: {
|
|
552
558
|
[k: string]: any;
|
|
553
559
|
} | undefined;
|
|
@@ -51,6 +51,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
|
|
|
51
51
|
crucible: z.record(z.string(), z.any()).optional(),
|
|
52
52
|
crusoe: z.record(z.string(), z.any()).optional(),
|
|
53
53
|
darkbloom: z.record(z.string(), z.any()).optional(),
|
|
54
|
+
databricks: z.record(z.string(), z.any()).optional(),
|
|
54
55
|
decart: z.record(z.string(), z.any()).optional(),
|
|
55
56
|
deepgram: z.record(z.string(), z.any()).optional(),
|
|
56
57
|
deepinfra: z.record(z.string(), z.any()).optional(),
|
|
@@ -88,15 +88,16 @@ export declare const Zdr: {
|
|
|
88
88
|
*/
|
|
89
89
|
export type Zdr = ClosedEnum<typeof Zdr>;
|
|
90
90
|
/**
|
|
91
|
-
* Filter to models with endpoints in the given data region
|
|
91
|
+
* Filter to models with endpoints in the given data region ("eu" or "us").
|
|
92
92
|
*/
|
|
93
93
|
export declare const Region: {
|
|
94
94
|
readonly Eu: "eu";
|
|
95
|
+
readonly Us: "us";
|
|
95
96
|
};
|
|
96
97
|
/**
|
|
97
|
-
* Filter to models with endpoints in the given data region
|
|
98
|
+
* Filter to models with endpoints in the given data region ("eu" or "us").
|
|
98
99
|
*/
|
|
99
|
-
export type Region =
|
|
100
|
+
export type Region = OpenEnum<typeof Region>;
|
|
100
101
|
export type GetModelsRequest = {
|
|
101
102
|
/**
|
|
102
103
|
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
@@ -182,7 +183,7 @@ export type GetModelsRequest = {
|
|
|
182
183
|
*/
|
|
183
184
|
zdr?: Zdr | undefined;
|
|
184
185
|
/**
|
|
185
|
-
* Filter to models with endpoints in the given data region
|
|
186
|
+
* Filter to models with endpoints in the given data region ("eu" or "us").
|
|
186
187
|
*/
|
|
187
188
|
region?: Region | undefined;
|
|
188
189
|
/**
|
|
@@ -246,7 +247,7 @@ export declare const Distillable$outboundSchema: z.ZodType<string, Distillable>;
|
|
|
246
247
|
/** @internal */
|
|
247
248
|
export declare const Zdr$outboundSchema: z.ZodEnum<typeof Zdr>;
|
|
248
249
|
/** @internal */
|
|
249
|
-
export declare const Region$outboundSchema: z.
|
|
250
|
+
export declare const Region$outboundSchema: z.ZodType<string, Region>;
|
|
250
251
|
/** @internal */
|
|
251
252
|
export type GetModelsRequest$Outbound = {
|
|
252
253
|
"HTTP-Referer"?: string | undefined;
|
|
@@ -55,10 +55,11 @@ export const Zdr = {
|
|
|
55
55
|
True: "true",
|
|
56
56
|
};
|
|
57
57
|
/**
|
|
58
|
-
* Filter to models with endpoints in the given data region
|
|
58
|
+
* Filter to models with endpoints in the given data region ("eu" or "us").
|
|
59
59
|
*/
|
|
60
60
|
export const Region = {
|
|
61
61
|
Eu: "eu",
|
|
62
|
+
Us: "us",
|
|
62
63
|
};
|
|
63
64
|
/** @internal */
|
|
64
65
|
export const GetModelsCategory$outboundSchema = openEnums.outboundSchema(GetModelsCategory);
|
|
@@ -69,7 +70,8 @@ export const Distillable$outboundSchema = openEnums.outboundSchema(Distillable);
|
|
|
69
70
|
/** @internal */
|
|
70
71
|
export const Zdr$outboundSchema = z.enum(Zdr);
|
|
71
72
|
/** @internal */
|
|
72
|
-
export const Region$outboundSchema =
|
|
73
|
+
export const Region$outboundSchema = openEnums
|
|
74
|
+
.outboundSchema(Region);
|
|
73
75
|
/** @internal */
|
|
74
76
|
export const GetModelsRequest$outboundSchema = z.object({
|
|
75
77
|
httpReferer: z.string().optional(),
|
|
@@ -53,6 +53,7 @@ export declare const Provider: {
|
|
|
53
53
|
readonly Coreweave: "coreweave";
|
|
54
54
|
readonly Crusoe: "crusoe";
|
|
55
55
|
readonly Darkbloom: "darkbloom";
|
|
56
|
+
readonly Databricks: "databricks";
|
|
56
57
|
readonly Decart: "decart";
|
|
57
58
|
readonly Deepgram: "deepgram";
|
|
58
59
|
readonly Deepinfra: "deepinfra";
|
|
@@ -29,6 +29,7 @@ export declare const ProviderName: {
|
|
|
29
29
|
readonly Crucible: "Crucible";
|
|
30
30
|
readonly Crusoe: "Crusoe";
|
|
31
31
|
readonly Darkbloom: "Darkbloom";
|
|
32
|
+
readonly Databricks: "Databricks";
|
|
32
33
|
readonly Decart: "Decart";
|
|
33
34
|
readonly Deepgram: "Deepgram";
|
|
34
35
|
readonly DeepInfra: "DeepInfra";
|
|
@@ -99,6 +99,9 @@ export type ProviderOptions = {
|
|
|
99
99
|
darkbloom?: {
|
|
100
100
|
[k: string]: any;
|
|
101
101
|
} | undefined;
|
|
102
|
+
databricks?: {
|
|
103
|
+
[k: string]: any;
|
|
104
|
+
} | undefined;
|
|
102
105
|
decart?: {
|
|
103
106
|
[k: string]: any;
|
|
104
107
|
} | undefined;
|
|
@@ -498,6 +501,9 @@ export type ProviderOptions$Outbound = {
|
|
|
498
501
|
darkbloom?: {
|
|
499
502
|
[k: string]: any;
|
|
500
503
|
} | undefined;
|
|
504
|
+
databricks?: {
|
|
505
|
+
[k: string]: any;
|
|
506
|
+
} | undefined;
|
|
501
507
|
decart?: {
|
|
502
508
|
[k: string]: any;
|
|
503
509
|
} | undefined;
|
|
@@ -38,6 +38,7 @@ export const ProviderOptions$outboundSchema = z.object({
|
|
|
38
38
|
crucible: z.record(z.string(), z.any()).optional(),
|
|
39
39
|
crusoe: z.record(z.string(), z.any()).optional(),
|
|
40
40
|
darkbloom: z.record(z.string(), z.any()).optional(),
|
|
41
|
+
databricks: z.record(z.string(), z.any()).optional(),
|
|
41
42
|
decart: z.record(z.string(), z.any()).optional(),
|
|
42
43
|
deepgram: z.record(z.string(), z.any()).optional(),
|
|
43
44
|
deepinfra: z.record(z.string(), z.any()).optional(),
|
|
@@ -61,6 +61,7 @@ export declare const ProviderResponseProviderName: {
|
|
|
61
61
|
readonly Crucible: "Crucible";
|
|
62
62
|
readonly Crusoe: "Crusoe";
|
|
63
63
|
readonly Darkbloom: "Darkbloom";
|
|
64
|
+
readonly Databricks: "Databricks";
|
|
64
65
|
readonly Decart: "Decart";
|
|
65
66
|
readonly Deepgram: "Deepgram";
|
|
66
67
|
readonly DeepInfra: "DeepInfra";
|
|
@@ -120,6 +120,9 @@ export type VideoGenerationRequestOptions = {
|
|
|
120
120
|
darkbloom?: {
|
|
121
121
|
[k: string]: any;
|
|
122
122
|
} | undefined;
|
|
123
|
+
databricks?: {
|
|
124
|
+
[k: string]: any;
|
|
125
|
+
} | undefined;
|
|
123
126
|
decart?: {
|
|
124
127
|
[k: string]: any;
|
|
125
128
|
} | undefined;
|
|
@@ -590,6 +593,9 @@ export type VideoGenerationRequestOptions$Outbound = {
|
|
|
590
593
|
darkbloom?: {
|
|
591
594
|
[k: string]: any;
|
|
592
595
|
} | undefined;
|
|
596
|
+
databricks?: {
|
|
597
|
+
[k: string]: any;
|
|
598
|
+
} | undefined;
|
|
593
599
|
decart?: {
|
|
594
600
|
[k: string]: any;
|
|
595
601
|
} | undefined;
|
|
@@ -69,6 +69,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
69
69
|
crucible: z.record(z.string(), z.any()).optional(),
|
|
70
70
|
crusoe: z.record(z.string(), z.any()).optional(),
|
|
71
71
|
darkbloom: z.record(z.string(), z.any()).optional(),
|
|
72
|
+
databricks: z.record(z.string(), z.any()).optional(),
|
|
72
73
|
decart: z.record(z.string(), z.any()).optional(),
|
|
73
74
|
deepgram: z.record(z.string(), z.any()).optional(),
|
|
74
75
|
deepinfra: z.record(z.string(), z.any()).optional(),
|
package/esm/sdk/models.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare class Models extends ClientSDK {
|
|
|
24
24
|
* List models filtered by user provider preferences, privacy settings, and guardrails
|
|
25
25
|
*
|
|
26
26
|
* @remarks
|
|
27
|
-
* List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through
|
|
27
|
+
* List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region.
|
|
28
28
|
*/
|
|
29
29
|
listForUser(security: operations.ListModelsUserSecurity, request?: operations.ListModelsUserRequest | undefined, options?: RequestOptions): Promise<PageIterator<operations.ListModelsUserResponse, {
|
|
30
30
|
offset: number;
|
package/esm/sdk/models.js
CHANGED
|
@@ -35,7 +35,7 @@ export class Models extends ClientSDK {
|
|
|
35
35
|
* List models filtered by user provider preferences, privacy settings, and guardrails
|
|
36
36
|
*
|
|
37
37
|
* @remarks
|
|
38
|
-
* List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through
|
|
38
|
+
* List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region.
|
|
39
39
|
*/
|
|
40
40
|
async listForUser(security, request, options) {
|
|
41
41
|
return unwrapResultIterator(modelsListForUser(this, security, request, options));
|
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.28",
|
|
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
|
-
"
|
|
25
|
-
"
|
|
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
|
-
"compile": "tsc",
|
|
77
|
-
"prepare": "npm run build",
|
|
78
|
-
"test:watch": "vitest --watch --project unit",
|
|
79
76
|
"postinstall": "node scripts/check-types.js || true",
|
|
77
|
+
"prepare": "npm run build",
|
|
80
78
|
"test": "vitest --run --project unit",
|
|
81
79
|
"test:e2e": "vitest --run --project e2e",
|
|
82
80
|
"test:transit": "exit 0",
|
|
83
|
-
"typecheck": "
|
|
84
|
-
"
|
|
81
|
+
"typecheck:transit": "exit 0",
|
|
82
|
+
"compile": "tsc",
|
|
83
|
+
"test:watch": "vitest --watch --project unit",
|
|
84
|
+
"typecheck": "tsc --noEmit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|