From c8f7423120498a003b215b130287966e18e13882 Mon Sep 17 00:00:00 2001 From: talos <415831+talos@users.noreply.github.com> Date: Mon, 10 Nov 2025 15:16:11 +0000 Subject: [PATCH 1/2] chore: update OpenAPI specification from openrouter-web --- .speakeasy/in.openapi.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 1f96d5e..beaf537 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -8130,6 +8130,11 @@ paths: type: number description: Credit limit for the API key to be created example: 100 + expires_at: + type: string + nullable: true + format: date-time + description: Optional expiration time for the API key to be created required: - callback_url example: From c9a93c79f5074e1c7f56e12a31fe7f77f962989e Mon Sep 17 00:00:00 2001 From: update-generated-files-action <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 15:17:50 +0000 Subject: [PATCH 2/2] Chore: auto-generate SDK and API documentation https://github.com/OpenRouterTeam/typescript-sdk/actions/runs/19236436968 --- .speakeasy/gen.lock | 8 ++++---- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 7 ++++++- .speakeasy/workflow.lock | 13 +++++++------ docs/models/operations/createauthkeyscoderequest.md | 3 ++- docs/models/outputitemimagegenerationcall.md | 2 +- docs/models/responsesimagegenerationcall.md | 2 +- examples/nextjs-example/package-lock.json | 3 ++- jsr.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/lib/config.ts | 4 ++-- src/models/openairesponsesinputunion.ts | 8 ++++---- src/models/openresponsesinput.ts | 12 ++++++------ src/models/operations/createauthkeyscode.ts | 7 +++++++ src/models/outputitemimagegenerationcall.ts | 4 ++-- src/models/responsesimagegenerationcall.ts | 6 +++--- src/models/responsesoutputitem.ts | 4 ++-- 18 files changed, 54 insertions(+), 39 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d83cc1f..91183bc 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 8b6cd71c-ea04-44da-af45-e43968b5928d management: - docChecksum: 973d42c85e29be093122e32bf9e93222 + docChecksum: 72770d47aad60a8f1a16b4613e8d1ca3 docVersion: 1.0.0 - speakeasyVersion: 1.651.0 + speakeasyVersion: 1.652.0 generationVersion: 2.745.2 - releaseVersion: 0.1.6 - configChecksum: e27fc703d71f79dfd40a863b5853fe72 + releaseVersion: 0.1.7 + configChecksum: bf32e6ab7422922b4cca9c193ae8e0fb repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index dba2581..b00e3e2 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false typescript: - version: 0.1.6 + version: 0.1.7 acceptHeaderEnum: false additionalDependencies: dependencies: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index cbd3c9a..9227345 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -414,12 +414,12 @@ components: result: type: string nullable: true + default: null status: $ref: '#/components/schemas/ImageGenerationStatus' required: - type - id - - result - status example: type: image_generation_call @@ -8138,6 +8138,11 @@ paths: type: number description: Credit limit for the API key to be created example: 100 + expires_at: + type: string + nullable: true + format: date-time + description: Optional expiration time for the API key to be created required: - callback_url example: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 4c3231e..81515e3 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,20 +1,21 @@ -speakeasyVersion: 1.651.0 +speakeasyVersion: 1.652.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:73beb40e7db6cb1d1bfbc364fd655f9ebdf6f9d6b3f1a71836a3a851d07e5d80 - sourceBlobDigest: sha256:ab3d90309e030249c89844dba54d28dc758bee9c5749ddfd961e4bb844bc5128 + sourceRevisionDigest: sha256:6ebac1e729591ec2c09e69bd6be79efd3b92d8c096be40905b2622ba9d55216a + sourceBlobDigest: sha256:77e4e4e1005c72b7f3229453613f1d7aaa997abf08a2fc66523d55a5dbcd8556 tags: - latest + - staging - 1.0.0 targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:73beb40e7db6cb1d1bfbc364fd655f9ebdf6f9d6b3f1a71836a3a851d07e5d80 - sourceBlobDigest: sha256:ab3d90309e030249c89844dba54d28dc758bee9c5749ddfd961e4bb844bc5128 + sourceRevisionDigest: sha256:6ebac1e729591ec2c09e69bd6be79efd3b92d8c096be40905b2622ba9d55216a + sourceBlobDigest: sha256:77e4e4e1005c72b7f3229453613f1d7aaa997abf08a2fc66523d55a5dbcd8556 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:b6196f12c8fcc8d875b535837a4bd70c5312256f43a98034d60c6fbca000ed87 + codeSamplesRevisionDigest: sha256:723294fa9e26e899e01d155bf97971b1d0c207dac0426ee48887ffeae95fab1a workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/docs/models/operations/createauthkeyscoderequest.md b/docs/models/operations/createauthkeyscoderequest.md index 1a4a1f3..68c857f 100644 --- a/docs/models/operations/createauthkeyscoderequest.md +++ b/docs/models/operations/createauthkeyscoderequest.md @@ -17,4 +17,5 @@ let value: CreateAuthKeysCodeRequest = { | `callbackUrl` | *string* | :heavy_check_mark: | The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed. | https://myapp.com/auth/callback | | `codeChallenge` | *string* | :heavy_minus_sign: | PKCE code challenge for enhanced security | E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM | | `codeChallengeMethod` | [operations.CreateAuthKeysCodeCodeChallengeMethod](../../models/operations/createauthkeyscodecodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 | -| `limit` | *number* | :heavy_minus_sign: | Credit limit for the API key to be created | 100 | \ No newline at end of file +| `limit` | *number* | :heavy_minus_sign: | Credit limit for the API key to be created | 100 | +| `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Optional expiration time for the API key to be created | | \ No newline at end of file diff --git a/docs/models/outputitemimagegenerationcall.md b/docs/models/outputitemimagegenerationcall.md index 57116a5..f441812 100644 --- a/docs/models/outputitemimagegenerationcall.md +++ b/docs/models/outputitemimagegenerationcall.md @@ -20,5 +20,5 @@ let value: OutputItemImageGenerationCall = { | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `type` | [models.OutputItemImageGenerationCallType](../models/outputitemimagegenerationcalltype.md) | :heavy_check_mark: | N/A | | | `id` | *string* | :heavy_check_mark: | N/A | | -| `result` | *string* | :heavy_check_mark: | N/A | | +| `result` | *string* | :heavy_minus_sign: | N/A | | | `status` | [models.ImageGenerationStatus](../models/imagegenerationstatus.md) | :heavy_check_mark: | N/A | completed | \ No newline at end of file diff --git a/docs/models/responsesimagegenerationcall.md b/docs/models/responsesimagegenerationcall.md index a489993..b332a66 100644 --- a/docs/models/responsesimagegenerationcall.md +++ b/docs/models/responsesimagegenerationcall.md @@ -20,5 +20,5 @@ let value: ResponsesImageGenerationCall = { | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | `type` | [models.ResponsesImageGenerationCallType](../models/responsesimagegenerationcalltype.md) | :heavy_check_mark: | N/A | | | `id` | *string* | :heavy_check_mark: | N/A | | -| `result` | *string* | :heavy_check_mark: | N/A | | +| `result` | *string* | :heavy_minus_sign: | N/A | | | `status` | [models.ImageGenerationStatus](../models/imagegenerationstatus.md) | :heavy_check_mark: | N/A | completed | \ No newline at end of file diff --git a/examples/nextjs-example/package-lock.json b/examples/nextjs-example/package-lock.json index 77ab6ea..64a006c 100644 --- a/examples/nextjs-example/package-lock.json +++ b/examples/nextjs-example/package-lock.json @@ -36,7 +36,8 @@ }, "../..": { "name": "@openrouter/sdk", - "version": "0.1.4", + "version": "0.1.7", + "license": "Apache-2.0", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/jsr.json b/jsr.json index 014aad1..c223596 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "0.1.6", + "version": "0.1.7", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 56ad82f..a5fc2e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openrouter/sdk", - "version": "0.1.6", + "version": "0.1.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openrouter/sdk", - "version": "0.1.6", + "version": "0.1.7", "license": "Apache-2.0", "dependencies": { "zod": "^3.25.0 || ^4.0.0" diff --git a/package.json b/package.json index 4cba03d..5ad54c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "0.1.6", + "version": "0.1.7", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.", "keywords": [ diff --git a/src/lib/config.ts b/src/lib/config.ts index 0c7d585..bc6e1d7 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -59,7 +59,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.1.6", + sdkVersion: "0.1.7", genVersion: "2.745.2", - userAgent: "speakeasy-sdk/typescript 0.1.6 2.745.2 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 0.1.7 2.745.2 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/openairesponsesinputunion.ts b/src/models/openairesponsesinputunion.ts index db403b7..8429f7a 100644 --- a/src/models/openairesponsesinputunion.ts +++ b/src/models/openairesponsesinputunion.ts @@ -195,9 +195,9 @@ export type OpenAIResponsesInputMessage1 = { export type OpenAIResponsesInputUnion1 = | OpenAIResponsesInputFunctionCallOutput | OpenAIResponsesInputFunctionCall - | OutputItemImageGenerationCall | OutputMessage | OpenAIResponsesInputMessage2 + | OutputItemImageGenerationCall | OpenAIResponsesInputMessage1; export type OpenAIResponsesInputUnion = @@ -205,9 +205,9 @@ export type OpenAIResponsesInputUnion = | Array< | OpenAIResponsesInputFunctionCallOutput | OpenAIResponsesInputFunctionCall - | OutputItemImageGenerationCall | OutputMessage | OpenAIResponsesInputMessage2 + | OutputItemImageGenerationCall | OpenAIResponsesInputMessage1 > | any; @@ -585,9 +585,9 @@ export const OpenAIResponsesInputUnion1$inboundSchema: z.ZodType< > = z.union([ z.lazy(() => OpenAIResponsesInputFunctionCallOutput$inboundSchema), z.lazy(() => OpenAIResponsesInputFunctionCall$inboundSchema), - OutputItemImageGenerationCall$inboundSchema, OutputMessage$inboundSchema, z.lazy(() => OpenAIResponsesInputMessage2$inboundSchema), + OutputItemImageGenerationCall$inboundSchema, z.lazy(() => OpenAIResponsesInputMessage1$inboundSchema), ]); @@ -610,9 +610,9 @@ export const OpenAIResponsesInputUnion$inboundSchema: z.ZodType< z.array(z.union([ z.lazy(() => OpenAIResponsesInputFunctionCallOutput$inboundSchema), z.lazy(() => OpenAIResponsesInputFunctionCall$inboundSchema), - OutputItemImageGenerationCall$inboundSchema, OutputMessage$inboundSchema, z.lazy(() => OpenAIResponsesInputMessage2$inboundSchema), + OutputItemImageGenerationCall$inboundSchema, z.lazy(() => OpenAIResponsesInputMessage1$inboundSchema), ])), z.any(), diff --git a/src/models/openresponsesinput.ts b/src/models/openresponsesinput.ts index 864c727..6c8c55e 100644 --- a/src/models/openresponsesinput.ts +++ b/src/models/openresponsesinput.ts @@ -65,9 +65,9 @@ export type OpenResponsesInput1 = | ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall - | ResponsesImageGenerationCall | OpenResponsesReasoning | ResponsesWebSearchCallOutput + | ResponsesImageGenerationCall | OpenResponsesEasyInputMessage | OpenResponsesInputMessageItem | ResponsesOutputItemReasoning; @@ -83,9 +83,9 @@ export type OpenResponsesInput = | ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall - | ResponsesImageGenerationCall | OpenResponsesReasoning | ResponsesWebSearchCallOutput + | ResponsesImageGenerationCall | OpenResponsesEasyInputMessage | OpenResponsesInputMessageItem | ResponsesOutputItemReasoning @@ -98,9 +98,9 @@ export type OpenResponsesInput1$Outbound = | ResponsesOutputMessage$Outbound | ResponsesOutputItemFunctionCall$Outbound | ResponsesOutputItemFileSearchCall$Outbound - | ResponsesImageGenerationCall$Outbound | OpenResponsesReasoning$Outbound | ResponsesWebSearchCallOutput$Outbound + | ResponsesImageGenerationCall$Outbound | OpenResponsesEasyInputMessage$Outbound | OpenResponsesInputMessageItem$Outbound | ResponsesOutputItemReasoning$Outbound; @@ -115,9 +115,9 @@ export const OpenResponsesInput1$outboundSchema: z.ZodType< ResponsesOutputMessage$outboundSchema, ResponsesOutputItemFunctionCall$outboundSchema, ResponsesOutputItemFileSearchCall$outboundSchema, - ResponsesImageGenerationCall$outboundSchema, OpenResponsesReasoning$outboundSchema, ResponsesWebSearchCallOutput$outboundSchema, + ResponsesImageGenerationCall$outboundSchema, OpenResponsesEasyInputMessage$outboundSchema, OpenResponsesInputMessageItem$outboundSchema, ResponsesOutputItemReasoning$outboundSchema, @@ -140,9 +140,9 @@ export type OpenResponsesInput$Outbound = | ResponsesOutputMessage$Outbound | ResponsesOutputItemFunctionCall$Outbound | ResponsesOutputItemFileSearchCall$Outbound - | ResponsesImageGenerationCall$Outbound | OpenResponsesReasoning$Outbound | ResponsesWebSearchCallOutput$Outbound + | ResponsesImageGenerationCall$Outbound | OpenResponsesEasyInputMessage$Outbound | OpenResponsesInputMessageItem$Outbound | ResponsesOutputItemReasoning$Outbound @@ -161,9 +161,9 @@ export const OpenResponsesInput$outboundSchema: z.ZodType< ResponsesOutputMessage$outboundSchema, ResponsesOutputItemFunctionCall$outboundSchema, ResponsesOutputItemFileSearchCall$outboundSchema, - ResponsesImageGenerationCall$outboundSchema, OpenResponsesReasoning$outboundSchema, ResponsesWebSearchCallOutput$outboundSchema, + ResponsesImageGenerationCall$outboundSchema, OpenResponsesEasyInputMessage$outboundSchema, OpenResponsesInputMessageItem$outboundSchema, ResponsesOutputItemReasoning$outboundSchema, diff --git a/src/models/operations/createauthkeyscode.ts b/src/models/operations/createauthkeyscode.ts index b0baf27..dee1cb3 100644 --- a/src/models/operations/createauthkeyscode.ts +++ b/src/models/operations/createauthkeyscode.ts @@ -40,6 +40,10 @@ export type CreateAuthKeysCodeRequest = { * Credit limit for the API key to be created */ limit?: number | undefined; + /** + * Optional expiration time for the API key to be created + */ + expiresAt?: Date | null | undefined; }; /** @@ -85,6 +89,7 @@ export type CreateAuthKeysCodeRequest$Outbound = { code_challenge?: string | undefined; code_challenge_method?: string | undefined; limit?: number | undefined; + expires_at?: string | null | undefined; }; /** @internal */ @@ -97,11 +102,13 @@ export const CreateAuthKeysCodeRequest$outboundSchema: z.ZodType< codeChallengeMethod: CreateAuthKeysCodeCodeChallengeMethod$outboundSchema .optional(), limit: z.number().optional(), + expiresAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), }).transform((v) => { return remap$(v, { callbackUrl: "callback_url", codeChallenge: "code_challenge", codeChallengeMethod: "code_challenge_method", + expiresAt: "expires_at", }); }); diff --git a/src/models/outputitemimagegenerationcall.ts b/src/models/outputitemimagegenerationcall.ts index 455dfce..d325caa 100644 --- a/src/models/outputitemimagegenerationcall.ts +++ b/src/models/outputitemimagegenerationcall.ts @@ -22,7 +22,7 @@ export type OutputItemImageGenerationCallType = ClosedEnum< export type OutputItemImageGenerationCall = { type: OutputItemImageGenerationCallType; id: string; - result: string | null; + result?: string | null | undefined; status: ImageGenerationStatus; }; @@ -38,7 +38,7 @@ export const OutputItemImageGenerationCall$inboundSchema: z.ZodType< > = z.object({ type: OutputItemImageGenerationCallType$inboundSchema, id: z.string(), - result: z.nullable(z.string()), + result: z.nullable(z.string()).default(null), status: ImageGenerationStatus$inboundSchema, }); diff --git a/src/models/responsesimagegenerationcall.ts b/src/models/responsesimagegenerationcall.ts index 1019800..d3daf41 100644 --- a/src/models/responsesimagegenerationcall.ts +++ b/src/models/responsesimagegenerationcall.ts @@ -23,7 +23,7 @@ export type ResponsesImageGenerationCallType = ClosedEnum< export type ResponsesImageGenerationCall = { type: ResponsesImageGenerationCallType; id: string; - result: string | null; + result?: string | null | undefined; status: ImageGenerationStatus; }; @@ -43,7 +43,7 @@ export const ResponsesImageGenerationCall$inboundSchema: z.ZodType< > = z.object({ type: ResponsesImageGenerationCallType$inboundSchema, id: z.string(), - result: z.nullable(z.string()), + result: z.nullable(z.string()).default(null), status: ImageGenerationStatus$inboundSchema, }); /** @internal */ @@ -61,7 +61,7 @@ export const ResponsesImageGenerationCall$outboundSchema: z.ZodType< > = z.object({ type: ResponsesImageGenerationCallType$outboundSchema, id: z.string(), - result: z.nullable(z.string()), + result: z.nullable(z.string()).default(null), status: ImageGenerationStatus$outboundSchema, }); diff --git a/src/models/responsesoutputitem.ts b/src/models/responsesoutputitem.ts index e954c2d..d711842 100644 --- a/src/models/responsesoutputitem.ts +++ b/src/models/responsesoutputitem.ts @@ -38,8 +38,8 @@ export type ResponsesOutputItem = | ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall - | ResponsesImageGenerationCall | ResponsesWebSearchCallOutput + | ResponsesImageGenerationCall | ResponsesOutputItemReasoning; /** @internal */ @@ -50,8 +50,8 @@ export const ResponsesOutputItem$inboundSchema: z.ZodType< ResponsesOutputMessage$inboundSchema, ResponsesOutputItemFunctionCall$inboundSchema, ResponsesOutputItemFileSearchCall$inboundSchema, - ResponsesImageGenerationCall$inboundSchema, ResponsesWebSearchCallOutput$inboundSchema, + ResponsesImageGenerationCall$inboundSchema, ResponsesOutputItemReasoning$inboundSchema, ]);