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
45 changes: 26 additions & 19 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
lockVersion: ""
id: ""
management:
docChecksum: 241c8463586ba1b12f5091607ff82ad5
docChecksum: 74950c32e0e230b17ac912212d074775
docVersion: 1.0.0
speakeasyVersion: 1.787.0
generationVersion: 2.914.0
releaseVersion: 1.4.14
configChecksum: 6f320831a9eb7abf1be3f63f87038f2e
releaseVersion: 1.4.15
configChecksum: 15d349a47e9426ff0d9eb207b9709269
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
published: true
persistentEdits:
generation_id: cb4ac7e0-8275-40ad-b1d3-0457477c8737
pristine_commit_hash: 00573c457d5a0152007c68b5eea0502fc29a472c
pristine_tree_hash: 919f6de3a987442c8126ff45bd3b752f24f76ca3
generation_id: 060a25da-bb76-4ef8-b619-1687d19026b1
pristine_commit_hash: adc72e4330db981d278515a4382a2b3154a2021a
pristine_tree_hash: c8d282fc5270c4c7da7dcc83101103ae46b23195
features:
typescript:
acceptHeaders: 2.81.2
Expand Down Expand Up @@ -15162,8 +15162,8 @@ trackedFiles:
pristine_git_object: 295c739e9fc60406ccfc6b2173ac3df04352cf54
docs/sdks/generations/README.mdx:
id: a754fecc8514
last_write_checksum: sha1:25a298dfd98a8ff6b9ac4ef6517ac8f06f70fdd3
pristine_git_object: c89f724e7696bda6b18490073d4e715c679c4d56
last_write_checksum: sha1:003ce298aa49f039a6d52c7609a528b350e85347
pristine_git_object: a82cc0ed7ec517ec6824af4f1c1286f823555540
docs/sdks/guardrails/README.mdx:
id: a0cd4218b8fa
last_write_checksum: sha1:62a7078149962d36069ce08b4de5db93af364c27
Expand Down Expand Up @@ -15315,12 +15315,12 @@ trackedFiles:
pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a
jsr.json:
id: 7f6ab7767282
last_write_checksum: sha1:68829995bc6d6d7beb8e908838eb186f1e6f56da
pristine_git_object: 08765687fa0acf8e3c208251f913e51fb004899f
last_write_checksum: sha1:650c13196cf07897e794cfb2ec34033990af7e0a
pristine_git_object: 568d17a12421b3311ad32214f46e6312a2f515e0
package.json:
id: 7030d0b2f71b
last_write_checksum: sha1:230871e85b8bdb150ba09927db0d289d34bfc151
pristine_git_object: 9fc51032b30b1894a330b35ffbf2f5c0332fc618
last_write_checksum: sha1:1e1feb4f7071c397fb5728c6ee0fa836ae9fcb42
pristine_git_object: a7fdd713f85585699f120dfc4b7af918ba7e4b55
src/core.ts:
id: f431fdbcd144
last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131
Expand Down Expand Up @@ -15503,12 +15503,12 @@ trackedFiles:
pristine_git_object: 7ef73bab3ca62ff5b0152f617c77f6ff4570baf1
src/funcs/generationsGetGeneration.ts:
id: dac2d205a08d
last_write_checksum: sha1:df30787e54f6e48be96db656f8ad629a154f15bd
pristine_git_object: c1cfe95a7329a79ecdf46220af0c4588de0090d4
last_write_checksum: sha1:53bf624cee288d7b2d7f52c3b2167f8233038411
pristine_git_object: 43e40838978d59b57614a866b320cddbbec45657
src/funcs/generationsListGenerationContent.ts:
id: 6528b91d944c
last_write_checksum: sha1:c80af85ed7ab0854c6464b2b9aca66cbfeee41d8
pristine_git_object: 0603a6ed8e004fa946e1b83e2a1fef3118b8de34
last_write_checksum: sha1:e90765984e215e05058619701c1f1cfe69e2f3ca
pristine_git_object: d9cad5d73d53d3a6b7da3f27b3ddf8a385b873ff
src/funcs/generationsSubmitFeedback.ts:
id: 7164852deaac
last_write_checksum: sha1:279e57e1cb9653a79eb0221a27cb525661bb533b
Expand Down Expand Up @@ -15939,8 +15939,8 @@ trackedFiles:
pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e
src/lib/config.ts:
id: 320761608fb3
last_write_checksum: sha1:5fd669a96e1c6e58ec2245b6e19d610550313d9c
pristine_git_object: fdfe33f2cd077b037219c75526828117beaebb90
last_write_checksum: sha1:5d9a0c437cd9e390a940dad31639c73ecf5c5e5f
pristine_git_object: f563485228da8f20d9d31b2de0dae95ea16429aa
src/lib/dlv.ts:
id: b1988214835a
last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711
Expand Down Expand Up @@ -20500,6 +20500,8 @@ examples:
application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}}
"529":
application/json: {"error": {"code": 529, "message": "Provider returned error"}}
"400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
listModelsCount:
speakeasy-default-list-models-count:
responses:
Expand Down Expand Up @@ -21082,6 +21084,8 @@ examples:
application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}}
"529":
application/json: {"error": {"code": 529, "message": "Provider returned error"}}
"400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
listWorkspaces:
speakeasy-default-list-workspaces:
parameters:
Expand Down Expand Up @@ -24220,4 +24224,7 @@ examples:
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
examplesVersion: 1.0.2
releaseNotes: "## Typescript SDK Changes:\n* `openrouter.chat.send()`: \n * `request.chatRequest.tools[].union(ChatDynamicServerTool)` **Added**\n* `openrouter.presets.createPresetsChatCompletions()`: \n * `request.chatRequest.tools[].union(ChatDynamicServerTool)` **Added**\n"
releaseNotes: |
## Typescript SDK Changes:
* `openrouter.generations.getGeneration()`: `error.status[400]` **Added**
* `openrouter.generations.listGenerationContent()`: `error.status[400]` **Added**
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
typescript:
version: 1.4.14
version: 1.4.15
acceptHeaderEnum: false
additionalDependencies:
dependencies:
Expand Down
26 changes: 24 additions & 2 deletions .speakeasy/out.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39066,7 +39066,8 @@ paths:
schema:
description: 'The generation ID'
example: 'gen-1234567890'
minLength: 1
maxLength: 128
pattern: '^gen-[0-9A-Za-z-]+$'
type: 'string'
responses:
'200':
Expand Down Expand Up @@ -39120,6 +39121,16 @@ paths:
schema:
$ref: '#/components/schemas/GenerationResponse'
description: 'Returns the request metadata for this generation'
'400':
content:
application/json:
example:
error:
code: 400
message: 'Invalid request parameters'
schema:
$ref: '#/components/schemas/BadRequestResponse'
description: 'Bad Request - Invalid request parameters or malformed input'
'401':
content:
application/json:
Expand Down Expand Up @@ -39218,7 +39229,8 @@ paths:
schema:
description: 'The generation ID'
example: 'gen-1234567890'
minLength: 1
maxLength: 128
pattern: '^gen-[0-9A-Za-z-]+$'
type: 'string'
responses:
'200':
Expand All @@ -39237,6 +39249,16 @@ paths:
schema:
$ref: '#/components/schemas/GenerationContentResponse'
description: 'Returns the stored prompt and completion content, plus the failure error when the generation failed'
'400':
content:
application/json:
example:
error:
code: 400
message: 'Invalid request parameters'
schema:
$ref: '#/components/schemas/BadRequestResponse'
description: 'Bad Request - Invalid request parameters or malformed input'
'401':
content:
application/json:
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.787.0
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:ddb8b0f9293b58ee0c2e3757aac37b7a9d58d20d104d696cf11df5e2c9c472ca
sourceBlobDigest: sha256:57c13de3b3d8028de6ee4988eb0bb0dd6ca8ace178a93487a60946d3f030b6fb
sourceRevisionDigest: sha256:a9c094f15cb97f9e94d635a472b9188199a8ebe910414d8f5c33e6019b9b9db0
sourceBlobDigest: sha256:f4c2f591b1464f7d50f5a8bc051679a4fa37e11f6e3d47681287548da39fcd76
tags:
- latest
- 1.0.0
targets:
openrouter:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:ddb8b0f9293b58ee0c2e3757aac37b7a9d58d20d104d696cf11df5e2c9c472ca
sourceBlobDigest: sha256:57c13de3b3d8028de6ee4988eb0bb0dd6ca8ace178a93487a60946d3f030b6fb
sourceRevisionDigest: sha256:a9c094f15cb97f9e94d635a472b9188199a8ebe910414d8f5c33e6019b9b9db0
sourceBlobDigest: sha256:f4c2f591b1464f7d50f5a8bc051679a4fa37e11f6e3d47681287548da39fcd76
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
codeSamplesRevisionDigest: sha256:923ab10f0d71c02925a224c60eb7003589180bf6341506b91b1aeb3980783fb3
codeSamplesRevisionDigest: sha256:605b8182303c411aedd629a1b23de5602b323fa7b02643b487a9bc08a3706e98
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4276,4 +4276,14 @@ Based on:
### Generated
- [typescript v1.4.14] .
### Releases
- [NPM v1.4.14] https://www.npmjs.com/package/@openrouter/sdk/v/1.4.14 - .
- [NPM v1.4.14] https://www.npmjs.com/package/@openrouter/sdk/v/1.4.14 - .

## 2026-10-01 11:52:51
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v1.4.15] .
### Releases
- [NPM v1.4.15] https://www.npmjs.com/package/@openrouter/sdk/v/1.4.15 - .
2 changes: 2 additions & 0 deletions docs/sdks/generations/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ run();

| Error Type | Status Code | Content Type |
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
| errors.BadRequestResponseError | 400 | application/json |
| errors.UnauthorizedResponseError | 401 | application/json |
| errors.PaymentRequiredResponseError | 402 | application/json |
| errors.NotFoundResponseError | 404 | application/json |
Expand Down Expand Up @@ -175,6 +176,7 @@ run();

| Error Type | Status Code | Content Type |
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
| errors.BadRequestResponseError | 400 | application/json |
| errors.UnauthorizedResponseError | 401 | application/json |
| errors.ForbiddenResponseError | 403 | application/json |
| errors.NotFoundResponseError | 404 | application/json |
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@openrouter/sdk",
"version": "1.4.14",
"version": "1.4.15",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openrouter/sdk",
"version": "1.4.14",
"version": "1.4.15",
"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": [
Expand All @@ -21,8 +21,8 @@
"license": "Apache-2.0",
"packageManager": "pnpm@10.22.0",
"publishConfig": {
"access": "public",
"provenance": true
"provenance": true,
"access": "public"
},
"type": "module",
"main": "./esm/index.js",
Expand Down Expand Up @@ -73,15 +73,15 @@
"lint": "eslint --cache --max-warnings=0 src",
"build": "tsc && node scripts/unbarrel-imports.js",
"prepublishOnly": "npm run build",
"typecheck:transit": "exit 0",
"compile": "tsc && node scripts/unbarrel-imports.js",
"postinstall": "node scripts/check-types.js || true",
"prepare": "npm run build",
"test:e2e": "vitest --run --project e2e",
"test:transit": "exit 0",
"test:watch": "vitest --watch --project unit",
"typecheck": "tsc --noEmit",
"typecheck:transit": "exit 0",
"compile": "tsc && node scripts/unbarrel-imports.js",
"prepare": "npm run build",
"test": "vitest --run --project unit",
"test:watch": "vitest --watch --project unit"
"test:transit": "exit 0"
},
"peerDependencies": {

Expand Down
4 changes: 4 additions & 0 deletions src/funcs/generationsGetGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function generationsGetGeneration(
): APIPromise<
Result<
models.GenerationResponse,
| errors.BadRequestResponseError
| errors.UnauthorizedResponseError
| errors.PaymentRequiredResponseError
| errors.NotFoundResponseError
Expand Down Expand Up @@ -71,6 +72,7 @@ async function $do(
[
Result<
models.GenerationResponse,
| errors.BadRequestResponseError
| errors.UnauthorizedResponseError
| errors.PaymentRequiredResponseError
| errors.NotFoundResponseError
Expand Down Expand Up @@ -190,6 +192,7 @@ async function $do(

const [result] = await M.match<
models.GenerationResponse,
| errors.BadRequestResponseError
| errors.UnauthorizedResponseError
| errors.PaymentRequiredResponseError
| errors.NotFoundResponseError
Expand All @@ -208,6 +211,7 @@ async function $do(
| SDKValidationError
>(
M.json(200, models.GenerationResponse$inboundSchema),
M.jsonErr(400, errors.BadRequestResponseError$inboundSchema),
M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema),
M.jsonErr(402, errors.PaymentRequiredResponseError$inboundSchema),
M.jsonErr(404, errors.NotFoundResponseError$inboundSchema),
Expand Down
4 changes: 4 additions & 0 deletions src/funcs/generationsListGenerationContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function generationsListGenerationContent(
): APIPromise<
Result<
models.GenerationContentResponse,
| errors.BadRequestResponseError
| errors.UnauthorizedResponseError
| errors.ForbiddenResponseError
| errors.NotFoundResponseError
Expand Down Expand Up @@ -71,6 +72,7 @@ async function $do(
[
Result<
models.GenerationContentResponse,
| errors.BadRequestResponseError
| errors.UnauthorizedResponseError
| errors.ForbiddenResponseError
| errors.NotFoundResponseError
Expand Down Expand Up @@ -191,6 +193,7 @@ async function $do(

const [result] = await M.match<
models.GenerationContentResponse,
| errors.BadRequestResponseError
| errors.UnauthorizedResponseError
| errors.ForbiddenResponseError
| errors.NotFoundResponseError
Expand All @@ -209,6 +212,7 @@ async function $do(
| SDKValidationError
>(
M.json(200, models.GenerationContentResponse$inboundSchema),
M.jsonErr(400, errors.BadRequestResponseError$inboundSchema),
M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema),
M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema),
M.jsonErr(404, errors.NotFoundResponseError$inboundSchema),
Expand Down
4 changes: 2 additions & 2 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.0.0",
sdkVersion: "1.4.14",
sdkVersion: "1.4.15",
genVersion: "2.914.0",
userAgent: "speakeasy-sdk/typescript 1.4.14 2.914.0 1.0.0 @openrouter/sdk",
userAgent: "speakeasy-sdk/typescript 1.4.15 2.914.0 1.0.0 @openrouter/sdk",
} as const;
Loading