@openrouter/sdk 1.2.27 → 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.
@@ -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 `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing).
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 `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing).
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));
@@ -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.27";
52
+ readonly sdkVersion: "1.2.28";
53
53
  readonly genVersion: "2.914.0";
54
- readonly userAgent: "speakeasy-sdk/typescript 1.2.27 2.914.0 1.0.0 @openrouter/sdk";
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.27",
29
+ sdkVersion: "1.2.28",
30
30
  genVersion: "2.914.0",
31
- userAgent: "speakeasy-sdk/typescript 1.2.27 2.914.0 1.0.0 @openrouter/sdk",
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";
@@ -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. Currently only "eu" is supported.
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. Currently only "eu" is supported.
98
+ * Filter to models with endpoints in the given data region ("eu" or "us").
98
99
  */
99
- export type Region = ClosedEnum<typeof 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. Currently only "eu" is supported.
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.ZodEnum<typeof Region>;
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. Currently only "eu" is supported.
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 = z.enum(Region);
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(),
@@ -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 `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing).
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 `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing).
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.27",
5
+ "version": "1.2.28",
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.2.27",
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
- "access": "public",
25
- "provenance": true
24
+ "provenance": true,
25
+ "access": "public"
26
26
  },
27
27
  "type": "module",
28
28
  "main": "./esm/index.js",
@@ -77,11 +77,11 @@
77
77
  "prepare": "npm run build",
78
78
  "test": "vitest --run --project unit",
79
79
  "test:e2e": "vitest --run --project e2e",
80
- "test:watch": "vitest --watch --project unit",
81
- "typecheck": "tsc --noEmit",
82
- "compile": "tsc",
83
80
  "test:transit": "exit 0",
84
- "typecheck:transit": "exit 0"
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": {