Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: ""
id: ""
management:
docChecksum: 5fa16269d60eadd30774aef31c438680
docChecksum: 3cdd0a6bb971453b3f08e69bc6940ee5
docVersion: 1.0.0
speakeasyVersion: 1.808.1
generationVersion: 2.960.8
releaseVersion: 1.5.161
configChecksum: 0e4fbde82c3e96a5b3e8ad2797dc2afc
releaseVersion: 1.5.162
configChecksum: d725f07fbdad6b88d9f38aa716b04f93
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
published: true
Expand Down Expand Up @@ -7839,6 +7839,8 @@ trackedFiles:
docs/models/operations/bulkunassignmembersfromguardrailrequest.mdx:
id: 712e15346453
pristine_git_object: 924d309e1b1b22fc3386c659ef9b6dc903d53b20
docs/models/operations/cancelbatchglobals.mdx: {}
docs/models/operations/cancelbatchrequest.mdx: {}
docs/models/operations/changeapikeypolicyassignmentglobals.mdx:
id: 591ea5f13259
pristine_git_object: 651d067d3f9aff7d4a025a6295884e572bd88a54
Expand Down Expand Up @@ -14399,6 +14401,7 @@ trackedFiles:
src/funcs/apiKeysUpdate.ts:
id: 05700884934b
pristine_git_object: 913f253c6ba572dc3df10a3d647a70aa13c9ef98
src/funcs/batchCancel.ts: {}
src/funcs/batchCreateBatches.ts:
id: 8796df347125
pristine_git_object: 81f8ee7d8254bc065cdd49286648fd487e47e1c0
Expand Down Expand Up @@ -16975,6 +16978,7 @@ trackedFiles:
src/models/operations/bulkunassignmembersfromguardrail.ts:
id: ea6be9164914
pristine_git_object: de9f7c710114cfd263def5b6b7541dadf4ba6244
src/models/operations/cancelbatch.ts: {}
src/models/operations/changeapikeypolicyassignment.ts:
id: 23e28972f11c
pristine_git_object: fac6e9842a90c1b86b69380dae99c5ef0624d9c6
Expand Down Expand Up @@ -23908,4 +23912,19 @@ examples:
application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}}
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
cancelBatch:
speakeasy-default-cancel-batch:
parameters:
path:
id: "batch_abc123"
responses:
"200":
application/json: {"completion_window": "24h", "created_at": 532952, "endpoint": "<value>", "error": {"message": "<value>"}, "expires_at": 340450, "finalized_at": 285267, "id": "<id>", "model": "Taurus", "object": "batch", "provider": "<value>", "request_counts": {"completed": 228691, "failed": 283504, "total": 213468}, "results": [], "status": "expired", "usage": {"completion_tokens": 41402, "prompt_tokens": 122283, "total_tokens": 34931}}
"400":
application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}}
"500":
application/json: {"error": {"code": 400, "message": "custom_id is required on requests[0]."}}
examplesVersion: 1.0.2
releaseNotes: |
## Typescript SDK Changes:
* `openrouter.batch.cancel()`: **Added**
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
typescript:
version: 1.5.161
version: 1.5.162
acceptHeaderEnum: false
additionalDependencies:
dependencies:
Expand Down
122 changes: 121 additions & 1 deletion .speakeasy/out.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44918,6 +44918,125 @@ paths:
- $ref: "#/components/parameters/AppIdentifier"
- $ref: "#/components/parameters/AppDisplayName"
- $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).'
operationId: 'cancelBatch'
parameters:
- description: 'The batch job id returned from submit.'
in: 'path'
name: 'id'
required: true
schema:
description: 'The batch job id returned from submit.'
example: 'batch_abc123'
minLength: 1
type: 'string'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/BatchObject'
description: 'The provider accepted the cancellation, or the provider job had already ended while OpenRouter still stores the batch as running. Poll the batch for its final status.'
'400':
content:
application/json:
example:
error:
code: 400
message: 'No active workspace resolved for this request.'
schema:
$ref: '#/components/schemas/BatchErrorResponse'
description: 'The API key resolved no active workspace.'
'401':
content:
application/json:
example:
error:
code: 401
message: 'No auth credentials found.'
schema:
$ref: '#/components/schemas/BatchErrorResponse'
description: 'Missing or invalid API key.'
'403':
content:
application/json:
example:
error:
code: 403
message: 'Batch cancellation is not enabled for this organization.'
schema:
$ref: '#/components/schemas/BatchErrorResponse'
description: 'Batch cancellation is not enabled for the organization.'
'404':
content:
application/json:
example:
error:
code: 404
message: 'Batch not found.'
schema:
$ref: '#/components/schemas/BatchErrorResponse'
description: 'No batch exists for the given id.'
'409':
content:
application/json:
example:
error:
code: 409
message: 'This batch has already ended and cannot be cancelled.'
schema:
$ref: '#/components/schemas/BatchErrorResponse'
description: 'The batch has already ended, has not reached the provider yet, runs on a provider without a cancel call, or its required provider key is unavailable.'
'429':
content:
application/json:
example:
error:
code: 429
message: 'Rate limit exceeded.'
schema:
$ref: '#/components/schemas/BatchErrorResponse'
description: 'Batch API rate limit exceeded for the billable entity.'
'500':
content:
application/json:
example:
error:
code: 500
message: 'Internal server error.'
schema:
$ref: '#/components/schemas/BatchErrorResponse'
description: 'Unexpected error in the ingress or upstream batch-api.'
'502':
content:
application/json:
example:
error:
code: 502
message: 'Upstream batch-api is unavailable.'
schema:
$ref: '#/components/schemas/BatchErrorResponse'
description: 'The batch service is unavailable, or an upstream provider operation failed.'
'503':
content:
application/json:
example:
error:
code: 503
message: 'Service Unavailable'
schema:
$ref: '#/components/schemas/BatchErrorResponse'
description: 'OpenRouter could not check whether the caller may cancel the batch. No cancellation is sent to the provider. Retry the request.'
summary: 'Cancel a batch'
tags:
- 'Batch'
x-speakeasy-name-override: 'cancel'
parameters:
- $ref: "#/components/parameters/AppIdentifier"
- $ref: "#/components/parameters/AppDisplayName"
- $ref: "#/components/parameters/AppCategories"
/batches/{id}/results:
get:
description: 'Returns a cursor-paginated page of normalized OpenRouter-format results for a finished batch. Pass the previous page''s `next_cursor` as `cursor` to read the next page. Pages are stable across retries for the 30-day artifact retention window. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).'
Expand Down Expand Up @@ -55886,6 +56005,7 @@ paths:
- $ref: "#/components/parameters/AppCategories"
/models:
get:
description: 'Lists the models available to the caller with their pricing, context length, modalities, and supported parameters, plus presets when the caller is authenticated. An unfiltered call returns every text-output model (often several hundred KB of JSON or more; set `output_modalities` to list models with other outputs); use `limit` and `offset` to cap the result and filters such as `q`, `output_modalities`, `input_modalities`, or `supported_parameters` to narrow it (`sort` only reorders), or call `GET /api/v1/model/{author}/{slug}` to inspect a single catalog model. `category` is a usage shortlist, not a catalog filter: it returns only the top 20 models in that category by past-week token usage, never presets, and cannot be combined with `limit`, `offset`, or `supported_parameters`.'
operationId: 'getModels'
parameters:
- description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned'
Expand Down Expand Up @@ -66715,7 +66835,7 @@ tags:
name: 'Anthropic Messages'
- description: 'BYOK endpoints'
name: 'BYOK'
- description: 'Submit, list, poll, and delete asynchronous batches of inference requests. See https://openrouter.ai/docs/batch-quickstart.'
- description: 'Submit, list, poll, cancel, and delete asynchronous batches of inference requests. See https://openrouter.ai/docs/batch-quickstart.'
name: 'Batch'
- description: 'Benchmarks endpoints'
name: 'Benchmarks'
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ speakeasyVersion: 1.808.1
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:b1ef5f27d7c77d01346cffa2dad6f9148a5f8230f1ec3a07e44b6e88f8360fff
sourceBlobDigest: sha256:ed93555bcb06d452ae3ba7137cdf7d75bc5bfcc233adbc6e44fdbd53b0e973c9
sourceRevisionDigest: sha256:156bdb27a76cafe9a8cb5e591993ea477fb203cd76b75b2e210940306fd853b2
sourceBlobDigest: sha256:5c3e81867d7b6d9c38dabd7d19083b202928e9bde6707c0502925911c17d5308
tags:
- latest
- 1.0.0
targets:
openrouter:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:b1ef5f27d7c77d01346cffa2dad6f9148a5f8230f1ec3a07e44b6e88f8360fff
sourceBlobDigest: sha256:ed93555bcb06d452ae3ba7137cdf7d75bc5bfcc233adbc6e44fdbd53b0e973c9
sourceRevisionDigest: sha256:156bdb27a76cafe9a8cb5e591993ea477fb203cd76b75b2e210940306fd853b2
sourceBlobDigest: sha256:5c3e81867d7b6d9c38dabd7d19083b202928e9bde6707c0502925911c17d5308
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
codeSamplesRevisionDigest: sha256:fc4556311c1bd186547cfe23b49d4f2a6e2e9d7d1e5abe1e80671780fdcbd83f
codeSamplesRevisionDigest: sha256:4025b56ae8d6b4856845dec105f30d44408a7f5f6de257c1e7eaa01cdbc0cc8c
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.808.1
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5986,4 +5986,14 @@ Based on:
### Generated
- [typescript v1.5.161] .
### Releases
- [NPM v1.5.161] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.161 - .
- [NPM v1.5.161] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.161 - .

## 2026-12-02 07:30:31
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.808.1 (2.960.8) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v1.5.162] .
### Releases
- [NPM v1.5.162] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.162 - .
19 changes: 19 additions & 0 deletions docs/models/operations/cancelbatchglobals.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: "CancelBatchGlobals"
---

## Example Usage

```typescript
import { CancelBatchGlobals } from "@openrouter/sdk/models/operations";

let value: CancelBatchGlobals = {};
```

## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `httpReferer` | *string* | βž– | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
| `appTitle` | *string* | βž– | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
| `appCategories` | *string* | βž– | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> |
Loading