From cce9d10783f8b549d1f40dc17a2ed1fc39c635fd Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 30 Oct 2026 03:52:43 +0000 Subject: [PATCH 1/2] ## Typescript SDK Changes: * `openrouter.models.listForUser()`: * `request.client` **Added** --- .speakeasy/gen.lock | 41 +++++++++++-------- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 13 ++++++ .speakeasy/workflow.lock | 10 ++--- RELEASES.md | 12 +++++- docs/models/operations/client.mdx | 21 ++++++++++ .../operations/listmodelsuserrequest.mdx | 3 +- jsr.json | 2 +- package.json | 14 +++---- src/funcs/modelsListForUser.ts | 1 + src/lib/config.ts | 4 +- src/models/operations/listmodelsuser.ts | 23 +++++++++++ 12 files changed, 110 insertions(+), 36 deletions(-) create mode 100644 docs/models/operations/client.mdx diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 1677a8b6d..3826d05cf 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: "" id: "" management: - docChecksum: c9db3c2186610835df2d92e590a151d6 + docChecksum: bc16bd026c616fcef4340cb1ef091220 docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.5.26 - configChecksum: b273ba619fe197f8ec697ba146fee9d8 + releaseVersion: 1.5.27 + configChecksum: 78c0bf261275cb5d160a5a0495cea528 repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: e484905e-15fb-40f6-9193-4fe7a49c9b48 - pristine_commit_hash: 4eafc761560f6a8e594962cc35b987db7e665cd6 - pristine_tree_hash: 1cd41855ea62442e44a6ae4a692a8ba9fa11bcd7 + generation_id: fcbbabb8-7fd3-4dba-91c7-41f7962ad7a4 + pristine_commit_hash: c5dc24b3a20a3add332ff48b5685438b9b7eece6 + pristine_tree_hash: be1f92e22a07a0ad85f5ca99b51b7b90457c6351 features: typescript: acceptHeaders: 2.81.2 @@ -8667,6 +8667,10 @@ trackedFiles: id: 7dcacabae6f4 last_write_checksum: sha1:c4316e4b7d46e7353ae697ae034236836c35c54d pristine_git_object: 7fc6369e8469929e148866d465497b798ddbcc31 + docs/models/operations/client.mdx: + id: fbc92d03f310 + last_write_checksum: sha1:98751414f97f1553d7a973ee9799837b928182a6 + pristine_git_object: 888acee4fde89c27c5c7e099a34e7768964cec42 docs/models/operations/content.mdx: id: 3885c021e578 last_write_checksum: sha1:ea2b60b475e1009a53fadc6944658de69e81a298 @@ -10347,8 +10351,8 @@ trackedFiles: pristine_git_object: bb86b366108309b366780447688bd1f416b7f925 docs/models/operations/listmodelsuserrequest.mdx: id: 05ad0997f444 - last_write_checksum: sha1:e54519a903140b629f7131df6960f800605a8d39 - pristine_git_object: 3ffd6aeba2ba40e4e8d1e64f396de9181e5492ee + last_write_checksum: sha1:560a704d20e0395cde9dd6c0b245ab84b2c63bc1 + pristine_git_object: b48683d988d3537d4c7993ed24c7b9e8b5f344ed docs/models/operations/listmodelsuserresponse.mdx: id: d3822e9ceb84 last_write_checksum: sha1:515714c18fff8dfdb13ff2ae495e8bdd8d4d9eb6 @@ -15999,12 +16003,12 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:f9af7cb29f08a19714b5390e1a4d71a71eff098e - pristine_git_object: cd241a07dfdfb91c7837e77654c273d431c98053 + last_write_checksum: sha1:dc777d62818dc5d7f8741ec5f864857b4f178900 + pristine_git_object: 1ec1a4f73ad49d93a2d454144e5776fd6999cd7a package.json: id: 7030d0b2f71b - last_write_checksum: sha1:af258dd3aa28f84dcd59bff63fb5e1b4048f2513 - pristine_git_object: 25cf14e6b99e45fb34888bf9cf2e890bff49a2bf + last_write_checksum: sha1:07893642068670874266ffb7e529bf8fe8a22fc6 + pristine_git_object: 16a00480c236fa375ff8104cc1f3d60f2b32fac0 src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 @@ -16279,8 +16283,8 @@ trackedFiles: pristine_git_object: dba1a4bbdb688b8adb10c27c04a6ce27de3e053f src/funcs/modelsListForUser.ts: id: db628dd3c179 - last_write_checksum: sha1:fa7f9fdb6fe2045aecf6a5a842a79d933da652cb - pristine_git_object: 80014e4c710b31e0726f34aed3f460ecdba6c55f + last_write_checksum: sha1:f34ee52f16d16de5d2015acbe7cb7708cef5ec7b + pristine_git_object: 74d0a4e2ec85c972f4b09b6ee73b2db12eac2840 src/funcs/oAuthCreateAuthCode.ts: id: 8a79f27722c0 last_write_checksum: sha1:6c0a0fb185e40ee20a6178c74281bdeef3291350 @@ -16611,8 +16615,8 @@ trackedFiles: pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:e4ed2e29eb59a392f3be0a5fc1aaba432a01cf0d - pristine_git_object: 6b73df57e2c3c7b8f62c53e1a217c1d263462a6f + last_write_checksum: sha1:76761a9ac0067539bf300e18e97b600e7d2252db + pristine_git_object: e2d1ce99ea6ca2723e0771d640f88d4a087d3c55 src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -19477,8 +19481,8 @@ trackedFiles: pristine_git_object: 3fe643e63d015a44c385ba4c14fc98397e4fb730 src/models/operations/listmodelsuser.ts: id: 0846aac6be02 - last_write_checksum: sha1:d108b1747a9afe0e678d81ad3c2330a3eeec828a - pristine_git_object: c57795d4484466094d0b5a982020b63bb1b0e35d + last_write_checksum: sha1:7d1a98d83d8b9447b3edabc1b0365a1a0769d30b + pristine_git_object: 50470a8a0d9514469c366df08d063ebd39d88210 src/models/operations/listoauthjwks.ts: id: 63db6f2762a2 last_write_checksum: sha1:215a7d15237e1ce2f9e0c6235b602e1c0a97d794 @@ -25672,3 +25676,4 @@ examples: "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} examplesVersion: 1.0.2 +releaseNotes: "## Typescript SDK Changes:\n* `openrouter.models.listForUser()`: \n * `request.client` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 79b6ee6c4..b720a4b25 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -38,7 +38,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.5.26 + version: 1.5.27 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 271aa8081..d536972e3 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -47131,6 +47131,19 @@ paths: example: 'newest' type: 'string' x-speakeasy-unknown-values: allow + - description: '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.' + in: 'query' + name: 'client' + required: false + schema: + description: '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.' + enum: + - 'claude_code' + - 'claude_desktop' + - 'codex' + example: 'codex' + type: 'string' + x-speakeasy-unknown-values: allow responses: '200': content: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index f85865083..0a5a5b741 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:d739a1e60cc5eaec19815748684061dca95e21b2f1e4df00ec59face0b1ca8e7 - sourceBlobDigest: sha256:91644ef2bdc680301aaa853d67234b72368b591c080d8fced35d5cab1bca7d8a + sourceRevisionDigest: sha256:cfe17794f14d83dd3d95f52f35860b434d55323544db9edae08c404feb7d190a + sourceBlobDigest: sha256:151c7144a8b6b7bc154f6eb266bfc50602ef610c5f94c0b4437859d4e78d2885 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:d739a1e60cc5eaec19815748684061dca95e21b2f1e4df00ec59face0b1ca8e7 - sourceBlobDigest: sha256:91644ef2bdc680301aaa853d67234b72368b591c080d8fced35d5cab1bca7d8a + sourceRevisionDigest: sha256:cfe17794f14d83dd3d95f52f35860b434d55323544db9edae08c404feb7d190a + sourceBlobDigest: sha256:151c7144a8b6b7bc154f6eb266bfc50602ef610c5f94c0b4437859d4e78d2885 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:4c2770274882dc8324476c548c6030a4c38f4c7daa1d7d09ff755d706c304039 + codeSamplesRevisionDigest: sha256:652c37fcdcb847e99776eabc7559f419456a0b2a617ca431ea00ec5d1231b2b4 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index a51646944..75ad85d48 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4646,4 +4646,14 @@ Based on: ### Generated - [typescript v1.5.26] . ### Releases -- [NPM v1.5.26] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.26 - . \ No newline at end of file +- [NPM v1.5.26] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.26 - . + +## 2026-10-30 03:49:14 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.5.27] . +### Releases +- [NPM v1.5.27] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.27 - . \ No newline at end of file diff --git a/docs/models/operations/client.mdx b/docs/models/operations/client.mdx new file mode 100644 index 000000000..888acee4f --- /dev/null +++ b/docs/models/operations/client.mdx @@ -0,0 +1,21 @@ +--- +title: "Client" +--- + +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. + +## Example Usage + +```typescript +import { Client } from "@openrouter/sdk/models/operations"; + +let value: Client = "codex"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"claude_code" | "claude_desktop" | "codex" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/listmodelsuserrequest.mdx b/docs/models/operations/listmodelsuserrequest.mdx index 3ffd6aeba..b48683d98 100644 --- a/docs/models/operations/listmodelsuserrequest.mdx +++ b/docs/models/operations/listmodelsuserrequest.mdx @@ -20,4 +20,5 @@ let value: ListModelsUserRequest = {}; | `offset` | *number* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | | `limit` | *number* | ➖ | Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned | 500 | | `outputModalities` | *string* | ➖ | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, decisions, speech, transcription) or "all" to include all models. Defaults to "text". | text | -| `sort` | [operations.ListModelsUserSort](../../models/operations/listmodelsusersort.mdx) | ➖ | 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. | newest | \ No newline at end of file +| `sort` | [operations.ListModelsUserSort](../../models/operations/listmodelsusersort.mdx) | ➖ | 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. | newest | +| `client` | [operations.Client](../../models/operations/client.mdx) | ➖ | 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. | codex | \ No newline at end of file diff --git a/jsr.json b/jsr.json index cd241a07d..1ec1a4f73 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.5.26", + "version": "1.5.27", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 25cf14e6b..16a00480c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.5.26", + "version": "1.5.27", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.", "keywords": [ @@ -21,8 +21,8 @@ "license": "Apache-2.0", "packageManager": "pnpm@10.22.0", "publishConfig": { - "provenance": true, - "access": "public" + "access": "public", + "provenance": true }, "type": "module", "main": "./esm/index.js", @@ -73,15 +73,15 @@ "lint": "eslint --cache --max-warnings=0 src", "build": "tsc && node scripts/unbarrel-imports.js", "prepublishOnly": "npm run build", - "prepare": "npm run build", - "test": "vitest --run --project unit", + "test:e2e": "vitest --run --project e2e", "typecheck": "tsc --noEmit", "typecheck:transit": "exit 0", "compile": "tsc && node scripts/unbarrel-imports.js", "postinstall": "node scripts/check-types.js || true", - "test:e2e": "vitest --run --project e2e", + "prepare": "npm run build", "test:transit": "exit 0", - "test:watch": "vitest --watch --project unit" + "test:watch": "vitest --watch --project unit", + "test": "vitest --run --project unit" }, "peerDependencies": { diff --git a/src/funcs/modelsListForUser.ts b/src/funcs/modelsListForUser.ts index 80014e4c7..74d0a4e2e 100644 --- a/src/funcs/modelsListForUser.ts +++ b/src/funcs/modelsListForUser.ts @@ -123,6 +123,7 @@ async function $do( const path = pathToFunc("/models/user")(); const query = encodeFormQuery({ + "client": payload?.client, "limit": payload?.limit, "offset": payload?.offset, "output_modalities": payload?.output_modalities, diff --git a/src/lib/config.ts b/src/lib/config.ts index db4b52454..39687ea29 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -79,7 +79,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "1.5.26", + sdkVersion: "1.5.27", genVersion: "2.950.13", - userAgent: "speakeasy-sdk/typescript 1.5.26 2.950.13 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.5.27 2.950.13 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/operations/listmodelsuser.ts b/src/models/operations/listmodelsuser.ts index c57795d44..50470a8a0 100644 --- a/src/models/operations/listmodelsuser.ts +++ b/src/models/operations/listmodelsuser.ts @@ -60,6 +60,19 @@ export const ListModelsUserSort = { */ export type ListModelsUserSort = OpenEnum; +/** + * 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. + */ +export const Client = { + ClaudeCode: "claude_code", + ClaudeDesktop: "claude_desktop", + Codex: "codex", +} as const; +/** + * 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. + */ +export type Client = OpenEnum; + export type ListModelsUserRequest = { /** * The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -96,6 +109,10 @@ export type ListModelsUserRequest = { * 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. */ sort?: ListModelsUserSort | undefined; + /** + * 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. + */ + client?: Client | undefined; }; export type ListModelsUserResponse = { @@ -129,6 +146,10 @@ export const ListModelsUserSort$outboundSchema: z.ZodType< ListModelsUserSort > = openEnums.outboundSchema(ListModelsUserSort); +/** @internal */ +export const Client$outboundSchema: z.ZodType = openEnums + .outboundSchema(Client); + /** @internal */ export type ListModelsUserRequest$Outbound = { "HTTP-Referer"?: string | undefined; @@ -138,6 +159,7 @@ export type ListModelsUserRequest$Outbound = { limit: number; output_modalities?: string | undefined; sort?: string | undefined; + client?: string | undefined; }; /** @internal */ @@ -152,6 +174,7 @@ export const ListModelsUserRequest$outboundSchema: z.ZodType< limit: z.int().default(500), outputModalities: z.string().optional(), sort: ListModelsUserSort$outboundSchema.optional(), + client: Client$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpReferer: "HTTP-Referer", From 6d71c81b4b8cf0978a6de9a4082bfdfe45467669 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 03:52:50 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow