diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 0320639d6..9df77461a 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: "" id: "" management: - docChecksum: 1da07a20ce1249a56e900563184936d0 + docChecksum: d148bb9fcca23371c04cee2b6ca57c55 docVersion: 1.0.0 speakeasyVersion: 1.808.1 generationVersion: 2.960.8 - releaseVersion: 1.5.163 - configChecksum: 12e444b386c6afc9e6d7e474cc4be3a5 + releaseVersion: 1.5.164 + configChecksum: 73b00667d489cbc2c112db8607d3bc93 repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true @@ -23925,4 +23925,3 @@ examples: "500": application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}} examplesVersion: 1.0.2 -releaseNotes: "## Typescript SDK Changes:\n* `openrouter.alpha.decisions.create()`: \n * `request.decisionsRequest.provider` **Changed**\n* `openrouter.alpha.extractions.create()`: \n * `request.extractionsRequest.provider` **Changed**\n* `openrouter.tts.createSpeech()`: \n * `request.speechRequest.provider` **Changed**\n* `openrouter.stt.createTranscription()`: \n * `request.sttRequest.provider` **Changed**\n* `openrouter.stt.listModels()`: `response.data[].endpoints[].inputModalities[].union(audio).supportedInputs.formats.values[]` **Changed**\n* `openrouter.stt.getModel()`: `response.endpoints[].inputModalities[].union(audio).supportedInputs.formats.values[]` **Changed**\n* `openrouter.batch.createBatches()`: \n * `request.batchSubmitBody.provider.only[].union(ProviderName).enum(celeris)` **Added**\n* `openrouter.byok.list()`: \n * `request.provider` **Changed**\n * `response.data[].provider.enum(celeris)` **Added**\n* `openrouter.byok.create()`: \n * `request.createByokKeyRequest.provider.enum(celeris)` **Added**\n * `response.data.provider.enum(celeris)` **Added**\n* `openrouter.byok.get()`: `response.data.provider.enum(celeris)` **Added**\n* `openrouter.byok.update()`: `response.data.provider.enum(celeris)` **Added**\n* `openrouter.chat.send()`: \n * `request.chatRequest.provider` **Changed**\n* `openrouter.embeddings.generate()`: \n * `request.requestBody.provider` **Changed**\n* `openrouter.embeddings.listModels()`: `response.data[].inputModalities[].union(audio).supportedInputs.formats.values[]` **Changed**\n* `openrouter.endpoints.listZdrEndpoints()`: `response.data[].providerName.enum(celeris)` **Added**\n* `openrouter.endpoints.list()`: `response.data.endpoints[].providerName.enum(celeris)` **Added**\n* `openrouter.generations.getGeneration()`: `response.data.providerResponses[].providerName.enum(celeris)` **Added**\n* `openrouter.images.generate()`: \n * `request.imageGenerationRequest.provider` **Changed**\n* `openrouter.images.listModels()`: `response.data[].inputModalities[].union(audio).supportedInputs.formats.values[]` **Changed**\n* `openrouter.images.listModelEndpoints()`: `response.endpoints[].inputModalities[].union(audio).supportedInputs.formats.values[]` **Changed**\n* `openrouter.presets.createPresetsChatCompletions()`: \n * `request.chatRequest.provider` **Changed**\n* `openrouter.presets.createPresetsMessages()`: \n * `request.messagesRequest.provider` **Changed**\n* `openrouter.presets.createPresetsResponses()`: \n * `request.responsesRequest.provider` **Changed**\n* `openrouter.rerank.rerank()`: \n * `request.requestBody.provider` **Changed**\n* `openrouter.rerank.listModels()`: `response.data[].inputModalities[].union(audio).supportedInputs.formats.values[]` **Changed**\n* `openrouter.responses.send()`: \n * `request.responsesRequest.provider` **Changed**\n* `openrouter.beta.responses.send()`: \n * `request.responsesRequest.provider` **Changed**\n* `openrouter.systemOne.create()`: \n * `request.decisionsRequest.provider` **Changed**\n* `openrouter.videoGeneration.generate()`: \n * `request.videoGenerationRequest.provider` **Changed**\n* `openrouter.videoGeneration.listVideosModels()`: `response.data[].inputModalities[].union(audio).supportedInputs.formats.values[]` **Changed**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 9457f8ab5..b59cbfcb5 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -38,7 +38,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.5.163 + version: 1.5.164 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 0a90d663f..d28b46bc2 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -44930,7 +44930,7 @@ paths: - $ref: "#/components/parameters/AppCategories" /batches/{id}/cancel: post: - description: 'Asks the provider to stop a batch that is still running. Cancellation is enabled per organization; other organizations get `403`. The response is the batch in its current status: it stays `in_progress` until the provider confirms, then becomes `cancelled`, or `completed`, `failed`, or `expired` when the provider job ended first. Poll until the batch has any final status. Repeating the call is safe while the batch is still `in_progress`; once it has a final status the call returns `409`. OpenRouter returns no result rows for a cancelled batch, and the provider still charges for the requests that finished before the cancellation. When the batch wrote its output to your own storage, retrieving the batch can still return that location, and the rows the provider wrote there stay yours to read. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' + description: 'Asks the provider to stop a batch that is still running. Cancellation is enabled per organization; other organizations get `403`. The response is the batch in its current status: it stays `in_progress` until the provider confirms, then becomes `cancelled`, or `completed`, `failed`, or `expired` when the provider job ended first. Poll until the batch has any final status. Repeating the call is safe while the batch is still `in_progress`; once it has a final status the call returns `409`. On OpenAI a cancelled batch keeps the requests that finished before the cancellation when OpenAI returns them: they are in `results` and billed like the rows of a completed batch. On every other provider OpenRouter returns no result rows for a cancelled batch, and the provider still charges for the requests that finished. When the batch wrote its output to your own storage, retrieving the batch can still return that location, and the rows the provider wrote there stay yours to read. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' operationId: 'cancelBatch' parameters: - description: 'The batch job id returned from submit.' @@ -57795,7 +57795,7 @@ paths: example: data: - email: 'jane.doe@example.com' - external_id: 'scim_usr_3J9P6a5UiLQcpRMGx4bdOVrKceF' + external_id: '00u1a2b3c4D5e6F7g8h9' first_name: 'Jane' id: 'user_2dHFtVWx2n56w6HkM0000000000' last_name: 'Doe' @@ -57812,8 +57812,8 @@ paths: example: 'jane.doe@example.com' type: 'string' external_id: - description: 'The member''s SCIM user ID, which your identity provider stores for their OpenRouter account (Okta shows it as External ID); not the SCIM `externalId` attribute. Set when your organization''s SCIM directory provisions, updates or syncs the member. Null when this organization''s directory did not provision the member (for example, they were invited, signed up directly, or provisioned by another organization''s directory) or has not synced them yet. Members can keep their last synced value after the directory is removed.' - example: 'scim_usr_3J9P6a5UiLQcpRMGx4bdOVrKceF' + description: 'The member''s user ID at your identity provider, recorded when they sign in through your organization''s SSO connection. Your identity provider must send the user ID attribute that connection reads (for Okta, `id` = `user.id`; for other identity providers, contact support). Set for members your organization''s SCIM directory provisioned, once OpenRouter syncs them after that sign-in. Null before then, or when this organization''s directory did not provision the member. Members can keep their last synced value after the directory is removed.' + example: '00u1a2b3c4D5e6F7g8h9' type: - 'string' - 'null' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 1df1502fa..00e945c98 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.808.1 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:d58eac0deb8ac4d42bf5d6dbb71be1898302cac456c186fc741567076eea6b62 - sourceBlobDigest: sha256:d465a667da4a498b035f073d79580c8d2a4a750097712f3e9739560186e1db5b + sourceRevisionDigest: sha256:c8352bc3ba6694f852186ee60cf7c8695ded97ec7c8f121a26b745009aadd4a9 + sourceBlobDigest: sha256:53f7cfd47d6bc2b0896b993c25ccecc6e23c1206666016fdfcfda004db8141b1 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:d58eac0deb8ac4d42bf5d6dbb71be1898302cac456c186fc741567076eea6b62 - sourceBlobDigest: sha256:d465a667da4a498b035f073d79580c8d2a4a750097712f3e9739560186e1db5b + sourceRevisionDigest: sha256:c8352bc3ba6694f852186ee60cf7c8695ded97ec7c8f121a26b745009aadd4a9 + sourceBlobDigest: sha256:53f7cfd47d6bc2b0896b993c25ccecc6e23c1206666016fdfcfda004db8141b1 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:b29b59555cf4c32422a791f152a1eb1673352d4dd77f925c0e463ea839ac43e1 + codeSamplesRevisionDigest: sha256:b0d04ba4b0b8394c31c92979a94b4520cc5a7f547fc758fb194d78f716d6c401 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.808.1 diff --git a/RELEASES.md b/RELEASES.md index 113f9ba3d..49059afc1 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -6006,4 +6006,14 @@ Based on: ### Generated - [typescript v1.5.163] . ### Releases -- [NPM v1.5.163] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.163 - . \ No newline at end of file +- [NPM v1.5.163] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.163 - . + +## 2026-12-02 21:22:43 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.808.1 (2.960.8) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.5.164] . +### Releases +- [NPM v1.5.164] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.164 - . \ No newline at end of file diff --git a/docs/models/operations/listorganizationmembersdata.mdx b/docs/models/operations/listorganizationmembersdata.mdx index ca84edf5f..6edcf71f7 100644 --- a/docs/models/operations/listorganizationmembersdata.mdx +++ b/docs/models/operations/listorganizationmembersdata.mdx @@ -9,7 +9,7 @@ import { ListOrganizationMembersData } from "@openrouter/sdk/models/operations"; let value: ListOrganizationMembersData = { email: "jane.doe@example.com", - externalId: "scim_usr_3J9P6a5UiLQcpRMGx4bdOVrKceF", + externalId: "00u1a2b3c4D5e6F7g8h9", firstName: "Jane", id: "user_2dHFtVWx2n56w6HkM0000000000", lastName: "Doe", @@ -19,11 +19,11 @@ let value: ListOrganizationMembersData = { ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `email` | *string* | ✔️ | Email address of the member | jane.doe@example.com | -| `externalId` | *string* | ✔️ | The member's SCIM user ID, which your identity provider stores for their OpenRouter account (Okta shows it as External ID); not the SCIM `externalId` attribute. Set when your organization's SCIM directory provisions, updates or syncs the member. Null when this organization's directory did not provision the member (for example, they were invited, signed up directly, or provisioned by another organization's directory) or has not synced them yet. Members can keep their last synced value after the directory is removed. | scim_usr_3J9P6a5UiLQcpRMGx4bdOVrKceF | -| `firstName` | *string* | ✔️ | First name of the member | Jane | -| `id` | *string* | ✔️ | User ID of the organization member | user_2dHFtVWx2n56w6HkM0000000000 | -| `lastName` | *string* | ✔️ | Last name of the member | Doe | -| `role` | [operations.Role](../../models/operations/role.mdx) | ✔️ | Role of the member in the organization. `org:viewer` is coming soon and not yet available. Once launched, it has read-only organization access: it can view organization settings, billing and workspaces but not change them. Workspace roles can still grant write access in specific workspaces. | org:member | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `email` | *string* | ✔️ | Email address of the member | jane.doe@example.com | +| `externalId` | *string* | ✔️ | The member's user ID at your identity provider, recorded when they sign in through your organization's SSO connection. Your identity provider must send the user ID attribute that connection reads (for Okta, `id` = `user.id`; for other identity providers, contact support). Set for members your organization's SCIM directory provisioned, once OpenRouter syncs them after that sign-in. Null before then, or when this organization's directory did not provision the member. Members can keep their last synced value after the directory is removed. | 00u1a2b3c4D5e6F7g8h9 | +| `firstName` | *string* | ✔️ | First name of the member | Jane | +| `id` | *string* | ✔️ | User ID of the organization member | user_2dHFtVWx2n56w6HkM0000000000 | +| `lastName` | *string* | ✔️ | Last name of the member | Doe | +| `role` | [operations.Role](../../models/operations/role.mdx) | ✔️ | Role of the member in the organization. `org:viewer` is coming soon and not yet available. Once launched, it has read-only organization access: it can view organization settings, billing and workspaces but not change them. Workspace roles can still grant write access in specific workspaces. | org:member | \ No newline at end of file diff --git a/docs/sdks/batch/README.mdx b/docs/sdks/batch/README.mdx index c33de7d40..dbf21023e 100644 --- a/docs/sdks/batch/README.mdx +++ b/docs/sdks/batch/README.mdx @@ -525,7 +525,7 @@ run(); ## cancel -Asks the provider to stop a batch that is still running. Cancellation is enabled per organization; other organizations get `403`. The response is the batch in its current status: it stays `in_progress` until the provider confirms, then becomes `cancelled`, or `completed`, `failed`, or `expired` when the provider job ended first. Poll until the batch has any final status. Repeating the call is safe while the batch is still `in_progress`; once it has a final status the call returns `409`. OpenRouter returns no result rows for a cancelled batch, and the provider still charges for the requests that finished before the cancellation. When the batch wrote its output to your own storage, retrieving the batch can still return that location, and the rows the provider wrote there stay yours to read. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). +Asks the provider to stop a batch that is still running. Cancellation is enabled per organization; other organizations get `403`. The response is the batch in its current status: it stays `in_progress` until the provider confirms, then becomes `cancelled`, or `completed`, `failed`, or `expired` when the provider job ended first. Poll until the batch has any final status. Repeating the call is safe while the batch is still `in_progress`; once it has a final status the call returns `409`. On OpenAI a cancelled batch keeps the requests that finished before the cancellation when OpenAI returns them: they are in `results` and billed like the rows of a completed batch. On every other provider OpenRouter returns no result rows for a cancelled batch, and the provider still charges for the requests that finished. When the batch wrote its output to your own storage, retrieving the batch can still return that location, and the rows the provider wrote there stay yours to read. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). ### Example Usage diff --git a/jsr.json b/jsr.json index c792ce1dc..44fe70638 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.5.163", + "version": "1.5.164", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 821873af2..1e4159598 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.5.163", + "version": "1.5.164", "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,14 +73,14 @@ "lint": "eslint --cache --max-warnings=0 src", "build": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js", "prepublishOnly": "npm run build", - "test:e2e": "vitest --run --project e2e", - "typecheck": "tsc --noEmit", "compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js", "postinstall": "node scripts/check-types.js || true", - "prepare": "npm run build", "test": "vitest --run --project unit", + "test:e2e": "vitest --run --project e2e", "test:transit": "exit 0", "test:watch": "vitest --watch --project unit", + "typecheck": "tsc --noEmit", + "prepare": "npm run build", "typecheck:transit": "exit 0" }, "peerDependencies": { diff --git a/src/funcs/batchCancel.ts b/src/funcs/batchCancel.ts index 8c6b88d4a..57c7a6482 100644 --- a/src/funcs/batchCancel.ts +++ b/src/funcs/batchCancel.ts @@ -31,7 +31,7 @@ import { Result } from "../types/fp.js"; * Cancel a batch * * @remarks - * Asks the provider to stop a batch that is still running. Cancellation is enabled per organization; other organizations get `403`. The response is the batch in its current status: it stays `in_progress` until the provider confirms, then becomes `cancelled`, or `completed`, `failed`, or `expired` when the provider job ended first. Poll until the batch has any final status. Repeating the call is safe while the batch is still `in_progress`; once it has a final status the call returns `409`. OpenRouter returns no result rows for a cancelled batch, and the provider still charges for the requests that finished before the cancellation. When the batch wrote its output to your own storage, retrieving the batch can still return that location, and the rows the provider wrote there stay yours to read. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + * Asks the provider to stop a batch that is still running. Cancellation is enabled per organization; other organizations get `403`. The response is the batch in its current status: it stays `in_progress` until the provider confirms, then becomes `cancelled`, or `completed`, `failed`, or `expired` when the provider job ended first. Poll until the batch has any final status. Repeating the call is safe while the batch is still `in_progress`; once it has a final status the call returns `409`. On OpenAI a cancelled batch keeps the requests that finished before the cancellation when OpenAI returns them: they are in `results` and billed like the rows of a completed batch. On every other provider OpenRouter returns no result rows for a cancelled batch, and the provider still charges for the requests that finished. When the batch wrote its output to your own storage, retrieving the batch can still return that location, and the rows the provider wrote there stay yours to read. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). */ export function batchCancel( client: OpenRouterCore, diff --git a/src/lib/config.ts b/src/lib/config.ts index eb0004916..3d95a3db5 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -74,7 +74,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "1.5.163", + sdkVersion: "1.5.164", genVersion: "2.960.8", - userAgent: "speakeasy-sdk/typescript 1.5.163 2.960.8 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.5.164 2.960.8 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/operations/listorganizationmembers.ts b/src/models/operations/listorganizationmembers.ts index 1e4bfd890..c90e952a8 100644 --- a/src/models/operations/listorganizationmembers.ts +++ b/src/models/operations/listorganizationmembers.ts @@ -81,7 +81,7 @@ export type ListOrganizationMembersData = { */ email: string; /** - * The member's SCIM user ID, which your identity provider stores for their OpenRouter account (Okta shows it as External ID); not the SCIM `externalId` attribute. Set when your organization's SCIM directory provisions, updates or syncs the member. Null when this organization's directory did not provision the member (for example, they were invited, signed up directly, or provisioned by another organization's directory) or has not synced them yet. Members can keep their last synced value after the directory is removed. + * The member's user ID at your identity provider, recorded when they sign in through your organization's SSO connection. Your identity provider must send the user ID attribute that connection reads (for Okta, `id` = `user.id`; for other identity providers, contact support). Set for members your organization's SCIM directory provisioned, once OpenRouter syncs them after that sign-in. Null before then, or when this organization's directory did not provision the member. Members can keep their last synced value after the directory is removed. */ externalId: string | null; /** diff --git a/src/sdk/batch.ts b/src/sdk/batch.ts index f37e91c08..2c40ef594 100644 --- a/src/sdk/batch.ts +++ b/src/sdk/batch.ts @@ -87,7 +87,7 @@ export class Batch extends ClientSDK { * Cancel a batch * * @remarks - * Asks the provider to stop a batch that is still running. Cancellation is enabled per organization; other organizations get `403`. The response is the batch in its current status: it stays `in_progress` until the provider confirms, then becomes `cancelled`, or `completed`, `failed`, or `expired` when the provider job ended first. Poll until the batch has any final status. Repeating the call is safe while the batch is still `in_progress`; once it has a final status the call returns `409`. OpenRouter returns no result rows for a cancelled batch, and the provider still charges for the requests that finished before the cancellation. When the batch wrote its output to your own storage, retrieving the batch can still return that location, and the rows the provider wrote there stay yours to read. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). + * Asks the provider to stop a batch that is still running. Cancellation is enabled per organization; other organizations get `403`. The response is the batch in its current status: it stays `in_progress` until the provider confirms, then becomes `cancelled`, or `completed`, `failed`, or `expired` when the provider job ended first. Poll until the batch has any final status. Repeating the call is safe while the batch is still `in_progress`; once it has a final status the call returns `409`. On OpenAI a cancelled batch keeps the requests that finished before the cancellation when OpenAI returns them: they are in `results` and billed like the rows of a completed batch. On every other provider OpenRouter returns no result rows for a cancelled batch, and the provider still charges for the requests that finished. When the batch wrote its output to your own storage, retrieving the batch can still return that location, and the rows the provider wrote there stay yours to read. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart). */ async cancel( request: operations.CancelBatchRequest,