From 8c0cc1f8c571982fb2e4209592908a46805f63b4 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 1 Oct 2026 21:33:50 +0000 Subject: [PATCH 1/2] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.787.0 --- .speakeasy/gen.lock | 55 ++++++++++++++++--------- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 20 ++++++--- .speakeasy/workflow.lock | 10 ++--- RELEASES.md | 12 +++++- docs/sdks/apikeys/README.mdx | 78 +++++++++++++++++++++++++++++------- jsr.json | 2 +- package.json | 10 ++--- src/funcs/apiKeysUpdate.ts | 4 ++ src/lib/config.ts | 4 +- src/sdk/apikeys.ts | 4 ++ 11 files changed, 147 insertions(+), 54 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 82cb7297e..60830cca2 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: "" id: "" management: - docChecksum: a9575ea2449f9486f69e57b06702b72c + docChecksum: c4ddd907c6e8e688476fc791fddce30d docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.4.17 - configChecksum: 62f7a5c003602a55ae84c2ae8ae2080b + releaseVersion: 1.4.18 + configChecksum: a63a5c0344bab35c87ba20c6c5769aff repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: c6dfa0d2-bd22-409c-b0d7-0b7b8fe8c3b7 - pristine_commit_hash: 5d8ada8837c73d45a55f1e33c1b16f1956a7e72e - pristine_tree_hash: 4c2a0e93e78dd0e995a076610418ad01804a7459 + generation_id: 4bd9d864-a9cd-4706-a283-13c542b9c149 + pristine_commit_hash: 917f7ce2b7bf791698fa0077b23d68d682ef20bb + pristine_tree_hash: f84112239f39812abeda7d056c53c58c9e847ac0 features: typescript: acceptHeaders: 2.81.2 @@ -15072,8 +15072,8 @@ trackedFiles: pristine_git_object: d83e642dfeee46102ccc469da7a644cc99efab42 docs/sdks/apikeys/README.mdx: id: 27fcaae1c346 - last_write_checksum: sha1:a1cb4fab7f31bcf8597520dad9290d3ede3be19a - pristine_git_object: 5003dfe082082b968b6d20a2e0020d8c6bae06fb + last_write_checksum: sha1:428eb6435f85eaf5a685da33b169beb9485735f5 + pristine_git_object: 36cad6b72875be9c4ae1edadafea3c90cfecda62 docs/sdks/batch/README.mdx: id: e367aa4f4295 last_write_checksum: sha1:6a7b49a4ad9ba8dc1600a20d20417e8ee45d69c9 @@ -15315,12 +15315,12 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:759f3c4362503dcf57b212fc2eb61c2ae8f8f866 - pristine_git_object: 56bbb8f8d561d468f02cacb7f0d9d28a9a6710fe + last_write_checksum: sha1:45bedeb23c7fadf1252f091f81afb5799396900d + pristine_git_object: 4ea4c1e2e992f5ff6641c5c7ddeb02fa9be7d36b package.json: id: 7030d0b2f71b - last_write_checksum: sha1:f91d6cb3b662c030c4b69d9d328d5e54a8b55983 - pristine_git_object: 1a78e5411ecaaa48189dcd6c9feded121dd2dc12 + last_write_checksum: sha1:745d04123d32122b71f1810484cd2125892794d0 + pristine_git_object: 431df562b6aeacec2435ea37ba07908a5ebfd01d src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 @@ -15363,8 +15363,8 @@ trackedFiles: pristine_git_object: fc3c9f8316d86d3128be6f71e168b5cfd8e2f32b src/funcs/apiKeysUpdate.ts: id: 05700884934b - last_write_checksum: sha1:6724255025710798b8169f2db96ea2ac23392875 - pristine_git_object: b236ec536229e23a813c2c9683072417c3a9ea47 + last_write_checksum: sha1:d4286a929ca48618e2b3441ea2751fed4d59c432 + pristine_git_object: fca49cdeeaea702ca58d988351aebe7d5ec53075 src/funcs/batchCreateBatches.ts: id: 8796df347125 last_write_checksum: sha1:bbf2369387e8922cdf18a33b28840c40e2b79c4e @@ -15939,8 +15939,8 @@ trackedFiles: pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:37e1d400a9d539c897846bdf94ba9c318df3e4ab - pristine_git_object: 726859d0bccf85a38714199b227468517e3ca657 + last_write_checksum: sha1:0fe125981ae33a67aeb5c6e142c0e2e31d754a2e + pristine_git_object: 42199d9d95e8a44cef1b4ff5f822e244e102c9c1 src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -20089,8 +20089,8 @@ trackedFiles: pristine_git_object: 8a7efa79ead429ae16fd167d1969491766e11751 src/sdk/apikeys.ts: id: 5dda931501e1 - last_write_checksum: sha1:5703cc8f8b2aa6c33d491e2319eae43753bf5ba1 - pristine_git_object: afff539f0e658b5ecf98eef83184aaae83def189 + last_write_checksum: sha1:7e44ec7cd3247c94658a3be3063e53bf3d3137fc + pristine_git_object: 99315a8ad4fc70adead9752c56b4e582f29a8a80 src/sdk/batch.ts: id: 254a218f7d6b last_write_checksum: sha1:060fefc69e19501be3cabe381e44091a14f36c12 @@ -20626,6 +20626,24 @@ examples: application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + invalid_parameters: + parameters: + path: + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943" + requestBody: + application/json: {} + responses: + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + no_update_fields: + parameters: + path: + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943" + requestBody: + application/json: {} + responses: + "400": + application/json: {"error": {"code": 400, "message": "No update fields provided"}} deleteKeys: speakeasy-default-delete-keys: parameters: @@ -24224,4 +24242,3 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Typescript SDK Changes:\n* `openrouter.images.generate()`: \n * `request.imageGenerationRequest.resolution.enum(1.5K)` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 76c851c6a..bd7d5ad46 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.4.17 + version: 1.4.18 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 063f03acf..557195b9e 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -43978,7 +43978,7 @@ paths: - 'API Keys' x-speakeasy-name-override: 'get' patch: - description: 'Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys).' + description: "Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys).\n\n\nYou can't change `workspace_id` through the API. The request body accepts only the fields listed below, and unrecognized fields are ignored. To move a key to another workspace, use the OpenRouter dashboard. If the body contains none of the accepted fields, the request fails with `400` and the message `No update fields provided`.\n" operationId: 'updateKeys' parameters: - description: 'The hash identifier of the API key to update' @@ -44261,10 +44261,20 @@ paths: '400': content: application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' + examples: + invalid_parameters: + summary: 'Invalid request parameters' + value: + error: + code: 400 + message: 'Invalid request parameters' + no_update_fields: + description: 'Returned when the body contains none of the accepted fields, for example `{"workspace_id": "..."}`. `workspace_id` can''t be changed through the API.' + summary: 'No accepted fields in the request body' + value: + error: + code: 400 + message: 'No update fields provided' schema: $ref: '#/components/schemas/BadRequestResponse' description: 'Bad Request - Invalid request parameters or malformed input' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index cc7730bed..765098cdd 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:ef161a0447b36c13ffbbabef706e7a7bd95f212226b012cf8e36ed98f31f61c4 - sourceBlobDigest: sha256:385590cede8164b419d3e461a38492edb251d18d6ba8de47ea1f050c85ba82bb + sourceRevisionDigest: sha256:b0f99062e8f93eb36c1f1a4e61d013095cac91fb66daca78fb5afec72dc87a3e + sourceBlobDigest: sha256:784594107f2a405803db5e58a5ad2f796adcb4b06a9555f7ecc9f8a5596493ab tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:ef161a0447b36c13ffbbabef706e7a7bd95f212226b012cf8e36ed98f31f61c4 - sourceBlobDigest: sha256:385590cede8164b419d3e461a38492edb251d18d6ba8de47ea1f050c85ba82bb + sourceRevisionDigest: sha256:b0f99062e8f93eb36c1f1a4e61d013095cac91fb66daca78fb5afec72dc87a3e + sourceBlobDigest: sha256:784594107f2a405803db5e58a5ad2f796adcb4b06a9555f7ecc9f8a5596493ab codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:f9469faf524f85636945af73958ae3bb9f01cf8761f171c76f65c05497338b48 + codeSamplesRevisionDigest: sha256:86d43acc8b45584293c7de634ae4b028a2709d50f5ca215edde1a6e16cf5ae7d workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 43ddf6273..90e2239fc 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4306,4 +4306,14 @@ Based on: ### Generated - [typescript v1.4.17] . ### Releases -- [NPM v1.4.17] https://www.npmjs.com/package/@openrouter/sdk/v/1.4.17 - . \ No newline at end of file +- [NPM v1.4.17] https://www.npmjs.com/package/@openrouter/sdk/v/1.4.17 - . + +## 2026-10-01 21:31:52 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.4.18] . +### Releases +- [NPM v1.4.18] https://www.npmjs.com/package/@openrouter/sdk/v/1.4.18 - . \ No newline at end of file diff --git a/docs/sdks/apikeys/README.mdx b/docs/sdks/apikeys/README.mdx index 5003dfe08..36cad6b72 100644 --- a/docs/sdks/apikeys/README.mdx +++ b/docs/sdks/apikeys/README.mdx @@ -433,7 +433,11 @@ run(); Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys). -### Example Usage +\ +You can't change `workspace_id` through the API. The request body accepts only the fields listed below, and unrecognized fields are ignored. To move a key to another workspace, use the OpenRouter dashboard. If the body contains none of the accepted fields, the request fails with `400` and the message `No update fields provided`. + + +### Example Usage: invalid_parameters ```typescript import { OpenRouter } from "@openrouter/sdk"; @@ -448,13 +452,7 @@ const openRouter = new OpenRouter({ async function run() { const result = await openRouter.apiKeys.update({ hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", - requestBody: { - disabled: false, - includeByokInLimit: true, - limit: 75, - limitReset: "daily", - name: "Updated API Key Name", - }, + requestBody: {}, }); console.log(result); @@ -483,13 +481,63 @@ const openRouter = new OpenRouterCore({ async function run() { const res = await apiKeysUpdate(openRouter, { hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", - requestBody: { - disabled: false, - includeByokInLimit: true, - limit: 75, - limitReset: "daily", - name: "Updated API Key Name", - }, + requestBody: {}, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("apiKeysUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: no_update_fields + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.apiKeys.update({ + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", + requestBody: {}, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { apiKeysUpdate } from "@openrouter/sdk/funcs/apiKeysUpdate.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + httpReferer: "", + appTitle: "", + appCategories: "", + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await apiKeysUpdate(openRouter, { + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", + requestBody: {}, }); if (res.ok) { const { value: result } = res; diff --git a/jsr.json b/jsr.json index 56bbb8f8d..4ea4c1e2e 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.4.17", + "version": "1.4.18", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 1a78e5411..431df562b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.4.17", + "version": "1.4.18", "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": [ @@ -73,15 +73,15 @@ "lint": "eslint --cache --max-warnings=0 src", "build": "tsc && node scripts/unbarrel-imports.js", "prepublishOnly": "npm run build", - "test:transit": "exit 0", + "typecheck": "tsc --noEmit", + "compile": "tsc && node scripts/unbarrel-imports.js", "test:watch": "vitest --watch --project unit", "typecheck:transit": "exit 0", "postinstall": "node scripts/check-types.js || true", "prepare": "npm run build", + "test": "vitest --run --project unit", "test:e2e": "vitest --run --project e2e", - "typecheck": "tsc --noEmit", - "compile": "tsc && node scripts/unbarrel-imports.js", - "test": "vitest --run --project unit" + "test:transit": "exit 0" }, "peerDependencies": { diff --git a/src/funcs/apiKeysUpdate.ts b/src/funcs/apiKeysUpdate.ts index b236ec536..fca49cdee 100644 --- a/src/funcs/apiKeysUpdate.ts +++ b/src/funcs/apiKeysUpdate.ts @@ -32,6 +32,10 @@ import { Result } from "../types/fp.js"; * * @remarks * Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys). + * + * + * You can't change `workspace_id` through the API. The request body accepts only the fields listed below, and unrecognized fields are ignored. To move a key to another workspace, use the OpenRouter dashboard. If the body contains none of the accepted fields, the request fails with `400` and the message `No update fields provided`. + * */ export function apiKeysUpdate( client: OpenRouterCore, diff --git a/src/lib/config.ts b/src/lib/config.ts index e3def1154..60beff580 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.4.17", + sdkVersion: "1.4.18", genVersion: "2.914.0", - userAgent: "speakeasy-sdk/typescript 1.4.17 2.914.0 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.4.18 2.914.0 1.0.0 @openrouter/sdk", } as const; diff --git a/src/sdk/apikeys.ts b/src/sdk/apikeys.ts index afff539f0..99315a8ad 100644 --- a/src/sdk/apikeys.ts +++ b/src/sdk/apikeys.ts @@ -104,6 +104,10 @@ export class APIKeys extends ClientSDK { * * @remarks * Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys). + * + * + * You can't change `workspace_id` through the API. The request body accepts only the fields listed below, and unrecognized fields are ignored. To move a key to another workspace, use the OpenRouter dashboard. If the body contains none of the accepted fields, the request fails with `400` and the message `No update fields provided`. + * */ async update( request: operations.UpdateKeysRequest, From 621ec139defce68c1874efc0206d41d93c62573a Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Thu, 1 Oct 2026 21:33:57 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow