From 814710fca6b149853265e920f3ba08d1b5867df5 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 29 Sep 2026 13:36:30 +0000 Subject: [PATCH 1/2] ## Python SDK Changes: * `open_router.batch.get_batches()`: `error.status[410]` **Added** --- .speakeasy/gen.lock | 31 +++++++++++++++++-------------- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 10 ++++++++++ .speakeasy/workflow.lock | 10 +++++----- RELEASES.md | 12 +++++++++++- docs/sdks/batch/README.mdx | 2 +- pyproject.toml | 2 +- src/openrouter/_version.py | 4 ++-- src/openrouter/batch.py | 8 ++++++-- uv.lock | 2 +- 10 files changed, 55 insertions(+), 28 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 5f90c9d8..12eec51a 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: c48cf606-fb42-4a45-9c23-8f0555307828 management: - docChecksum: 047dae6f1c573fb83b039c6d3a3d5c4a + docChecksum: 3dfbbc516fcd4f5af7d4444fc707f4a0 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.3.2 - configChecksum: f443ed579ef3ee9e79562960bfa48a2d + releaseVersion: 1.3.3 + configChecksum: 96722859d244c41fff7e97c2d850ef5a repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 513a22ea-a2f4-4c3f-9972-110621b2ead5 - pristine_commit_hash: 969a580aa0d7b078db1982a7b999c02fff3da019 - pristine_tree_hash: 2ed5d2c1104ccba9039c1ef21fa788c7863d4945 + generation_id: 238eeb4e-1de5-4da0-bf88-48ebda54c506 + pristine_commit_hash: 63231bb192e7d72aee3d28b1cf9e78eae6c1087e + pristine_tree_hash: 60835084ca22d26b5994989d72c24d0713e7fc50 features: python: acceptHeaders: 3.0.0 @@ -9320,8 +9320,8 @@ trackedFiles: pristine_git_object: 05cb8497207bd506ac4d84c53a5977e110114806 docs/sdks/batch/README.mdx: id: e367aa4f4295 - last_write_checksum: sha1:0860a61fc1089791f8bc3b741a4230ff87e473c1 - pristine_git_object: 9a0bdf21a7f61fe9936d6bb8b562130ba12c4819 + last_write_checksum: sha1:7e385b464cd4f95f6bbe7454e99a412041017ac7 + pristine_git_object: e09a992dba03c02acc70e8df4dbd7e5157bb6eb4 docs/sdks/benchmarks/README.mdx: id: 5b483a6770ba last_write_checksum: sha1:885b70fcbd2be60f51a2f58e133fd6452eb21600 @@ -9456,8 +9456,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:3735ae6e432910838fe29341bcf4d13a8ed5809c - pristine_git_object: 25e10a347e4def78247790d9ad3b0c7814048354 + last_write_checksum: sha1:578ab8b48f8c511ad6785a9ff61a39ba4acff610 + pristine_git_object: a94d517e1b84972de76b090b37585fb80e5c8318 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -9484,8 +9484,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:fd4faa6b41e83fcacb9404545a36ba3ce59cd982 - pristine_git_object: be3f2250d911815dbe1dfc52712dc385f9c8ca45 + last_write_checksum: sha1:3903cafc0528515e036d3a9967f0729fa2479613 + pristine_git_object: 65c46806afb993ee9cd58f78b4930c67cfb4ab74 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a @@ -9504,8 +9504,8 @@ trackedFiles: pristine_git_object: 7a562e21c7e66c9db666ead83748b73adefe4278 src/openrouter/batch.py: id: 148f61e34d5b - last_write_checksum: sha1:09ec1303708144530085fa2349289c58a184e207 - pristine_git_object: be2ba7c053c7cbf59ce9a0f08b1a5b86ddba6489 + last_write_checksum: sha1:f1108729998bfd8e84ac026a36ce1fa78c779bb2 + pristine_git_object: ac75fd407c638445da32288b0d1b3d164a681863 src/openrouter/benchmarks.py: id: 178d2ad8d706 last_write_checksum: sha1:15b8a7ea05a7550032afb15981958aa73b756881 @@ -17366,3 +17366,6 @@ examples: "504": application/json: {"error": {"code": 504, "message": "Vault request timed out"}} examplesVersion: 1.0.2 +releaseNotes: | + ## Python SDK Changes: + * `open_router.batch.get_batches()`: `error.status[410]` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 593073a0..56296796 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.2 + version: 1.3.3 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 66aa3a88..c595bac8 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -34091,6 +34091,16 @@ paths: schema: $ref: '#/components/schemas/BatchErrorResponse' description: 'No batch exists for the given id.' + '410': + content: + application/json: + example: + error: + code: 410 + message: 'Batch results have expired. OpenRouter deletes batch results 30 days after the batch is created.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The batch results were deleted after the 30-day retention window.' '429': content: application/json: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 760f9184..ce5fa5b7 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:536bd4756c0b43f4dbd90dbf81f0e2fec5ec4fbc97da3fa15f7cd03c134f8b78 - sourceBlobDigest: sha256:b362d4d614e6baa23c19c53c90e95c0e280eedb5bfa39c6d2fa4cfcb3155e418 + sourceRevisionDigest: sha256:067d6e5e2e54a2de16af352c4ac3a09be3883e97c6b3a1c4fca980435a7c89a0 + sourceBlobDigest: sha256:055a3b99945230c28460be38760423c9a3dc1370ac8a159ae16c70095cf6d8fc tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:536bd4756c0b43f4dbd90dbf81f0e2fec5ec4fbc97da3fa15f7cd03c134f8b78 - sourceBlobDigest: sha256:b362d4d614e6baa23c19c53c90e95c0e280eedb5bfa39c6d2fa4cfcb3155e418 + sourceRevisionDigest: sha256:067d6e5e2e54a2de16af352c4ac3a09be3883e97c6b3a1c4fca980435a7c89a0 + sourceBlobDigest: sha256:055a3b99945230c28460be38760423c9a3dc1370ac8a159ae16c70095cf6d8fc codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:9e678282d9af33c41bd64ee327d5d34d9a1e38a4609e5a335b930d254765ab22 + codeSamplesRevisionDigest: sha256:430cf82504eed6be5fd5d1408039ba2cc9121e78a02fb02d7944d88e799d13ee workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index f90676c9..c26690ef 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2789,4 +2789,14 @@ Based on: ### Generated - [python v1.3.2] . ### Releases -- [PyPI v1.3.2] https://pypi.org/project/openrouter/1.3.2 - . \ No newline at end of file +- [PyPI v1.3.2] https://pypi.org/project/openrouter/1.3.2 - . + +## 2026-09-29 13:33:52 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.3] . +### Releases +- [PyPI v1.3.3] https://pypi.org/project/openrouter/1.3.3 - . \ No newline at end of file diff --git a/docs/sdks/batch/README.mdx b/docs/sdks/batch/README.mdx index 9a0bdf21..e09a992d 100644 --- a/docs/sdks/batch/README.mdx +++ b/docs/sdks/batch/README.mdx @@ -327,6 +327,6 @@ with OpenRouter( | Error Type | Status Code | Content Type | | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | | errors.BatchPaymentRequiredResponseError | 402 | application/json | -| errors.BatchErrorResponse | 401, 404, 429 | application/json | +| errors.BatchErrorResponse | 401, 404, 410, 429 | application/json | | errors.BatchErrorResponse | 500, 502 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 25e10a34..a94d517e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.2" +version = "1.3.3" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index be3f2250..65c46806 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.3.2" +__version__: str = "1.3.3" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.3.2 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.3 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/batch.py b/src/openrouter/batch.py index be2ba7c0..ac75fd40 100644 --- a/src/openrouter/batch.py +++ b/src/openrouter/batch.py @@ -1029,7 +1029,9 @@ def get_batches( errors.BatchPaymentRequiredResponseErrorData, http_res ) raise errors.BatchPaymentRequiredResponseError(response_data, http_res) - if utils.match_response(http_res, ["401", "404", "429"], "application/json"): + if utils.match_response( + http_res, ["401", "404", "410", "429"], "application/json" + ): response_data = unmarshal_json_response( errors.BatchErrorResponseData, http_res ) @@ -1157,7 +1159,9 @@ async def get_batches_async( errors.BatchPaymentRequiredResponseErrorData, http_res ) raise errors.BatchPaymentRequiredResponseError(response_data, http_res) - if utils.match_response(http_res, ["401", "404", "429"], "application/json"): + if utils.match_response( + http_res, ["401", "404", "410", "429"], "application/json" + ): response_data = unmarshal_json_response( errors.BatchErrorResponseData, http_res ) diff --git a/uv.lock b/uv.lock index 4fd0e4f3..ad0d434f 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.2" +version = "1.3.3" source = { editable = "." } dependencies = [ { name = "httpcore" }, From 38b1bd23b21dd3abf3d90208798ffe641a37ae62 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Tue, 29 Sep 2026 13:36:40 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow