@openrouter/sdk 1.5.26 → 1.5.27

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.
@@ -31,6 +31,7 @@ async function $do(client, security, request, options) {
31
31
  const body = null;
32
32
  const path = pathToFunc("/models/user")();
33
33
  const query = encodeFormQuery({
34
+ "client": payload?.client,
34
35
  "limit": payload?.limit,
35
36
  "offset": payload?.offset,
36
37
  "output_modalities": payload?.output_modalities,
@@ -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.5.26";
53
+ readonly sdkVersion: "1.5.27";
54
54
  readonly genVersion: "2.950.13";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.26 2.950.13 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.27 2.950.13 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.5.26",
32
+ sdkVersion: "1.5.27",
33
33
  genVersion: "2.950.13",
34
- userAgent: "speakeasy-sdk/typescript 1.5.26 2.950.13 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.5.27 2.950.13 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -48,6 +48,18 @@ export declare const ListModelsUserSort: {
48
48
  * Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
49
49
  */
50
50
  export type ListModelsUserSort = OpenEnum<typeof ListModelsUserSort>;
51
+ /**
52
+ * Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.
53
+ */
54
+ export declare const Client: {
55
+ readonly ClaudeCode: "claude_code";
56
+ readonly ClaudeDesktop: "claude_desktop";
57
+ readonly Codex: "codex";
58
+ };
59
+ /**
60
+ * Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.
61
+ */
62
+ export type Client = OpenEnum<typeof Client>;
51
63
  export type ListModelsUserRequest = {
52
64
  /**
53
65
  * The app identifier should be your app's URL and is used as the primary identifier for rankings.
@@ -84,6 +96,10 @@ export type ListModelsUserRequest = {
84
96
  * Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
85
97
  */
86
98
  sort?: ListModelsUserSort | undefined;
99
+ /**
100
+ * Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.
101
+ */
102
+ client?: Client | undefined;
87
103
  };
88
104
  export type ListModelsUserResponse = {
89
105
  result: models.ModelsListResponse;
@@ -98,6 +114,8 @@ export declare function listModelsUserSecurityToJSON(listModelsUserSecurity: Lis
98
114
  /** @internal */
99
115
  export declare const ListModelsUserSort$outboundSchema: z.ZodType<string, ListModelsUserSort>;
100
116
  /** @internal */
117
+ export declare const Client$outboundSchema: z.ZodType<string, Client>;
118
+ /** @internal */
101
119
  export type ListModelsUserRequest$Outbound = {
102
120
  "HTTP-Referer"?: string | undefined;
103
121
  appTitle?: string | undefined;
@@ -106,6 +124,7 @@ export type ListModelsUserRequest$Outbound = {
106
124
  limit: number;
107
125
  output_modalities?: string | undefined;
108
126
  sort?: string | undefined;
127
+ client?: string | undefined;
109
128
  };
110
129
  /** @internal */
111
130
  export declare const ListModelsUserRequest$outboundSchema: z.ZodType<ListModelsUserRequest$Outbound, ListModelsUserRequest>;
@@ -24,6 +24,14 @@ export const ListModelsUserSort = {
24
24
  AgenticHighToLow: "agentic-high-to-low",
25
25
  DesignArenaEloHighToLow: "design-arena-elo-high-to-low",
26
26
  };
27
+ /**
28
+ * Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.
29
+ */
30
+ export const Client = {
31
+ ClaudeCode: "claude_code",
32
+ ClaudeDesktop: "claude_desktop",
33
+ Codex: "codex",
34
+ };
27
35
  /** @internal */
28
36
  export const ListModelsUserSecurity$outboundSchema = z.object({
29
37
  bearer: z.string(),
@@ -34,6 +42,9 @@ export function listModelsUserSecurityToJSON(listModelsUserSecurity) {
34
42
  /** @internal */
35
43
  export const ListModelsUserSort$outboundSchema = openEnums.outboundSchema(ListModelsUserSort);
36
44
  /** @internal */
45
+ export const Client$outboundSchema = openEnums
46
+ .outboundSchema(Client);
47
+ /** @internal */
37
48
  export const ListModelsUserRequest$outboundSchema = z.object({
38
49
  httpReferer: z.string().optional(),
39
50
  appTitle: z.string().optional(),
@@ -42,6 +53,7 @@ export const ListModelsUserRequest$outboundSchema = z.object({
42
53
  limit: z.int().default(500),
43
54
  outputModalities: z.string().optional(),
44
55
  sort: ListModelsUserSort$outboundSchema.optional(),
56
+ client: Client$outboundSchema.optional(),
45
57
  }).transform((v) => {
46
58
  return remap$(v, {
47
59
  httpReferer: "HTTP-Referer",
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.26",
5
+ "version": "1.5.27",
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.26",
3
+ "version": "1.5.27",
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
- "provenance": true,
25
- "access": "public"
24
+ "access": "public",
25
+ "provenance": true
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 && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
- "prepare": "npm run build",
77
- "test": "vitest --run --project unit",
76
+ "test:e2e": "vitest --run --project e2e",
78
77
  "typecheck": "tsc --noEmit",
79
78
  "typecheck:transit": "exit 0",
80
79
  "compile": "tsc && node scripts/unbarrel-imports.js",
81
80
  "postinstall": "node scripts/check-types.js || true",
82
- "test:e2e": "vitest --run --project e2e",
81
+ "prepare": "npm run build",
83
82
  "test:transit": "exit 0",
84
- "test:watch": "vitest --watch --project unit"
83
+ "test:watch": "vitest --watch --project unit",
84
+ "test": "vitest --run --project unit"
85
85
  },
86
86
  "peerDependencies": {
87
87