diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 0127c9ee7..c7d9eec6f 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: "" id: "" management: - docChecksum: 2ded202d075718cdd225633db3044dd1 + docChecksum: 231fd31ac08cec83975c629190460e1f docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.2.125 - configChecksum: e3ff9caf20eabc591671996315b1a1cf + releaseVersion: 1.2.126 + configChecksum: a8e9a24a642216ef0541c0678489819b repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: e5512b21-c5f1-4497-a8ed-2fa85fb20b7a - pristine_commit_hash: 5ef51972fe922d127e4c472dd6798f28da1abb08 - pristine_tree_hash: 70f2d17abb8fcbbe238f51cd942b2caedbf91674 + generation_id: 74327ef4-6ff6-4d19-a3af-5739fe2492ba + pristine_commit_hash: b697810b6a2a125e7f0b4c0a35492afda9a952c6 + pristine_tree_hash: 35df548c0746fec46230926281da02b4ed0def4d features: typescript: acceptHeaders: 2.81.2 @@ -4599,8 +4599,8 @@ trackedFiles: deleted: true docs/models/imagegenerationrequest.mdx: id: 356fa63d53c6 - last_write_checksum: sha1:537e9c1d304349db532c8ee7ee1c65d50e3db78c - pristine_git_object: cd89dfc4b9562eede5b8be6bba30afbfce3ce9ad + last_write_checksum: sha1:b526a58fe4e185469039b80138ffb36158a831cb + pristine_git_object: cb72aecdd001ae40913c8d4bf017a51ac71aa2b2 docs/models/imagegenerationrequestaspectratio.md: id: 9a249a62b3ea last_write_checksum: sha1:b20eefb2c7a5306ab85fb25aca5878107c4c4b57 @@ -7242,8 +7242,8 @@ trackedFiles: pristine_git_object: 57829559d184a732ad2c8e1ee6a72bab4ef86f23 docs/models/operations/createembeddingsrequestbody.mdx: id: 7cd415289092 - last_write_checksum: sha1:2ce3ef0003e814d57f34e48246a5eb8db0733f45 - pristine_git_object: a1f0c15f2ea683b8d1fab0d0ea928917b74e438d + last_write_checksum: sha1:93d34158f9d954ceb0f623f87dd9d955daa2e1b7 + pristine_git_object: 3bc93b1d3e31d800ef4104edc1972f5a7dbdede2 docs/models/operations/createembeddingsresponse.mdx: id: 3ec9a191e3ed last_write_checksum: sha1:dd3e874a1139947a2c99d1d93865a2c6964fa8a9 @@ -7425,8 +7425,8 @@ trackedFiles: deleted: true docs/models/operations/creatererankrequestbody.mdx: id: 860a148843a9 - last_write_checksum: sha1:3f5b8a3969b6f931c0e188cd20570f3acf1689c1 - pristine_git_object: 6069bfca40b6c0aa7c82738dc32055dc8ffa8800 + last_write_checksum: sha1:f53c6cf246c86cc54bb8441cbe8eef6a125f090e + pristine_git_object: 6165424d032eb3600d6a26907b700e53a3fcdcc9 docs/models/operations/creatererankresponse.md: id: 4ef868bdb264 last_write_checksum: sha1:6b2661a6676d3014c5bf3446b54f5427de03ea20 @@ -11511,8 +11511,8 @@ trackedFiles: deleted: true docs/models/speechrequest.mdx: id: c9e3c03ff84e - last_write_checksum: sha1:1e634e4b83c21b0c773972f98b8cadd41bbd0b39 - pristine_git_object: 0da40cae37f01c5e626c29c9b29eb66d02f20af5 + last_write_checksum: sha1:32f5d278040b4d0c271d63d9178b844dd3cd0bc8 + pristine_git_object: 61a9769088b03e50f4ce0616dda09789bc42a1a9 docs/models/speechrequestoptions.md: id: 2d3d36e99ad0 last_write_checksum: sha1:a5810a37b774c3e34bb1d943b64620bc31de2278 @@ -11723,8 +11723,8 @@ trackedFiles: deleted: true docs/models/sttrequest.mdx: id: 3db98eb65064 - last_write_checksum: sha1:065b42557cadbf57c8816665bb4a223f4fece16c - pristine_git_object: d368970784e1633176e149b56f7da5c470e30047 + last_write_checksum: sha1:29518db4e6d6ce74fb2dd644711c3cd8b4bf2b69 + pristine_git_object: b5b6e6ed12d553dca096d187e6d3786ab1517d22 docs/models/sttrequestprovider.md: id: 6c1330c9d45f last_write_checksum: sha1:6f6b7c1c0fb5efbb016f5e6a4bc34b4086e4a903 @@ -12738,8 +12738,8 @@ trackedFiles: deleted: true docs/models/videogenerationrequest.mdx: id: d611129166e2 - last_write_checksum: sha1:e0963a51a40978b1db2e7dc6c042dab5d5bf6e17 - pristine_git_object: b915fc474bc447873604ff419288cde99ddab769 + last_write_checksum: sha1:85887426436044eae8605f03249fa57a597c164a + pristine_git_object: 8f29ecf35d36c15d9a88af413feaa3cee83f787a docs/models/videogenerationrequestaspectratio.md: id: 2ecaa5a363b2 last_write_checksum: sha1:434fd315824c2f5c2faa62de0d95ecfdd04fda9a @@ -13321,12 +13321,12 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:3fb5558059d0cf630ee194dc93e997a7870308ad - pristine_git_object: 04b8d08e14856636f34508e392d52eeb2839d8db + last_write_checksum: sha1:36011125bbcc142b31b8e640430cbf7ddc63370f + pristine_git_object: 096f9da083f4629bc9dfa05423f0222a99c6639a package.json: id: 7030d0b2f71b - last_write_checksum: sha1:847ac74d1337a5c7604ad958140bc16116798a72 - pristine_git_object: 77b8dfe521b753152587775ca8b2a41c00c06368 + last_write_checksum: sha1:7ada6a86e08240848de29810eb026cb84e55e332 + pristine_git_object: d45a7ef1df15c3fba61e053b90fbfb476827e6ba src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 @@ -13769,8 +13769,8 @@ trackedFiles: pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:4dc6bca794dcde03ae1ef1d200ae5f61165d8203 - pristine_git_object: d7c4f930d945d907a8754580977128b1c751a39e + last_write_checksum: sha1:eda7c1267971b9759ecbc2173bc68d4df9eb72ba + pristine_git_object: 59af05394c918306f5386a2f620564df5fb359e0 src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -15023,8 +15023,8 @@ trackedFiles: pristine_git_object: c416b1c7c621e7d523b4f5eabea3ccba2ed62d82 src/models/imagegenerationrequest.ts: id: ea1ffc0d2470 - last_write_checksum: sha1:fec3d3cf74225e6d8a295b66cf4ed71cafdbeea3 - pristine_git_object: 95ba4ac721d456eb2a1a1aa29bbe2ead7a7c9bb0 + last_write_checksum: sha1:b905f33ff5c26ba4af8bbd2e05893ad142ac9904 + pristine_git_object: ed641c8063437694ce057b371e613e86fe6d803a src/models/imagegenerationresponse.ts: id: 18aeba0f13cc last_write_checksum: sha1:4cd19da234bbdae4d406bd1cbc9629bd2e15f2a5 @@ -15603,8 +15603,8 @@ trackedFiles: pristine_git_object: 536c37a011550df4f81508b09ac6790233bf92c6 src/models/operations/createembeddings.ts: id: 7c210337fdff - last_write_checksum: sha1:745a439fec6f3c4f38e951abf9cec597fe18cd28 - pristine_git_object: a393d10569c853f7368401f180a189905ac95968 + last_write_checksum: sha1:2eb8509d1af49e96fff194c4dc7c68ceac1a48b3 + pristine_git_object: 788658717ae8280be1f58136562cff7f6a91a8cd src/models/operations/createguardrail.ts: id: 36e5a2696dfd last_write_checksum: sha1:4c668c93e119266cfdc1c46da678151673696fdf @@ -15639,8 +15639,8 @@ trackedFiles: pristine_git_object: f9b360bb3d14c0200ed02833f77c61ef5f525690 src/models/operations/creatererank.ts: id: e1de55b94363 - last_write_checksum: sha1:eddcbe1dfdd56dc1c2b6e00babb6cc244e2e7905 - pristine_git_object: 34a087aa502dbda91947b6578f67c807fb1fc69b + last_write_checksum: sha1:c2b38bceb8389100a03d2c994c893330ad5a5a2c + pristine_git_object: f111086c1b137c639878a4384bfba07a8d3e000b src/models/operations/createresponses.ts: id: 7ad611b27e9d last_write_checksum: sha1:125b46a7a9f280d03bdc01c3a2e771342ef3ab47 @@ -16515,8 +16515,8 @@ trackedFiles: pristine_git_object: dd8e518866345a2b921986bff08878e424f3c69f src/models/speechrequest.ts: id: 96d573d68420 - last_write_checksum: sha1:e3ac505abd779cb06b83b76ccc96d0ec6f2254e7 - pristine_git_object: 76edcf3a01015688701f234816bf21fdedb2016b + last_write_checksum: sha1:81811ec1b80f198a94deac9acfe141e7c2e2c574 + pristine_git_object: 4500795a2efa1db54262a47191a36db8c561d193 src/models/stopservertoolswhencondition.ts: id: 3c90e3993bad last_write_checksum: sha1:b95847e6581593c6f1106971d0508acb2cce1106 @@ -16583,8 +16583,8 @@ trackedFiles: pristine_git_object: 48c884de16729adba8d45fb09a6e3fd292925570 src/models/sttrequest.ts: id: 3be8453c0517 - last_write_checksum: sha1:26794bd4a9819376916d2851c43f1028cfb3a6a0 - pristine_git_object: 81f755c0b83b240ece51b267f98052d2d15be9bf + last_write_checksum: sha1:351ac5698ca38362fee19dd6731089f076139020 + pristine_git_object: d19862532f0eaed9daf378b9155b1a8f6c83b11f src/models/sttresponse.ts: id: 383a6e21047b last_write_checksum: sha1:caf1496912c71478147c631a755b6c01c94ff434 @@ -16795,8 +16795,8 @@ trackedFiles: pristine_git_object: 43658c2bafcbeba1e20a00c131167f8bef08d03c src/models/videogenerationrequest.ts: id: e72ea2e4c5b3 - last_write_checksum: sha1:cd9f959ba32d35c4743b63e805cfd9bf737eee0a - pristine_git_object: e2a31689b3af0ca64586497ef2ea9846a516e6a7 + last_write_checksum: sha1:57ade909fcb069b607a63eba09f62d9388cb7d46 + pristine_git_object: 2d1715863eeabbc5e0d6f1379018fdf40eafef54 src/models/videogenerationresponse.ts: id: 0a96c6ee9eea last_write_checksum: sha1:73c631114adc4f4076585919439c06126aa6d55f @@ -19036,4 +19036,4 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Typescript SDK Changes:\n* `openrouter.tts.createSpeech()`: \n * `request.speechRequest.user` **Added**\n* `openrouter.stt.createTranscription()`: \n * `request.sttRequest.user` **Added**\n* `openrouter.rerank.rerank()`: \n * `request.requestBody.user` **Added**\n* `openrouter.videoGeneration.generate()`: \n * `request.videoGenerationRequest.user` **Added**\n" +releaseNotes: "## Typescript SDK Changes:\n* `openrouter.tts.createSpeech()`: \n * `request.speechRequest.trace` **Added**\n* `openrouter.stt.createTranscription()`: \n * `request.sttRequest.trace` **Added**\n* `openrouter.embeddings.generate()`: \n * `request.requestBody.trace` **Added**\n* `openrouter.images.generate()`: \n * `request.imageGenerationRequest.trace` **Added**\n* `openrouter.rerank.rerank()`: \n * `request.requestBody.trace` **Added**\n* `openrouter.videoGeneration.generate()`: \n * `request.videoGenerationRequest.trace` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index fa8cf19bb..4eb477fbe 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.2.125 + version: 1.2.126 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 7cb60a4f5..71b50de2e 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -10983,6 +10983,8 @@ components: stream: description: 'If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response.' type: 'boolean' + trace: + $ref: '#/components/schemas/TraceConfig' user: description: 'A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier.' example: 'end-user-abc123' @@ -24624,6 +24626,8 @@ components: example: 1 format: 'double' type: 'number' + trace: + $ref: '#/components/schemas/TraceConfig' user: description: 'A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.' example: 'user-1234' @@ -25130,6 +25134,8 @@ components: items: $ref: '#/components/schemas/STTTimestampGranularity' type: 'array' + trace: + $ref: '#/components/schemas/TraceConfig' user: description: 'A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.' example: 'user-1234' @@ -27282,6 +27288,8 @@ components: description: 'Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio.' example: '1280x720' type: 'string' + trace: + $ref: '#/components/schemas/TraceConfig' upscale_factor: description: 'Upscale factor for video upscaling models only. This parameter is not supported by video generation models.' example: 2 @@ -31778,6 +31786,8 @@ paths: allOf: - $ref: '#/components/schemas/ProviderPreferences' - description: 'Provider routing preferences for the request.' + trace: + $ref: '#/components/schemas/TraceConfig' user: description: 'A unique identifier for the end-user' example: 'user-1234' @@ -39544,6 +39554,8 @@ paths: example: 3 minimum: 1 type: 'integer' + trace: + $ref: '#/components/schemas/TraceConfig' user: description: 'A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.' example: 'user-1234' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 17f323518..d45f06d9b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:94119218e826d65f718b70995cbb3ce16b4ac41f2cd5f9843566ef724040c103 - sourceBlobDigest: sha256:b24149bc343f8c0305a7172eb4e603613c945802e7727bad0cd48bbda48d6f5b + sourceRevisionDigest: sha256:39fdbc02aef107063793d07e96cda228581cbb023e5873af5f45469cfa47d621 + sourceBlobDigest: sha256:7a9ef60e3865abb0f09b6203e9661aea71134300b4610f2d84c54f87be1f1286 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:94119218e826d65f718b70995cbb3ce16b4ac41f2cd5f9843566ef724040c103 - sourceBlobDigest: sha256:b24149bc343f8c0305a7172eb4e603613c945802e7727bad0cd48bbda48d6f5b + sourceRevisionDigest: sha256:39fdbc02aef107063793d07e96cda228581cbb023e5873af5f45469cfa47d621 + sourceBlobDigest: sha256:7a9ef60e3865abb0f09b6203e9661aea71134300b4610f2d84c54f87be1f1286 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:88861adf699f07669b5486a4259dca38b02fd117f084fd2f3385e9041d42200b + codeSamplesRevisionDigest: sha256:3fa8601ab0edb0828f56773755add105cb7d101bcd9eb1586fc4dfcde70d980c workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index d7b61813d..b9b5a1813 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3546,4 +3546,14 @@ Based on: ### Generated - [typescript v1.2.125] . ### Releases -- [NPM v1.2.125] https://www.npmjs.com/package/@openrouter/sdk/v/1.2.125 - . \ No newline at end of file +- [NPM v1.2.125] https://www.npmjs.com/package/@openrouter/sdk/v/1.2.125 - . + +## 2026-09-15 21:51:10 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.2.126] . +### Releases +- [NPM v1.2.126] https://www.npmjs.com/package/@openrouter/sdk/v/1.2.126 - . \ No newline at end of file diff --git a/docs/models/imagegenerationrequest.mdx b/docs/models/imagegenerationrequest.mdx index cd89dfc4b..cb72aecdd 100644 --- a/docs/models/imagegenerationrequest.mdx +++ b/docs/models/imagegenerationrequest.mdx @@ -33,4 +33,5 @@ let value: ImageGenerationRequest = { | `seed` | *number* | :heavy_minus_sign: | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | | `size` | *string* | :heavy_minus_sign: | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. | 2K | | `stream` | *boolean* | :heavy_minus_sign: | If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. | | +| `trace` | [models.TraceConfig](../models/traceconfig.mdx) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | | `user` | *string* | :heavy_minus_sign: | A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. | end-user-abc123 | \ No newline at end of file diff --git a/docs/models/operations/createembeddingsrequestbody.mdx b/docs/models/operations/createembeddingsrequestbody.mdx index a1f0c15f2..3bc93b1d3 100644 --- a/docs/models/operations/createembeddingsrequestbody.mdx +++ b/docs/models/operations/createembeddingsrequestbody.mdx @@ -17,12 +17,13 @@ let value: CreateEmbeddingsRequestBody = { ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `dimensions` | *number* | :heavy_minus_sign: | The number of dimensions for the output embeddings | 1536 | -| `encodingFormat` | [operations.EncodingFormat](../../models/operations/encodingformat.mdx) | :heavy_minus_sign: | The format of the output embeddings | float | -| `input` | *operations.InputUnion* | :heavy_check_mark: | Text, token, or multimodal input(s) to embed | The quick brown fox jumps over the lazy dog | -| `inputType` | *string* | :heavy_minus_sign: | The type of input (e.g. search_query, search_document) | search_query | -| `model` | *string* | :heavy_check_mark: | The model to use for embeddings | openai/text-embedding-3-small | -| `provider` | [models.ProviderPreferences](../../models/providerpreferences.mdx) | :heavy_minus_sign: | N/A | \{
"allow_fallbacks": true
} | -| `user` | *string* | :heavy_minus_sign: | A unique identifier for the end-user | user-1234 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dimensions` | *number* | :heavy_minus_sign: | The number of dimensions for the output embeddings | 1536 | +| `encodingFormat` | [operations.EncodingFormat](../../models/operations/encodingformat.mdx) | :heavy_minus_sign: | The format of the output embeddings | float | +| `input` | *operations.InputUnion* | :heavy_check_mark: | Text, token, or multimodal input(s) to embed | The quick brown fox jumps over the lazy dog | +| `inputType` | *string* | :heavy_minus_sign: | The type of input (e.g. search_query, search_document) | search_query | +| `model` | *string* | :heavy_check_mark: | The model to use for embeddings | openai/text-embedding-3-small | +| `provider` | [models.ProviderPreferences](../../models/providerpreferences.mdx) | :heavy_minus_sign: | N/A | \{
"allow_fallbacks": true
} | +| `trace` | [models.TraceConfig](../../models/traceconfig.mdx) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | +| `user` | *string* | :heavy_minus_sign: | A unique identifier for the end-user | user-1234 | \ No newline at end of file diff --git a/docs/models/operations/creatererankrequestbody.mdx b/docs/models/operations/creatererankrequestbody.mdx index 6069bfca4..6165424d0 100644 --- a/docs/models/operations/creatererankrequestbody.mdx +++ b/docs/models/operations/creatererankrequestbody.mdx @@ -21,11 +21,12 @@ let value: CreateRerankRequestBody = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `documents` | *operations.Document*[] | :heavy_check_mark: | The list of documents to rerank. Documents may be plain strings, or structured objects with `text` and/or `image` for multimodal models. | [
"Paris is the capital of France.",
"Berlin is the capital of Germany."
] | -| `model` | *string* | :heavy_check_mark: | The rerank model to use | cohere/rerank-v3.5 | -| `provider` | [models.ProviderPreferences](../../models/providerpreferences.mdx) | :heavy_minus_sign: | N/A | \{
"allow_fallbacks": true
} | -| `query` | *string* | :heavy_check_mark: | The search query to rerank documents against | What is the capital of France? | -| `topN` | *number* | :heavy_minus_sign: | Number of most relevant documents to return | 3 | -| `user` | *string* | :heavy_minus_sign: | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | user-1234 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `documents` | *operations.Document*[] | :heavy_check_mark: | The list of documents to rerank. Documents may be plain strings, or structured objects with `text` and/or `image` for multimodal models. | [
"Paris is the capital of France.",
"Berlin is the capital of Germany."
] | +| `model` | *string* | :heavy_check_mark: | The rerank model to use | cohere/rerank-v3.5 | +| `provider` | [models.ProviderPreferences](../../models/providerpreferences.mdx) | :heavy_minus_sign: | N/A | \{
"allow_fallbacks": true
} | +| `query` | *string* | :heavy_check_mark: | The search query to rerank documents against | What is the capital of France? | +| `topN` | *number* | :heavy_minus_sign: | Number of most relevant documents to return | 3 | +| `trace` | [models.TraceConfig](../../models/traceconfig.mdx) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | +| `user` | *string* | :heavy_minus_sign: | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | user-1234 | \ No newline at end of file diff --git a/docs/models/speechrequest.mdx b/docs/models/speechrequest.mdx index 0da40cae3..61a976908 100644 --- a/docs/models/speechrequest.mdx +++ b/docs/models/speechrequest.mdx @@ -17,13 +17,14 @@ let value: SpeechRequest = { ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | *string* | :heavy_check_mark: | Text to synthesize | Hello world | -| `inputReferences` | *models.SpeechInputReference*[] | :heavy_minus_sign: | Reference content for stateless voice cloning: one `input_audio` part carrying the voice sample, optionally accompanied by one `text` part with its transcript. Only routed to endpoints that support voice cloning. | [
\{
"input_audio": \{
"data": "data:audio/wav;base64,UklGRuQXDABXQVZF..."
},
"type": "input_audio"
},
\{
"text": "I used to rule the world.",
"type": "text"
}
] | -| `model` | *string* | :heavy_check_mark: | TTS model identifier | mistralai/voxtral-mini-tts-2603 | -| `provider` | [models.SpeechRequestProvider](../models/speechrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | -| `responseFormat` | [models.SpeechRequestResponseFormat](../models/speechrequestresponseformat.mdx) | :heavy_minus_sign: | Audio output format | pcm | -| `speed` | *number* | :heavy_minus_sign: | Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers. | 1 | -| `user` | *string* | :heavy_minus_sign: | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | user-1234 | -| `voice` | *string* | :heavy_minus_sign: | Voice identifier (provider-specific). | en_paul_neutral | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | *string* | :heavy_check_mark: | Text to synthesize | Hello world | +| `inputReferences` | *models.SpeechInputReference*[] | :heavy_minus_sign: | Reference content for stateless voice cloning: one `input_audio` part carrying the voice sample, optionally accompanied by one `text` part with its transcript. Only routed to endpoints that support voice cloning. | [
\{
"input_audio": \{
"data": "data:audio/wav;base64,UklGRuQXDABXQVZF..."
},
"type": "input_audio"
},
\{
"text": "I used to rule the world.",
"type": "text"
}
] | +| `model` | *string* | :heavy_check_mark: | TTS model identifier | mistralai/voxtral-mini-tts-2603 | +| `provider` | [models.SpeechRequestProvider](../models/speechrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | +| `responseFormat` | [models.SpeechRequestResponseFormat](../models/speechrequestresponseformat.mdx) | :heavy_minus_sign: | Audio output format | pcm | +| `speed` | *number* | :heavy_minus_sign: | Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers. | 1 | +| `trace` | [models.TraceConfig](../models/traceconfig.mdx) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | +| `user` | *string* | :heavy_minus_sign: | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | user-1234 | +| `voice` | *string* | :heavy_minus_sign: | Voice identifier (provider-specific). | en_paul_neutral | \ No newline at end of file diff --git a/docs/models/sttrequest.mdx b/docs/models/sttrequest.mdx index d36897078..b5b6e6ed1 100644 --- a/docs/models/sttrequest.mdx +++ b/docs/models/sttrequest.mdx @@ -29,4 +29,5 @@ let value: STTRequest = { | `responseFormat` | [models.STTRequestResponseFormat](../models/sttrequestresponseformat.mdx) | :heavy_minus_sign: | Output format. "json" (default) returns \{ text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. | json | | `temperature` | *number* | :heavy_minus_sign: | Sampling temperature for transcription | 0 | | `timestampGranularities` | [models.STTTimestampGranularity](../models/stttimestampgranularity.mdx)[] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json". | [
"segment"
] | +| `trace` | [models.TraceConfig](../models/traceconfig.mdx) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | | `user` | *string* | :heavy_minus_sign: | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | user-1234 | \ No newline at end of file diff --git a/docs/models/videogenerationrequest.mdx b/docs/models/videogenerationrequest.mdx index b915fc474..8f29ecf35 100644 --- a/docs/models/videogenerationrequest.mdx +++ b/docs/models/videogenerationrequest.mdx @@ -29,5 +29,6 @@ let value: VideoGenerationRequest = { | `resolution` | [models.VideoGenerationRequestResolution](../models/videogenerationrequestresolution.mdx) | :heavy_minus_sign: | Resolution of the generated video | 720p | | `seed` | *number* | :heavy_minus_sign: | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | | `size` | *string* | :heavy_minus_sign: | Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio. | 1280x720 | +| `trace` | [models.TraceConfig](../models/traceconfig.mdx) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | | `upscaleFactor` | *number* | :heavy_minus_sign: | Upscale factor for video upscaling models only. This parameter is not supported by video generation models. | 2 | | `user` | *string* | :heavy_minus_sign: | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | user-1234 | \ No newline at end of file diff --git a/jsr.json b/jsr.json index 04b8d08e1..096f9da08 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.2.125", + "version": "1.2.126", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index ee5e00094..1248bf251 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.2.125", + "version": "1.2.126", "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,13 +73,13 @@ "lint": "eslint --cache --max-warnings=0 src", "build": "tsc", "prepublishOnly": "npm run build", - "compile": "tsc", - "postinstall": "node scripts/check-types.js || true", "prepare": "npm run build", + "test": "vitest --run --project unit", "test:e2e": "vitest --run --project e2e", - "test:transit": "exit 0", "typecheck": "tsc --noEmit", - "test": "vitest --run --project unit", + "compile": "tsc", + "postinstall": "node scripts/check-types.js || true", + "test:transit": "exit 0", "test:watch": "vitest --watch --project unit", "typecheck:transit": "exit 0" }, diff --git a/src/lib/config.ts b/src/lib/config.ts index be438da62..176cf518d 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -79,7 +79,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "1.2.125", + sdkVersion: "1.2.126", genVersion: "2.914.0", - userAgent: "speakeasy-sdk/typescript 1.2.125 2.914.0 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.2.126 2.914.0 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/imagegenerationrequest.ts b/src/models/imagegenerationrequest.ts index 95ba4ac72..ed641c806 100644 --- a/src/models/imagegenerationrequest.ts +++ b/src/models/imagegenerationrequest.ts @@ -17,6 +17,11 @@ import { ImageGenerationProviderPreferences$Outbound, ImageGenerationProviderPreferences$outboundSchema, } from "./imagegenerationproviderpreferences.js"; +import { + TraceConfig, + TraceConfig$Outbound, + TraceConfig$outboundSchema, +} from "./traceconfig.js"; /** * Normalized aspect ratio of the generated image. Providers clamp to their supported subset. @@ -179,6 +184,10 @@ export type ImageGenerationRequest = { * If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. */ stream?: boolean | undefined; + /** + * Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. + */ + trace?: TraceConfig | undefined; /** * A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. */ @@ -231,6 +240,7 @@ export type ImageGenerationRequest$Outbound = { seed?: number | undefined; size?: string | undefined; stream?: boolean | undefined; + trace?: TraceConfig$Outbound | undefined; user?: string | undefined; }; @@ -253,6 +263,7 @@ export const ImageGenerationRequest$outboundSchema: z.ZodType< seed: z.int().optional(), size: z.string().optional(), stream: z.boolean().optional(), + trace: TraceConfig$outboundSchema.optional(), user: z.string().optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/operations/createembeddings.ts b/src/models/operations/createembeddings.ts index a393d1056..788658717 100644 --- a/src/models/operations/createembeddings.ts +++ b/src/models/operations/createembeddings.ts @@ -117,6 +117,10 @@ export type CreateEmbeddingsRequestBody = { */ model: string; provider?: models.ProviderPreferences | null | undefined; + /** + * Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. + */ + trace?: models.TraceConfig | undefined; /** * A unique identifier for the end-user */ @@ -407,6 +411,7 @@ export type CreateEmbeddingsRequestBody$Outbound = { input_type?: string | undefined; model: string; provider?: models.ProviderPreferences$Outbound | null | undefined; + trace?: models.TraceConfig$Outbound | undefined; user?: string | undefined; }; @@ -427,6 +432,7 @@ export const CreateEmbeddingsRequestBody$outboundSchema: z.ZodType< inputType: z.string().optional(), model: z.string(), provider: z.nullable(models.ProviderPreferences$outboundSchema).optional(), + trace: models.TraceConfig$outboundSchema.optional(), user: z.string().optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/operations/creatererank.ts b/src/models/operations/creatererank.ts index 34a087aa5..f111086c1 100644 --- a/src/models/operations/creatererank.ts +++ b/src/models/operations/creatererank.ts @@ -72,6 +72,10 @@ export type CreateRerankRequestBody = { * Number of most relevant documents to return */ topN?: number | undefined; + /** + * Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. + */ + trace?: models.TraceConfig | undefined; /** * A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. */ @@ -218,6 +222,7 @@ export type CreateRerankRequestBody$Outbound = { provider?: models.ProviderPreferences$Outbound | null | undefined; query: string; top_n?: number | undefined; + trace?: models.TraceConfig$Outbound | undefined; user?: string | undefined; }; @@ -233,6 +238,7 @@ export const CreateRerankRequestBody$outboundSchema: z.ZodType< provider: z.nullable(models.ProviderPreferences$outboundSchema).optional(), query: z.string(), topN: z.int().optional(), + trace: models.TraceConfig$outboundSchema.optional(), user: z.string().optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/speechrequest.ts b/src/models/speechrequest.ts index 76edcf3a0..4500795a2 100644 --- a/src/models/speechrequest.ts +++ b/src/models/speechrequest.ts @@ -17,6 +17,11 @@ import { SpeechInputReference$Outbound, SpeechInputReference$outboundSchema, } from "./speechinputreference.js"; +import { + TraceConfig, + TraceConfig$Outbound, + TraceConfig$outboundSchema, +} from "./traceconfig.js"; /** * Provider-specific passthrough configuration @@ -70,6 +75,10 @@ export type SpeechRequest = { * Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers. */ speed?: number | undefined; + /** + * Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. + */ + trace?: TraceConfig | undefined; /** * A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. */ @@ -115,6 +124,7 @@ export type SpeechRequest$Outbound = { provider?: SpeechRequestProvider$Outbound | undefined; response_format: string; speed?: number | undefined; + trace?: TraceConfig$Outbound | undefined; user?: string | undefined; voice?: string | undefined; }; @@ -130,6 +140,7 @@ export const SpeechRequest$outboundSchema: z.ZodType< provider: z.lazy(() => SpeechRequestProvider$outboundSchema).optional(), responseFormat: SpeechRequestResponseFormat$outboundSchema.default("pcm"), speed: z.number().optional(), + trace: TraceConfig$outboundSchema.optional(), user: z.string().optional(), voice: z.string().optional(), }).transform((v) => { diff --git a/src/models/sttrequest.ts b/src/models/sttrequest.ts index 81f755c0b..d19862532 100644 --- a/src/models/sttrequest.ts +++ b/src/models/sttrequest.ts @@ -21,6 +21,11 @@ import { STTTimestampGranularity, STTTimestampGranularity$outboundSchema, } from "./stttimestampgranularity.js"; +import { + TraceConfig, + TraceConfig$Outbound, + TraceConfig$outboundSchema, +} from "./traceconfig.js"; /** * Provider-specific passthrough configuration @@ -78,6 +83,10 @@ export type STTRequest = { * Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json". */ timestampGranularities?: Array | undefined; + /** + * Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. + */ + trace?: TraceConfig | undefined; /** * A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. */ @@ -120,6 +129,7 @@ export type STTRequest$Outbound = { response_format?: string | undefined; temperature?: number | undefined; timestamp_granularities?: Array | undefined; + trace?: TraceConfig$Outbound | undefined; user?: string | undefined; }; @@ -136,6 +146,7 @@ export const STTRequest$outboundSchema: z.ZodType< temperature: z.number().optional(), timestampGranularities: z.array(STTTimestampGranularity$outboundSchema) .optional(), + trace: TraceConfig$outboundSchema.optional(), user: z.string().optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/videogenerationrequest.ts b/src/models/videogenerationrequest.ts index e2a31689b..2d1715863 100644 --- a/src/models/videogenerationrequest.ts +++ b/src/models/videogenerationrequest.ts @@ -17,6 +17,11 @@ import { InputReference$Outbound, InputReference$outboundSchema, } from "./inputreference.js"; +import { + TraceConfig, + TraceConfig$Outbound, + TraceConfig$outboundSchema, +} from "./traceconfig.js"; /** * Aspect ratio of the generated video @@ -262,6 +267,10 @@ export type VideoGenerationRequest = { * Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio. */ size?: string | undefined; + /** + * Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. + */ + trace?: TraceConfig | undefined; /** * Upscale factor for video upscaling models only. This parameter is not supported by video generation models. */ @@ -659,6 +668,7 @@ export type VideoGenerationRequest$Outbound = { resolution?: string | undefined; seed?: number | undefined; size?: string | undefined; + trace?: TraceConfig$Outbound | undefined; upscale_factor?: number | undefined; user?: string | undefined; }; @@ -682,6 +692,7 @@ export const VideoGenerationRequest$outboundSchema: z.ZodType< resolution: VideoGenerationRequestResolution$outboundSchema.optional(), seed: z.int().optional(), size: z.string().optional(), + trace: TraceConfig$outboundSchema.optional(), upscaleFactor: z.number().optional(), user: z.string().optional(), }).transform((v) => {