diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ab55ecdd8..803f7dfea 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: "" id: "" management: - docChecksum: 7355ca8d820d1af33337c0cd907c51e3 + docChecksum: a58fc69a5070955b9069a4a9a9a3272b docVersion: 1.0.0 speakeasyVersion: 1.808.1 generationVersion: 2.960.8 - releaseVersion: 1.5.168 - configChecksum: 3888ae92124fa56020ca40bfa0016cc1 + releaseVersion: 1.5.169 + configChecksum: 892c45ab56059588e786efb0c79ed16d repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true @@ -11737,9 +11737,6 @@ trackedFiles: last_write_checksum: sha1:194ac047f4416700e8103f8d2c4f88b6533392d0 pristine_git_object: a50737cfc4d272805d4f7d347eb1556a841694ac deleted: true - docs/models/reasoningformat.mdx: - id: 6fea0bfce246 - pristine_git_object: abca82a95e5375cb801d9a394ca283be957587ce docs/models/reasoningitem.md: id: 9b64e42a341c last_write_checksum: sha1:aedd52e8b127921fb38f25c4181cf8a74c02e822 @@ -17951,9 +17948,6 @@ trackedFiles: src/models/reasoningeffort.ts: id: dd747014f9d3 pristine_git_object: e9e0767ea0bbd131be060f3f8f4375309a271748 - src/models/reasoningformat.ts: - id: b523cf757168 - pristine_git_object: b08027614cf696b87e4de951a59eba49b16e7ac6 src/models/reasoningitem.ts: id: 347a000c48b1 pristine_git_object: 02743fed8539ee24a8abc97508a44f7aaa991958 @@ -24214,4 +24208,4 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Typescript SDK Changes:\n* `openrouter.guardrailPolicies.listCapacityPolicies()`: **Added**\n* `openrouter.guardrailPolicies.createCapacityPolicy()`: **Added**\n* `openrouter.guardrailPolicies.deleteCapacityPolicy()`: **Added**\n* `openrouter.guardrailPolicies.getCapacityPolicy()`: **Added**\n* `openrouter.guardrailPolicies.updateCapacityPolicy()`: **Added**\n* `openrouter.guardrailPolicies.createBudgetPolicy()`: \n * `request.createBudgetGuardrailPolicyRequest.moveExistingAssignments` **Added**\n* `openrouter.guardrailPolicies.createModelAvailabilityPolicy()`: \n * `request.createModelAvailabilityGuardrailPolicyRequest.moveExistingAssignments` **Added**\n* `openrouter.guardrailPolicies.createModerationPolicy()`: \n * `request.createModerationGuardrailPolicyRequest.moveExistingAssignments` **Added**\n" +releaseNotes: "## Typescript SDK Changes:\n* `openrouter.batch.createBatches()`: `response.results[].response.body` **Changed** (Breaking ⚠️)\n* `openrouter.batch.getBatches()`: `response.results[].response.body` **Changed** (Breaking ⚠️)\n* `openrouter.batch.cancel()`: `response.results[].response.body` **Changed** (Breaking ⚠️)\n* `openrouter.batch.getResults()`: `response.data[].response.body` **Changed** (Breaking ⚠️)\n* `openrouter.chat.send()`: \n * `request.chatRequest.messages[].union(assistant).reasoningDetails[]` **Changed** (Breaking ⚠️)\n * `response` **Changed** (Breaking ⚠️)\n* `openrouter.presets.createPresetsChatCompletions()`: \n * `request.chatRequest.messages[].union(assistant).reasoningDetails[]` **Changed** (Breaking ⚠️)\n* `openrouter.presets.createPresetsResponses()`: \n * `request.responsesRequest.input.union(Array<>)[]` **Changed** (Breaking ⚠️)\n* `openrouter.responses.send()`: \n * `request.responsesRequest.input.union(Array<>)[]` **Changed** (Breaking ⚠️)\n * `response` **Changed** (Breaking ⚠️)\n* `openrouter.beta.responses.send()`: \n * `request.responsesRequest.input.union(Array<>)[]` **Changed** (Breaking ⚠️)\n * `response` **Changed** (Breaking ⚠️)\n* `openrouter.generations.getGeneration()`: `response.data.billedDurationMs` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index a46c8c56f..753168ef8 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -38,7 +38,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.5.168 + version: 1.5.169 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index e8d32a63d..91811f0a3 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -16041,6 +16041,12 @@ components: type: - 'integer' - 'null' + billed_duration_ms: + description: 'Billed duration in milliseconds for duration-metered generations, or null if not applicable' + example: 60000 + type: + - 'integer' + - 'null' cache_discount: description: 'Discount applied due to caching' example: 0.0002 @@ -19017,6 +19023,11 @@ components: - allOf: - $ref: '#/components/schemas/OutputReasoningItem' - properties: + format: + deprecated: true + type: + - 'string' + - 'null' summary: items: $ref: '#/components/schemas/ReasoningSummaryText' @@ -19029,7 +19040,6 @@ components: content: - text: 'First, we analyze the problem...' type: 'reasoning_text' - format: 'anthropic-claude-v1' id: 'reasoning-123' signature: 'EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...' status: 'completed' @@ -30525,8 +30535,6 @@ components: type: - 'array' - 'null' - format: - $ref: '#/components/schemas/ReasoningFormat' signature: description: 'A signature for the reasoning content, used for verification' example: 'EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...' @@ -30539,7 +30547,6 @@ components: content: - text: 'First, we analyze the problem...' type: 'reasoning_text' - format: 'anthropic-claude-v1' id: 'reasoning-123' signature: 'EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...' status: 'completed' @@ -34153,7 +34160,10 @@ components: data: type: 'string' format: - $ref: '#/components/schemas/ReasoningFormat' + deprecated: true + type: + - 'string' + - 'null' id: type: - 'string' @@ -34180,7 +34190,10 @@ components: arguments: type: 'string' format: - $ref: '#/components/schemas/ReasoningFormat' + deprecated: true + type: + - 'string' + - 'null' id: type: - 'string' @@ -34212,7 +34225,10 @@ components: type: 'reasoning.summary' properties: format: - $ref: '#/components/schemas/ReasoningFormat' + deprecated: true + type: + - 'string' + - 'null' id: type: - 'string' @@ -34237,7 +34253,10 @@ components: type: 'reasoning.text' properties: format: - $ref: '#/components/schemas/ReasoningFormat' + deprecated: true + type: + - 'string' + - 'null' id: type: - 'string' @@ -34304,27 +34323,6 @@ components: - 'string' - 'null' x-speakeasy-unknown-values: allow - ReasoningFormat: - enum: - - 'unknown' - - 'openai-responses-v1' - - 'azure-openai-responses-v1' - - 'bedrock-amazon-responses-v1' - - 'bedrock-openai-responses-v1' - - 'bedrock-xai-responses-v1' - - 'xai-responses-v1' - - 'meta-responses-v1' - - 'google-vertex-meta-responses-v1' - - 'google-vertex-xai-responses-v1' - - 'openrouter-stealth-v1' - - 'anthropic-claude-v1' - - 'google-gemini-v1' - - null - example: 'unknown' - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow ReasoningItem: allOf: - $ref: '#/components/schemas/OutputItemReasoning' @@ -34336,13 +34334,16 @@ components: - 'array' - 'null' format: - $ref: '#/components/schemas/ReasoningFormat' + deprecated: true + type: + - 'string' + - 'null' signature: type: - 'string' - 'null' type: 'object' - description: 'Reasoning output item with signature and format extensions' + description: 'Reasoning output item with signature extension' example: id: 'reasoning-abc123' summary: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 03ac56677..1a047ffbb 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:97fca279a68115c19830682fe65c12baf1df5121034a5cfaa10085ece0186f74 - sourceBlobDigest: sha256:4300f7570b772fd9c001ba0e00fb319d47f59393d0f23f5e6a2ee3275713225e + sourceRevisionDigest: sha256:8bc784ff07443f5bed27fe645135e37e566d228b5bd0b9ab725a81e803e1c492 + sourceBlobDigest: sha256:8daf3684fcb85e158bb64dc7b273143aacca9358c44742de19c3ffc6ee631ba3 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:97fca279a68115c19830682fe65c12baf1df5121034a5cfaa10085ece0186f74 - sourceBlobDigest: sha256:4300f7570b772fd9c001ba0e00fb319d47f59393d0f23f5e6a2ee3275713225e + sourceRevisionDigest: sha256:8bc784ff07443f5bed27fe645135e37e566d228b5bd0b9ab725a81e803e1c492 + sourceBlobDigest: sha256:8daf3684fcb85e158bb64dc7b273143aacca9358c44742de19c3ffc6ee631ba3 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:2d1d670e873f92c814e07023105149114c1f8b98cb50eb51fa569ec1acbe902d + codeSamplesRevisionDigest: sha256:c503e747ed750f2c781c54e433e2e0e368e5fe9626c39bdc73e4cd68201753e4 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.808.1 diff --git a/RELEASES.md b/RELEASES.md index 114b31797..1ae7ee885 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -6056,4 +6056,14 @@ Based on: ### Generated - [typescript v1.5.168] . ### Releases -- [NPM v1.5.168] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.168 - . \ No newline at end of file +- [NPM v1.5.168] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.168 - . + +## 2026-12-03 17:05:37 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.808.1 (2.960.8) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.5.169] . +### Releases +- [NPM v1.5.169] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.169 - . \ No newline at end of file diff --git a/docs/models/generationresponsedata.mdx b/docs/models/generationresponsedata.mdx index 675a95d51..26043af7b 100644 --- a/docs/models/generationresponsedata.mdx +++ b/docs/models/generationresponsedata.mdx @@ -65,6 +65,7 @@ let value: GenerationResponseData = { | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `apiType` | [models.ApiType](../models/apitype.mdx) | ✔️ | Type of API used for the generation | | | `appId` | *number* | ✔️ | ID of the app that made the request | 12345 | +| `billedDurationMs` | *number* | ➖ | Billed duration in milliseconds for duration-metered generations, or null if not applicable | 60000 | | `cacheDiscount` | *number* | ✔️ | Discount applied due to caching | 0.0002 | | `cancelled` | *boolean* | ✔️ | Whether the generation was cancelled | false | | `createdAt` | *string* | ✔️ | ISO 8601 timestamp of when the generation was created | 2024-07-15T23:33:19.433273+00:00 | diff --git a/docs/models/inputsreasoning.mdx b/docs/models/inputsreasoning.mdx index b4d337a56..f7055ab3f 100644 --- a/docs/models/inputsreasoning.mdx +++ b/docs/models/inputsreasoning.mdx @@ -23,13 +23,13 @@ let value: InputsReasoning = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `content` | [models.ReasoningTextContent](../models/reasoningtextcontent.mdx)[] | ➖ | N/A | | -| `encryptedContent` | *string* | ➖ | N/A | | -| `id` | *string* | ✔️ | N/A | | -| `status` | *models.InputsStatusUnion2* | ➖ | N/A | | -| `summary` | [models.ReasoningSummaryText](../models/reasoningsummarytext.mdx)[] | ✔️ | N/A | | -| `type` | [models.InputsTypeReasoning](../models/inputstypereasoning.mdx) | ✔️ | N/A | | -| `format` | [models.ReasoningFormat](../models/reasoningformat.mdx) | ➖ | N/A | unknown | -| `signature` | *string* | ➖ | A signature for the reasoning content, used for verification | EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `content` | [models.ReasoningTextContent](../models/reasoningtextcontent.mdx)[] | ➖ | N/A | | +| `encryptedContent` | *string* | ➖ | N/A | | +| `id` | *string* | ✔️ | N/A | | +| `status` | *models.InputsStatusUnion2* | ➖ | N/A | | +| `summary` | [models.ReasoningSummaryText](../models/reasoningsummarytext.mdx)[] | ✔️ | N/A | | +| `type` | [models.InputsTypeReasoning](../models/inputstypereasoning.mdx) | ✔️ | N/A | | +| `signature` | *string* | ➖ | A signature for the reasoning content, used for verification | EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... | +| ~~`format`~~ | *string* | ➖ | ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. | | \ No newline at end of file diff --git a/docs/models/outputreasoningitem.mdx b/docs/models/outputreasoningitem.mdx index f18f462ce..1b466b6c2 100644 --- a/docs/models/outputreasoningitem.mdx +++ b/docs/models/outputreasoningitem.mdx @@ -31,5 +31,4 @@ let value: OutputReasoningItem = { | `status` | *models.OutputReasoningItemStatusUnion* | ➖ | N/A | | | `summary` | [models.ReasoningSummaryText](../models/reasoningsummarytext.mdx)[] | ✔️ | N/A | | | `type` | *"reasoning"* | ✔️ | N/A | | -| `format` | [models.ReasoningFormat](../models/reasoningformat.mdx) | ➖ | N/A | unknown | | `signature` | *string* | ➖ | A signature for the reasoning content, used for verification | EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... | \ No newline at end of file diff --git a/docs/models/reasoningdetailencrypted.mdx b/docs/models/reasoningdetailencrypted.mdx index aa05041ae..ec608ea96 100644 --- a/docs/models/reasoningdetailencrypted.mdx +++ b/docs/models/reasoningdetailencrypted.mdx @@ -17,10 +17,10 @@ let value: ReasoningDetailEncrypted = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `data` | *string* | ✔️ | N/A | | -| `format` | [models.ReasoningFormat](../models/reasoningformat.mdx) | ➖ | N/A | unknown | -| `id` | *string* | ➖ | N/A | | -| `index` | *number* | ➖ | N/A | | -| `type` | *"reasoning.encrypted"* | ✔️ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `data` | *string* | ✔️ | N/A | +| ~~`format`~~ | *string* | ➖ | ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. | +| `id` | *string* | ➖ | N/A | +| `index` | *number* | ➖ | N/A | +| `type` | *"reasoning.encrypted"* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/reasoningdetailservertoolcall.mdx b/docs/models/reasoningdetailservertoolcall.mdx index 00fe22dc2..5922ec5b4 100644 --- a/docs/models/reasoningdetailservertoolcall.mdx +++ b/docs/models/reasoningdetailservertoolcall.mdx @@ -19,13 +19,13 @@ let value: ReasoningDetailServerToolCall = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `arguments` | *string* | ✔️ | N/A | | -| `format` | [models.ReasoningFormat](../models/reasoningformat.mdx) | ➖ | N/A | unknown | -| `id` | *string* | ➖ | N/A | | -| `index` | *number* | ➖ | N/A | | -| `result` | *string* | ✔️ | N/A | | -| `toolCallId` | *string* | ➖ | N/A | | -| `toolName` | *string* | ✔️ | N/A | | -| `type` | *"reasoning.server_tool_call"* | ✔️ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `arguments` | *string* | ✔️ | N/A | +| ~~`format`~~ | *string* | ➖ | ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. | +| `id` | *string* | ➖ | N/A | +| `index` | *number* | ➖ | N/A | +| `result` | *string* | ✔️ | N/A | +| `toolCallId` | *string* | ➖ | N/A | +| `toolName` | *string* | ✔️ | N/A | +| `type` | *"reasoning.server_tool_call"* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/reasoningdetailsummary.mdx b/docs/models/reasoningdetailsummary.mdx index 9beb82554..0a16fc4f7 100644 --- a/docs/models/reasoningdetailsummary.mdx +++ b/docs/models/reasoningdetailsummary.mdx @@ -18,10 +18,10 @@ let value: ReasoningDetailSummary = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `format` | [models.ReasoningFormat](../models/reasoningformat.mdx) | ➖ | N/A | unknown | -| `id` | *string* | ➖ | N/A | | -| `index` | *number* | ➖ | N/A | | -| `summary` | *string* | ✔️ | N/A | | -| `type` | *"reasoning.summary"* | ✔️ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| ~~`format`~~ | *string* | ➖ | ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. | +| `id` | *string* | ➖ | N/A | +| `index` | *number* | ➖ | N/A | +| `summary` | *string* | ✔️ | N/A | +| `type` | *"reasoning.summary"* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/reasoningdetailtext.mdx b/docs/models/reasoningdetailtext.mdx index 48b02106f..37f1cd64f 100644 --- a/docs/models/reasoningdetailtext.mdx +++ b/docs/models/reasoningdetailtext.mdx @@ -16,11 +16,11 @@ let value: ReasoningDetailText = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `format` | [models.ReasoningFormat](../models/reasoningformat.mdx) | ➖ | N/A | unknown | -| `id` | *string* | ➖ | N/A | | -| `index` | *number* | ➖ | N/A | | -| `signature` | *string* | ➖ | N/A | | -| `text` | *string* | ➖ | N/A | | -| `type` | *"reasoning.text"* | ✔️ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| ~~`format`~~ | *string* | ➖ | ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. | +| `id` | *string* | ➖ | N/A | +| `index` | *number* | ➖ | N/A | +| `signature` | *string* | ➖ | N/A | +| `text` | *string* | ➖ | N/A | +| `type` | *"reasoning.text"* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/reasoningformat.mdx b/docs/models/reasoningformat.mdx deleted file mode 100644 index 8ab63f782..000000000 --- a/docs/models/reasoningformat.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "ReasoningFormat" ---- - -## Example Usage - -```typescript -import { ReasoningFormat } from "@openrouter/sdk/models"; - -let value: ReasoningFormat = "unknown"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"unknown" | "openai-responses-v1" | "azure-openai-responses-v1" | "bedrock-amazon-responses-v1" | "bedrock-openai-responses-v1" | "bedrock-xai-responses-v1" | "xai-responses-v1" | "meta-responses-v1" | "google-vertex-meta-responses-v1" | "google-vertex-xai-responses-v1" | "openrouter-stealth-v1" | "anthropic-claude-v1" | "google-gemini-v1" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/reasoningitem.mdx b/docs/models/reasoningitem.mdx index 24493b1f4..647d2316b 100644 --- a/docs/models/reasoningitem.mdx +++ b/docs/models/reasoningitem.mdx @@ -2,7 +2,7 @@ title: "ReasoningItem" --- -Reasoning output item with signature and format extensions +Reasoning output item with signature extension ## Example Usage @@ -23,13 +23,13 @@ let value: ReasoningItem = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `content` | [models.ReasoningTextContent](../models/reasoningtextcontent.mdx)[] | ➖ | N/A | | -| `encryptedContent` | *string* | ➖ | N/A | | -| `id` | *string* | ✔️ | N/A | | -| `status` | *models.ReasoningItemStatusUnion* | ➖ | N/A | | -| `summary` | [models.ReasoningSummaryText](../models/reasoningsummarytext.mdx)[] | ✔️ | N/A | | -| `type` | [models.ReasoningItemType](../models/reasoningitemtype.mdx) | ✔️ | N/A | | -| `format` | [models.ReasoningFormat](../models/reasoningformat.mdx) | ➖ | N/A | unknown | -| `signature` | *string* | ➖ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `content` | [models.ReasoningTextContent](../models/reasoningtextcontent.mdx)[] | ➖ | N/A | +| `encryptedContent` | *string* | ➖ | N/A | +| `id` | *string* | ✔️ | N/A | +| `status` | *models.ReasoningItemStatusUnion* | ➖ | N/A | +| `summary` | [models.ReasoningSummaryText](../models/reasoningsummarytext.mdx)[] | ✔️ | N/A | +| `type` | [models.ReasoningItemType](../models/reasoningitemtype.mdx) | ✔️ | N/A | +| ~~`format`~~ | *string* | ➖ | ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. | +| `signature` | *string* | ➖ | N/A | \ No newline at end of file diff --git a/jsr.json b/jsr.json index 2c6ec14cb..e13caaabf 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.5.168", + "version": "1.5.169", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index b74316572..6193c2069 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.5.168", + "version": "1.5.169", "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,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", - "test:transit": "exit 0", - "typecheck": "tsc --noEmit", "postinstall": "node scripts/check-types.js || true", "prepare": "npm run build", - "test:watch": "vitest --watch --project unit", - "typecheck:transit": "exit 0", - "compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js", "test": "vitest --run --project unit", - "test:e2e": "vitest --run --project e2e" + "test:e2e": "vitest --run --project e2e", + "compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js", + "test:transit": "exit 0", + "test:watch": "vitest --watch --project unit", + "typecheck": "tsc --noEmit", + "typecheck:transit": "exit 0" }, "peerDependencies": { diff --git a/src/lib/config.ts b/src/lib/config.ts index 31a1360c7..3269b296f 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.168", + sdkVersion: "1.5.169", genVersion: "2.960.8", - userAgent: "speakeasy-sdk/typescript 1.5.168 2.960.8 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.5.169 2.960.8 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/generationresponse.ts b/src/models/generationresponse.ts index 7a5c1b558..fabc0dbe8 100644 --- a/src/models/generationresponse.ts +++ b/src/models/generationresponse.ts @@ -62,6 +62,10 @@ export type GenerationResponseData = { * ID of the app that made the request */ appId: number | null; + /** + * Billed duration in milliseconds for duration-metered generations, or null if not applicable + */ + billedDurationMs?: number | null | undefined; /** * Discount applied due to caching */ @@ -263,6 +267,7 @@ export const GenerationResponseData$inboundSchema: z.ZodType< > = z.object({ api_type: z.nullable(ApiType$inboundSchema), app_id: z.nullable(z.int()), + billed_duration_ms: z.nullable(z.int()).optional(), cache_discount: z.nullable(z.number()), cancelled: z.nullable(z.boolean()), created_at: z.string(), @@ -310,6 +315,7 @@ export const GenerationResponseData$inboundSchema: z.ZodType< return remap$(v, { "api_type": "apiType", "app_id": "appId", + "billed_duration_ms": "billedDurationMs", "cache_discount": "cacheDiscount", "created_at": "createdAt", "data_region": "dataRegion", diff --git a/src/models/index.ts b/src/models/index.ts index 9a8230a38..c3b0a612b 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -802,7 +802,6 @@ export * from "./reasoningdetailtext.js"; export * from "./reasoningdetailunion.js"; export * from "./reasoningdoneevent.js"; export * from "./reasoningeffort.js"; -export * from "./reasoningformat.js"; export * from "./reasoningitem.js"; export * from "./reasoningmode.js"; export * from "./reasoningsummarypartaddedevent.js"; diff --git a/src/models/inputsunion.ts b/src/models/inputsunion.ts index 389555a8b..2e2c56524 100644 --- a/src/models/inputsunion.ts +++ b/src/models/inputsunion.ts @@ -235,10 +235,6 @@ import { OutputWebSearchServerToolItem$Outbound, OutputWebSearchServerToolItem$outboundSchema, } from "./outputwebsearchservertoolitem.js"; -import { - ReasoningFormat, - ReasoningFormat$outboundSchema, -} from "./reasoningformat.js"; import { ReasoningItem, ReasoningItem$Outbound, @@ -323,11 +319,14 @@ export type InputsReasoning = { | undefined; summary: Array | null; type: InputsTypeReasoning; - format?: ReasoningFormat | null | undefined; /** * A signature for the reasoning content, used for verification */ signature?: string | null | undefined; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + format?: string | null | undefined; }; export type InputsContent1 = ResponseOutputText | OpenAIResponsesRefusalContent; @@ -570,8 +569,8 @@ export type InputsReasoning$Outbound = { status?: string | string | string | undefined; summary: Array | null; type: string; - format?: string | null | undefined; signature?: string | null | undefined; + format?: string | null | undefined; }; /** @internal */ @@ -589,8 +588,8 @@ export const InputsReasoning$outboundSchema: z.ZodType< ]).optional(), summary: z.nullable(z.array(ReasoningSummaryText$outboundSchema)), type: InputsTypeReasoning$outboundSchema, - format: z.nullable(ReasoningFormat$outboundSchema).optional(), signature: z.nullable(z.string()).optional(), + format: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { encryptedContent: "encrypted_content", diff --git a/src/models/outputreasoningitem.ts b/src/models/outputreasoningitem.ts index ee5241970..e1d513852 100644 --- a/src/models/outputreasoningitem.ts +++ b/src/models/outputreasoningitem.ts @@ -8,10 +8,6 @@ import { safeParse } from "../lib/schemas.js"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - ReasoningFormat, - ReasoningFormat$inboundSchema, -} from "./reasoningformat.js"; import { ReasoningSummaryText, ReasoningSummaryText$inboundSchema, @@ -61,7 +57,6 @@ export type OutputReasoningItem = { | undefined; summary: Array; type: "reasoning"; - format?: ReasoningFormat | null | undefined; /** * A signature for the reasoning content, used for verification */ @@ -118,7 +113,6 @@ export const OutputReasoningItem$inboundSchema: z.ZodType< ]).optional(), summary: z.array(ReasoningSummaryText$inboundSchema), type: z.literal("reasoning"), - format: z.nullable(ReasoningFormat$inboundSchema).optional(), signature: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/reasoningdetailencrypted.ts b/src/models/reasoningdetailencrypted.ts index 09abe2166..2b90565d6 100644 --- a/src/models/reasoningdetailencrypted.ts +++ b/src/models/reasoningdetailencrypted.ts @@ -6,18 +6,16 @@ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - ReasoningFormat, - ReasoningFormat$inboundSchema, - ReasoningFormat$outboundSchema, -} from "./reasoningformat.js"; /** * Reasoning detail encrypted schema */ export type ReasoningDetailEncrypted = { data: string; - format?: ReasoningFormat | null | undefined; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + format?: string | null | undefined; id?: string | null | undefined; index?: number | undefined; type: "reasoning.encrypted"; @@ -29,7 +27,7 @@ export const ReasoningDetailEncrypted$inboundSchema: z.ZodType< unknown > = z.object({ data: z.string(), - format: z.nullable(ReasoningFormat$inboundSchema).optional(), + format: z.nullable(z.string()).optional(), id: z.nullable(z.string()).optional(), index: z.int().optional(), type: z.literal("reasoning.encrypted"), @@ -49,7 +47,7 @@ export const ReasoningDetailEncrypted$outboundSchema: z.ZodType< ReasoningDetailEncrypted > = z.object({ data: z.string(), - format: z.nullable(ReasoningFormat$outboundSchema).optional(), + format: z.nullable(z.string()).optional(), id: z.nullable(z.string()).optional(), index: z.int().optional(), type: z.literal("reasoning.encrypted"), diff --git a/src/models/reasoningdetailservertoolcall.ts b/src/models/reasoningdetailservertoolcall.ts index d4b1e56d1..9e1e9c52e 100644 --- a/src/models/reasoningdetailservertoolcall.ts +++ b/src/models/reasoningdetailservertoolcall.ts @@ -7,18 +7,16 @@ import { remap as remap$ } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - ReasoningFormat, - ReasoningFormat$inboundSchema, - ReasoningFormat$outboundSchema, -} from "./reasoningformat.js"; /** * Record of an OpenRouter server-tool invocation (e.g. openrouter:fusion), carried in reasoning_details so a prior tool call can be rehydrated into a later turn of the same conversation. */ export type ReasoningDetailServerToolCall = { arguments: string; - format?: ReasoningFormat | null | undefined; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + format?: string | null | undefined; id?: string | null | undefined; index?: number | undefined; result: string; @@ -33,7 +31,7 @@ export const ReasoningDetailServerToolCall$inboundSchema: z.ZodType< unknown > = z.object({ arguments: z.string(), - format: z.nullable(ReasoningFormat$inboundSchema).optional(), + format: z.nullable(z.string()).optional(), id: z.nullable(z.string()).optional(), index: z.int().optional(), result: z.string(), @@ -64,7 +62,7 @@ export const ReasoningDetailServerToolCall$outboundSchema: z.ZodType< ReasoningDetailServerToolCall > = z.object({ arguments: z.string(), - format: z.nullable(ReasoningFormat$outboundSchema).optional(), + format: z.nullable(z.string()).optional(), id: z.nullable(z.string()).optional(), index: z.int().optional(), result: z.string(), diff --git a/src/models/reasoningdetailsummary.ts b/src/models/reasoningdetailsummary.ts index 8260ed0a2..11947789b 100644 --- a/src/models/reasoningdetailsummary.ts +++ b/src/models/reasoningdetailsummary.ts @@ -6,17 +6,15 @@ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - ReasoningFormat, - ReasoningFormat$inboundSchema, - ReasoningFormat$outboundSchema, -} from "./reasoningformat.js"; /** * Reasoning detail summary schema */ export type ReasoningDetailSummary = { - format?: ReasoningFormat | null | undefined; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + format?: string | null | undefined; id?: string | null | undefined; index?: number | undefined; summary: string; @@ -28,7 +26,7 @@ export const ReasoningDetailSummary$inboundSchema: z.ZodType< ReasoningDetailSummary, unknown > = z.object({ - format: z.nullable(ReasoningFormat$inboundSchema).optional(), + format: z.nullable(z.string()).optional(), id: z.nullable(z.string()).optional(), index: z.int().optional(), summary: z.string(), @@ -48,7 +46,7 @@ export const ReasoningDetailSummary$outboundSchema: z.ZodType< ReasoningDetailSummary$Outbound, ReasoningDetailSummary > = z.object({ - format: z.nullable(ReasoningFormat$outboundSchema).optional(), + format: z.nullable(z.string()).optional(), id: z.nullable(z.string()).optional(), index: z.int().optional(), summary: z.string(), diff --git a/src/models/reasoningdetailtext.ts b/src/models/reasoningdetailtext.ts index d5e58814c..eb2d83a2e 100644 --- a/src/models/reasoningdetailtext.ts +++ b/src/models/reasoningdetailtext.ts @@ -6,17 +6,15 @@ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - ReasoningFormat, - ReasoningFormat$inboundSchema, - ReasoningFormat$outboundSchema, -} from "./reasoningformat.js"; /** * Reasoning detail text schema */ export type ReasoningDetailText = { - format?: ReasoningFormat | null | undefined; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + format?: string | null | undefined; id?: string | null | undefined; index?: number | undefined; signature?: string | null | undefined; @@ -29,7 +27,7 @@ export const ReasoningDetailText$inboundSchema: z.ZodType< ReasoningDetailText, unknown > = z.object({ - format: z.nullable(ReasoningFormat$inboundSchema).optional(), + format: z.nullable(z.string()).optional(), id: z.nullable(z.string()).optional(), index: z.int().optional(), signature: z.nullable(z.string()).optional(), @@ -51,7 +49,7 @@ export const ReasoningDetailText$outboundSchema: z.ZodType< ReasoningDetailText$Outbound, ReasoningDetailText > = z.object({ - format: z.nullable(ReasoningFormat$outboundSchema).optional(), + format: z.nullable(z.string()).optional(), id: z.nullable(z.string()).optional(), index: z.int().optional(), signature: z.nullable(z.string()).optional(), diff --git a/src/models/reasoningformat.ts b/src/models/reasoningformat.ts deleted file mode 100644 index 1226294c8..000000000 --- a/src/models/reasoningformat.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v4"; -import * as openEnums from "../types/enums.js"; -import { OpenEnum } from "../types/enums.js"; - -export const ReasoningFormat = { - Unknown: "unknown", - OpenaiResponsesV1: "openai-responses-v1", - AzureOpenaiResponsesV1: "azure-openai-responses-v1", - BedrockAmazonResponsesV1: "bedrock-amazon-responses-v1", - BedrockOpenaiResponsesV1: "bedrock-openai-responses-v1", - BedrockXaiResponsesV1: "bedrock-xai-responses-v1", - XaiResponsesV1: "xai-responses-v1", - MetaResponsesV1: "meta-responses-v1", - GoogleVertexMetaResponsesV1: "google-vertex-meta-responses-v1", - GoogleVertexXaiResponsesV1: "google-vertex-xai-responses-v1", - OpenrouterStealthV1: "openrouter-stealth-v1", - AnthropicClaudeV1: "anthropic-claude-v1", - GoogleGeminiV1: "google-gemini-v1", -} as const; -export type ReasoningFormat = OpenEnum; - -/** @internal */ -export const ReasoningFormat$inboundSchema: z.ZodType< - ReasoningFormat, - unknown -> = openEnums.inboundSchema(ReasoningFormat); -/** @internal */ -export const ReasoningFormat$outboundSchema: z.ZodType< - string, - ReasoningFormat -> = openEnums.outboundSchema(ReasoningFormat); diff --git a/src/models/reasoningitem.ts b/src/models/reasoningitem.ts index 4645e9ca4..012780670 100644 --- a/src/models/reasoningitem.ts +++ b/src/models/reasoningitem.ts @@ -5,10 +5,6 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; import { ClosedEnum } from "../types/enums.js"; -import { - ReasoningFormat, - ReasoningFormat$outboundSchema, -} from "./reasoningformat.js"; import { ReasoningSummaryText, ReasoningSummaryText$Outbound, @@ -52,7 +48,7 @@ export const ReasoningItemType = { export type ReasoningItemType = ClosedEnum; /** - * Reasoning output item with signature and format extensions + * Reasoning output item with signature extension */ export type ReasoningItem = { content?: Array | null | undefined; @@ -65,7 +61,10 @@ export type ReasoningItem = { | undefined; summary: Array; type: ReasoningItemType; - format?: ReasoningFormat | null | undefined; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + format?: string | null | undefined; signature?: string | null | undefined; }; @@ -137,7 +136,7 @@ export const ReasoningItem$outboundSchema: z.ZodType< ]).optional(), summary: z.array(ReasoningSummaryText$outboundSchema), type: ReasoningItemType$outboundSchema, - format: z.nullable(ReasoningFormat$outboundSchema).optional(), + format: z.nullable(z.string()).optional(), signature: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, {