diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 81dc8e2cb..ec13453bb 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: "" id: "" management: - docChecksum: f1d04aa19cf510a71071715125039286 + docChecksum: 5fa16269d60eadd30774aef31c438680 docVersion: 1.0.0 speakeasyVersion: 1.808.1 generationVersion: 2.960.8 - releaseVersion: 1.5.160 - configChecksum: 57e18a39bf84e6530ce37741dabcada0 + releaseVersion: 1.5.161 + configChecksum: 0e4fbde82c3e96a5b3e8ad2797dc2afc repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true @@ -19425,7 +19425,7 @@ examples: application/json: {"model": "google/veo-3.1"} responses: "202": - application/json: {"id": "gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt", "polling_url": "/api/v1/videos/gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt", "status": "pending"} + application/json: {"id": "gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt", "polling_url": "https://eu.openrouter.ai/api/v1/videos/gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt", "status": "pending"} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -19453,7 +19453,7 @@ examples: jobId: "job-abc123" responses: "200": - application/json: {"id": "gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt", "polling_url": "/api/v1/videos/gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt", "status": "pending"} + application/json: {"id": "gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt", "polling_url": "https://eu.openrouter.ai/api/v1/videos/gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt", "status": "pending"} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "404": @@ -23909,4 +23909,3 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} 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.batch.createBatches()`: \n * `request.batchSubmitBody.provider.only[].union(ProviderName).enum(langChain)` **Added**\n* `openrouter.byok.list()`: \n * `request.provider` **Changed**\n * `response.data[].provider.enum(langchain)` **Added**\n* `openrouter.byok.create()`: \n * `request.createByokKeyRequest.provider.enum(langchain)` **Added**\n * `response.data.provider.enum(langchain)` **Added**\n* `openrouter.byok.get()`: `response.data.provider.enum(langchain)` **Added**\n* `openrouter.byok.update()`: `response.data.provider.enum(langchain)` **Added**\n* `openrouter.chat.send()`: \n * `request.chatRequest.provider` **Changed**\n* `openrouter.embeddings.generate()`: \n * `request.requestBody.provider` **Changed**\n* `openrouter.endpoints.listZdrEndpoints()`: `response.data[].providerName.enum(langChain)` **Added**\n* `openrouter.endpoints.list()`: `response.data.endpoints[].providerName.enum(langChain)` **Added**\n* `openrouter.generations.getGeneration()`: `response.data.providerResponses[].providerName.enum(langChain)` **Added**\n* `openrouter.images.generate()`: \n * `request.imageGenerationRequest.provider` **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.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" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8972588fe..8f73fc82c 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -38,7 +38,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.5.160 + version: 1.5.161 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index aa7862097..d793638f3 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -41092,7 +41092,7 @@ components: example: generation_id: 'gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt' id: 'gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt' - polling_url: '/api/v1/videos/gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt' + polling_url: 'https://eu.openrouter.ai/api/v1/videos/gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt' status: 'pending' status_detail: 'queued_at_provider' properties: @@ -41108,6 +41108,7 @@ components: description: 'The video job ID, in the `gen-vid--<20 alphanumerics>` generation ID format. Pass it as `previous_job_id` to continue the generation.' type: 'string' polling_url: + description: 'Absolute URL on the job’s OpenRouter regional host. Use it as returned to poll the job with your API key.' type: 'string' progress: description: 'Percent complete, from 0 to 100 and possibly fractional, reported by the provider while `status_detail` is `generating`. Present only for providers that report it, and absent once the job moves to `finalizing`.' @@ -41135,7 +41136,7 @@ components: type: 'string' x-speakeasy-unknown-values: allow unsigned_urls: - description: 'OpenRouter content URLs for each output. They need your API key in the `Authorization` header and keep working for as long as the output is available.' + description: 'Absolute URLs on the job’s OpenRouter regional host, one per output. Use the selected URL as returned with your API key in the `Authorization` header. It works while the output is available.' items: type: 'string' type: 'array' @@ -65140,7 +65141,7 @@ paths: example: generation_id: 'gen-xyz789' id: 'job-abc123' - polling_url: '/api/v1/videos/job-abc123' + polling_url: 'https://eu.openrouter.ai/api/v1/videos/job-abc123' status: 'pending' schema: $ref: '#/components/schemas/VideoGenerationResponse' @@ -65272,10 +65273,10 @@ paths: example: generation_id: 'gen-xyz789' id: 'job-abc123' - polling_url: '/api/v1/videos/job-abc123' + polling_url: 'https://eu.openrouter.ai/api/v1/videos/job-abc123' status: 'completed' unsigned_urls: - - 'https://storage.example.com/video.mp4' + - 'https://eu.openrouter.ai/api/v1/videos/job-abc123/content?index=0' usage: cost: 0.5 schema: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 2fac44f48..a57cce041 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:e38f013c9bb27e1a6b2fc86b055a1197f2840a86c2a940b3d10d051f21cf520e - sourceBlobDigest: sha256:8ce2c73303e53617ef86b9f4ebfb4d18e5a08bd5119603199f4caabf3ef70f44 + sourceRevisionDigest: sha256:b1ef5f27d7c77d01346cffa2dad6f9148a5f8230f1ec3a07e44b6e88f8360fff + sourceBlobDigest: sha256:ed93555bcb06d452ae3ba7137cdf7d75bc5bfcc233adbc6e44fdbd53b0e973c9 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:e38f013c9bb27e1a6b2fc86b055a1197f2840a86c2a940b3d10d051f21cf520e - sourceBlobDigest: sha256:8ce2c73303e53617ef86b9f4ebfb4d18e5a08bd5119603199f4caabf3ef70f44 + sourceRevisionDigest: sha256:b1ef5f27d7c77d01346cffa2dad6f9148a5f8230f1ec3a07e44b6e88f8360fff + sourceBlobDigest: sha256:ed93555bcb06d452ae3ba7137cdf7d75bc5bfcc233adbc6e44fdbd53b0e973c9 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:785c200fec4c907d36be4bfe9a3d8fd9955afce14b32b016c10d22c8360fd2b0 + codeSamplesRevisionDigest: sha256:fc4556311c1bd186547cfe23b49d4f2a6e2e9d7d1e5abe1e80671780fdcbd83f workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.808.1 diff --git a/RELEASES.md b/RELEASES.md index 556dcf02e..4e2ba82ea 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -5976,4 +5976,14 @@ Based on: ### Generated - [typescript v1.5.160] . ### Releases -- [NPM v1.5.160] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.160 - . \ No newline at end of file +- [NPM v1.5.160] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.160 - . + +## 2026-12-02 05:47:38 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.808.1 (2.960.8) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.5.161] . +### Releases +- [NPM v1.5.161] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.161 - . \ No newline at end of file diff --git a/docs/models/videogenerationresponse.mdx b/docs/models/videogenerationresponse.mdx index 87c9cf439..cc36cf57f 100644 --- a/docs/models/videogenerationresponse.mdx +++ b/docs/models/videogenerationresponse.mdx @@ -9,7 +9,8 @@ import { VideoGenerationResponse } from "@openrouter/sdk/models"; let value: VideoGenerationResponse = { id: "gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt", - pollingUrl: "/api/v1/videos/gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt", + pollingUrl: + "https://eu.openrouter.ai/api/v1/videos/gen-vid-1789480874-Ab3dEf9hIjKlMnOpQrSt", status: "pending", }; ``` @@ -22,10 +23,10 @@ let value: VideoGenerationResponse = { | `expiresAt` | *number* | ➖ | Unix timestamp in seconds when OpenRouter's stored copy of the outputs stops being available. Present only when that copy exists. | | | `generationId` | *string* | ➖ | The generation ID associated with this video generation job. Available once the job has been processed. | | | `id` | *string* | ✔️ | The video job ID, in the `gen-vid--<20 alphanumerics>` generation ID format. Pass it as `previous_job_id` to continue the generation. | | -| `pollingUrl` | *string* | ✔️ | N/A | | +| `pollingUrl` | *string* | ✔️ | Absolute URL on the job’s OpenRouter regional host. Use it as returned to poll the job with your API key. | | | `progress` | *number* | ➖ | Percent complete, from 0 to 100 and possibly fractional, reported by the provider while `status_detail` is `generating`. Present only for providers that report it, and absent once the job moves to `finalizing`. | | | `status` | [models.VideoGenerationResponseStatus](../models/videogenerationresponsestatus.mdx) | ✔️ | N/A | | | `statusDetail` | [models.StatusDetail](../models/statusdetail.mdx) | ➖ | The step within `status` for a job that is not finished: `submitting` and `queued_at_provider` under `pending`, `generating` and `finalizing` under `in_progress`. When present, it only moves forward, and steps may be skipped between polls. It is absent once the job is finished and can also be absent mid-job when the step is unknown, so use `status` to tell whether the job is finished. | | -| `unsignedUrls` | *string*[] | ➖ | OpenRouter content URLs for each output. They need your API key in the `Authorization` header and keep working for as long as the output is available. | | +| `unsignedUrls` | *string*[] | ➖ | Absolute URLs on the job’s OpenRouter regional host, one per output. Use the selected URL as returned with your API key in the `Authorization` header. It works while the output is available. | | | `urls` | *string*[] | ➖ | Signed download URLs for OpenRouter's stored copy of each output, usable without an API key until `expires_at`. Anyone holding a URL can download that output until it expires, so treat it like a secret. Present only when the stored copy exists. | | | `usage` | [models.VideoGenerationUsage](../models/videogenerationusage.mdx) | ➖ | Usage and cost information for the video generation. Available once the job has completed. | \{
"cost": 0.5,
"is_byok": false
} | \ No newline at end of file diff --git a/jsr.json b/jsr.json index 9fcef3134..d9c847268 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.5.160", + "version": "1.5.161", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 4a76a9ed3..1cb77cc64 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.5.160", + "version": "1.5.161", "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": { - "access": "public", - "provenance": true + "provenance": true, + "access": "public" }, "type": "module", "main": "./esm/index.js", @@ -73,15 +73,15 @@ "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", - "typecheck": "tsc --noEmit", "compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js", + "test": "vitest --run --project unit", + "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:transit": "exit 0", - "postinstall": "node scripts/check-types.js || true", - "prepare": "npm run build", - "test": "vitest --run --project unit" + "typecheck": "tsc --noEmit", + "typecheck:transit": "exit 0" }, "peerDependencies": { diff --git a/src/lib/config.ts b/src/lib/config.ts index e3d4ac246..f45c5ec11 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.160", + sdkVersion: "1.5.161", genVersion: "2.960.8", - userAgent: "speakeasy-sdk/typescript 1.5.160 2.960.8 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.5.161 2.960.8 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/videogenerationresponse.ts b/src/models/videogenerationresponse.ts index 63cbc03e0..4ad3a90cb 100644 --- a/src/models/videogenerationresponse.ts +++ b/src/models/videogenerationresponse.ts @@ -54,6 +54,9 @@ export type VideoGenerationResponse = { * The video job ID, in the `gen-vid--<20 alphanumerics>` generation ID format. Pass it as `previous_job_id` to continue the generation. */ id: string; + /** + * Absolute URL on the job’s OpenRouter regional host. Use it as returned to poll the job with your API key. + */ pollingUrl: string; /** * Percent complete, from 0 to 100 and possibly fractional, reported by the provider while `status_detail` is `generating`. Present only for providers that report it, and absent once the job moves to `finalizing`. @@ -65,7 +68,7 @@ export type VideoGenerationResponse = { */ statusDetail?: StatusDetail | undefined; /** - * OpenRouter content URLs for each output. They need your API key in the `Authorization` header and keep working for as long as the output is available. + * Absolute URLs on the job’s OpenRouter regional host, one per output. Use the selected URL as returned with your API key in the `Authorization` header. It works while the output is available. */ unsignedUrls?: Array | undefined; /**