From 49693ca989ebb6fd5d848466d1bf1451a5cbce41 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 25 Aug 2026 11:34:49 +0000 Subject: [PATCH 1/2] ## Python SDK Changes: * `open_router.tts.create_speech()`: `error.status[413]` **Added** * `open_router.stt.create_transcription()`: `error.status[413]` **Added** * `open_router.stt.create_transcription_multipart()`: `error.status[413]` **Added** * `open_router.rerank.rerank()`: `error.status[413]` **Added** * `open_router.video_generation.generate()`: `error.status[413]` **Added** --- .speakeasy/gen.lock | 68 +++++++++++++++++----------- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 40 ++++++++++++++++ .speakeasy/workflow.lock | 10 ++-- RELEASES.md | 12 ++++- docs/sdks/rerank/README.mdx | 1 + docs/sdks/stt/README.mdx | 2 + docs/sdks/tts/README.mdx | 1 + docs/sdks/videogeneration/README.mdx | 1 + pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/rerank.py | 10 ++++ src/openrouter/stt.py | 20 ++++++++ src/openrouter/tts.py | 16 +++++++ src/openrouter/video_generation.py | 10 ++++ uv.lock | 2 +- 16 files changed, 163 insertions(+), 38 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 2162485b..2f37ce9c 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: 8921a22ee9a28c5cd98b924a272e809e + docChecksum: 6b5d19b1320aae9ec59bd5bc93e4b2ef docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.85 - configChecksum: 056db9012f4a842d5c3fbcf891459fe3 + releaseVersion: 1.1.86 + configChecksum: 9fb5efeed75ca7f11498acfade7c8c70 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 86f35643-8d5a-4437-9448-84a67826db84 - pristine_commit_hash: 38f3a057898aac5a1b7148d458af890d5a2f8ebd - pristine_tree_hash: cc383fb366cc3db32cb2bb5e6a6492a13d9da573 + generation_id: 12541bfd-568a-479a-adbd-3e0d9f758130 + pristine_commit_hash: 81cdfa3d8c75fa66f62f7314446cdc36c15d106a + pristine_tree_hash: 37a5f9ab483b37d0829cbf887d16a6a9f4383349 features: python: acceptHeaders: 3.0.0 @@ -7354,8 +7354,8 @@ trackedFiles: pristine_git_object: 7571e2581a73919541d9712f6c1f88f9c0d2b4c9 docs/sdks/rerank/README.mdx: id: 68cdfc7f7dca - last_write_checksum: sha1:e72927c64eb545386bb50e9d30e8092392f2eb0b - pristine_git_object: cd1b341b1b7c0284b9ba9b102bd8020e0d7ce707 + last_write_checksum: sha1:6dded21b8567278fa801df5081cca63a1e64ff85 + pristine_git_object: 68f6454a9155aaebe1650a613fd40fc7b2b5a681 docs/sdks/responses/README.mdx: id: abab319e080e last_write_checksum: sha1:786e6be086f66f9262e19d6bbf8e32d726bea076 @@ -7366,16 +7366,16 @@ trackedFiles: pristine_git_object: 89918692e893f665f65a870440659a63ab821693 docs/sdks/stt/README.mdx: id: 190b0dc9a5d1 - last_write_checksum: sha1:0280bf119668798bf78f662fd41364b573c7fe53 - pristine_git_object: 9d4c7d757474f113855db5b61136b5add011b144 + last_write_checksum: sha1:1602f411670a9626e157cf37df8f3a90da15a4a6 + pristine_git_object: ba30223a27208904a3a69690ae214d3f32441a39 docs/sdks/tts/README.mdx: id: cd1132543884 - last_write_checksum: sha1:b7189079cedd061c9c5cacb2351a803bedea06dc - pristine_git_object: 9cf862e8536690785ef58c199f61c87f8945b574 + last_write_checksum: sha1:ff8413c231ba1a6c59ba2d30fdb1186067dbc229 + pristine_git_object: afdf10028c5fb35ec021a71f6c943abbfa96af49 docs/sdks/videogeneration/README.mdx: id: 9a8fa04c3872 - last_write_checksum: sha1:795a3adc37bbdd3fb375708e95faa080fd614934 - pristine_git_object: 37da69173c4be1ca80538e4c60b1fa356c77a790 + last_write_checksum: sha1:90b6f8ccf08b13fb7e1a011306972147cc5eeac7 + pristine_git_object: b8a724406e6cacb0ecfef890499e727808961000 docs/sdks/workspaces/README.mdx: id: 0c75d023ef6b last_write_checksum: sha1:c079746a64ae6d17d275a869566c100b54d955bf @@ -7386,8 +7386,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:d456d250d743e1fc424fe4b564385da9e801d20d - pristine_git_object: b06203b5c1c269dd0b8c45485ce66cf71e94f528 + last_write_checksum: sha1:b90a63cafd4e584737c9ada6a66265ff587e9573 + pristine_git_object: b6bb5fcafbb2e81b5eb1dae54aa8b2753bd50fb3 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7414,8 +7414,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:c0a63eddf73b86cd05f70c11ee50271a68efc6ad - pristine_git_object: 2edbb2f02918b24e6d5135393d66d3abfb572228 + last_write_checksum: sha1:8bcf1f2f255e49404d1b8c7560b3d1e0ab6449b2 + pristine_git_object: d6b53c21f23e732ffcff2894fc0e638c26463be7 src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9 @@ -10494,8 +10494,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 src/openrouter/rerank.py: id: 8dbc1be8d76f - last_write_checksum: sha1:948125ce756a89cc0fb82dac1fc12b90cf2498b9 - pristine_git_object: 76378ffba1806e0ca66fc873db1a568be0becebb + last_write_checksum: sha1:4236f8079e5f198ddcd79058a76c0753f7f685bc + pristine_git_object: cfd7de57d6bcab6642d5ccd442f8388a3a300f0c src/openrouter/responses.py: id: f2108fb635e1 last_write_checksum: sha1:27af78b7cedb1691bb88a71271808d1e4685c2bb @@ -10514,12 +10514,12 @@ trackedFiles: pristine_git_object: 26433165a0b1c25d7bd3115b9b129b18f2dc9387 src/openrouter/stt.py: id: fc0c2f669423 - last_write_checksum: sha1:155645ebde81f259a2b94811dd8d5581ccb970ac - pristine_git_object: 01f61f8dcefb140225a8919a0ad5416c4ce9262d + last_write_checksum: sha1:6fb43c31e930b653d0eb809f99e250a7cd7601ca + pristine_git_object: 932ea2f623bf9026e5c538d6ea387f06e73a86cd src/openrouter/tts.py: id: 5055d4b95f1d - last_write_checksum: sha1:d6cf60a07db7400137815b5cdf4f84a34b95f622 - pristine_git_object: 96d5f3a8df0f888937b15e30bbef255aa366837b + last_write_checksum: sha1:973737d1461d3723e9de63f1f3684aae573cc3e4 + pristine_git_object: 4c5f06473916e17766269b82a3c2ae68ce73bb1f src/openrouter/types/__init__.py: id: 5eab536205b7 last_write_checksum: sha1:f9ad14217f832e74f594285960125add50324be9 @@ -10610,8 +10610,8 @@ trackedFiles: pristine_git_object: dae01a44384ac3bc13ae07453a053bf6c898ebe3 src/openrouter/video_generation.py: id: d0a90c1b8efe - last_write_checksum: sha1:25e4ca847d4139f7e33d5611009d2b19e3f7f3ac - pristine_git_object: d6a2f5b25bc1bbad8bf5faa911f453f65fb0465f + last_write_checksum: sha1:fc044e1af054b23fc415f9d7f40303b96678ab19 + pristine_git_object: d7a5997d75ebb156d61342c8cf55c00cee9e210d src/openrouter/workspaces.py: id: cd6c533b1802 last_write_checksum: sha1:b796f38262144b21ebf8f77e0a842903b4098e24 @@ -11257,6 +11257,8 @@ examples: application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}} "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} + "413": + application/json: {"error": {"code": 413, "message": "Request payload too large"}} createVideos: speakeasy-default-create-videos: requestBody: @@ -11276,6 +11278,8 @@ examples: application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "413": + application/json: {"error": {"code": 413, "message": "Request payload too large"}} getVideos: speakeasy-default-get-videos: parameters: @@ -11375,6 +11379,8 @@ examples: application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}} "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} + "413": + application/json: {"error": {"code": 413, "message": "Request payload too large"}} createAudioTranscriptions: speakeasy-default-create-audio-transcriptions: requestBody: @@ -11402,6 +11408,8 @@ examples: application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}} "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} + "413": + application/json: {"error": {"code": 413, "message": "Request payload too large"}} speakeasy-default-create-audio-transcriptions-multipart: requestBody: multipart/form-data: {"file": "x-file: example.file", "model": "Escalade"} @@ -11428,6 +11436,8 @@ examples: application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}} "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} + "413": + application/json: {"error": {"code": 413, "message": "Request payload too large"}} listBYOKKeys: speakeasy-default-list-BYOK-keys: parameters: @@ -12449,4 +12459,8 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Python SDK Changes: - * `open_router.containers.promote_container_file()`: **Added** + * `open_router.tts.create_speech()`: `error.status[413]` **Added** + * `open_router.stt.create_transcription()`: `error.status[413]` **Added** + * `open_router.stt.create_transcription_multipart()`: `error.status[413]` **Added** + * `open_router.rerank.rerank()`: `error.status[413]` **Added** + * `open_router.video_generation.generate()`: `error.status[413]` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index f97fede7..65335b19 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.85 + version: 1.1.86 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 76e6bb12..f9fb3b57 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -27727,6 +27727,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' + '413': + content: + application/json: + example: + error: + code: 413 + message: 'Request payload too large' + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - Request payload exceeds size limits' '429': content: application/json: @@ -27907,6 +27917,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' + '413': + content: + application/json: + example: + error: + code: 413 + message: 'Request payload too large' + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - Request payload exceeds size limits' '429': content: application/json: @@ -38264,6 +38284,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' + '413': + content: + application/json: + example: + error: + code: 413 + message: 'Request payload too large' + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - Request payload exceeds size limits' '429': content: application/json: @@ -39103,6 +39133,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' + '413': + content: + application/json: + example: + error: + code: 413 + message: 'Request payload too large' + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - Request payload exceeds size limits' '429': content: application/json: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 5624bd62..d7591618 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:385f7f8d2f902977c1423ae176629a87bd05d4a60d9e7014f50056fe583436e7 - sourceBlobDigest: sha256:5a656c3be6631afcd0cc49e5dd57423299f17dc9d241ecd40752814ab8adbcc7 + sourceRevisionDigest: sha256:ded46b4e1c04095fb0fb5a790cf72e633f103dc9b141c3bfd85f7f91281b49a7 + sourceBlobDigest: sha256:013ff5a1c96453351bc0a8fd32014e2ec7274e6980b8b4df3d6824b231836ea1 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:385f7f8d2f902977c1423ae176629a87bd05d4a60d9e7014f50056fe583436e7 - sourceBlobDigest: sha256:5a656c3be6631afcd0cc49e5dd57423299f17dc9d241ecd40752814ab8adbcc7 + sourceRevisionDigest: sha256:ded46b4e1c04095fb0fb5a790cf72e633f103dc9b141c3bfd85f7f91281b49a7 + sourceBlobDigest: sha256:013ff5a1c96453351bc0a8fd32014e2ec7274e6980b8b4df3d6824b231836ea1 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:c397d9479a42226b46d1558d1033c1f9d81ac3bbce81389f1f94b85e50e4549c + codeSamplesRevisionDigest: sha256:6ca7f203fab6d80273a09d908fce2daae4ae1fc13b770b2d965a4a77dcea066d workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 40798f5a..903fb34b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1639,4 +1639,14 @@ Based on: ### Generated - [python v1.1.85] . ### Releases -- [PyPI v1.1.85] https://pypi.org/project/openrouter/1.1.85 - . \ No newline at end of file +- [PyPI v1.1.85] https://pypi.org/project/openrouter/1.1.85 - . + +## 2026-08-25 11:32:35 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.86] . +### Releases +- [PyPI v1.1.86] https://pypi.org/project/openrouter/1.1.86 - . \ No newline at end of file diff --git a/docs/sdks/rerank/README.mdx b/docs/sdks/rerank/README.mdx index cd1b341b..68f6454a 100644 --- a/docs/sdks/rerank/README.mdx +++ b/docs/sdks/rerank/README.mdx @@ -65,6 +65,7 @@ with OpenRouter( | errors.UnauthorizedResponseError | 401 | application/json | | errors.PaymentRequiredResponseError | 402 | application/json | | errors.NotFoundResponseError | 404 | application/json | +| errors.PayloadTooLargeResponseError | 413 | application/json | | errors.TooManyRequestsResponseError | 429 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.BadGatewayResponseError | 502 | application/json | diff --git a/docs/sdks/stt/README.mdx b/docs/sdks/stt/README.mdx index 9d4c7d75..ba30223a 100644 --- a/docs/sdks/stt/README.mdx +++ b/docs/sdks/stt/README.mdx @@ -68,6 +68,7 @@ with OpenRouter( | errors.UnauthorizedResponseError | 401 | application/json | | errors.PaymentRequiredResponseError | 402 | application/json | | errors.NotFoundResponseError | 404 | application/json | +| errors.PayloadTooLargeResponseError | 413 | application/json | | errors.TooManyRequestsResponseError | 429 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.BadGatewayResponseError | 502 | application/json | @@ -131,6 +132,7 @@ with OpenRouter( | errors.UnauthorizedResponseError | 401 | application/json | | errors.PaymentRequiredResponseError | 402 | application/json | | errors.NotFoundResponseError | 404 | application/json | +| errors.PayloadTooLargeResponseError | 413 | application/json | | errors.TooManyRequestsResponseError | 429 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.BadGatewayResponseError | 502 | application/json | diff --git a/docs/sdks/tts/README.mdx b/docs/sdks/tts/README.mdx index 9cf862e8..afdf1002 100644 --- a/docs/sdks/tts/README.mdx +++ b/docs/sdks/tts/README.mdx @@ -64,6 +64,7 @@ with OpenRouter( | errors.UnauthorizedResponseError | 401 | application/json | | errors.PaymentRequiredResponseError | 402 | application/json | | errors.NotFoundResponseError | 404 | application/json | +| errors.PayloadTooLargeResponseError | 413 | application/json | | errors.TooManyRequestsResponseError | 429 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.BadGatewayResponseError | 502 | application/json | diff --git a/docs/sdks/videogeneration/README.mdx b/docs/sdks/videogeneration/README.mdx index 37da6917..b8a72440 100644 --- a/docs/sdks/videogeneration/README.mdx +++ b/docs/sdks/videogeneration/README.mdx @@ -74,6 +74,7 @@ with OpenRouter( | errors.UnauthorizedResponseError | 401 | application/json | | errors.PaymentRequiredResponseError | 402 | application/json | | errors.NotFoundResponseError | 404 | application/json | +| errors.PayloadTooLargeResponseError | 413 | application/json | | errors.TooManyRequestsResponseError | 429 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | diff --git a/pyproject.toml b/pyproject.toml index b06203b5..b6bb5fca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.85" +version = "1.1.86" 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 2edbb2f0..d6b53c21 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.1.85" +__version__: str = "1.1.86" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.85 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.86 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/rerank.py b/src/openrouter/rerank.py index 76378ffb..cfd7de57 100644 --- a/src/openrouter/rerank.py +++ b/src/openrouter/rerank.py @@ -177,6 +177,11 @@ def rerank( errors.NotFoundResponseErrorData, http_res ) raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) if utils.match_response(http_res, "429", "application/json"): response_data = unmarshal_json_response( errors.TooManyRequestsResponseErrorData, http_res @@ -379,6 +384,11 @@ async def rerank_async( errors.NotFoundResponseErrorData, http_res ) raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) if utils.match_response(http_res, "429", "application/json"): response_data = unmarshal_json_response( errors.TooManyRequestsResponseErrorData, http_res diff --git a/src/openrouter/stt.py b/src/openrouter/stt.py index 01f61f8d..932ea2f6 100644 --- a/src/openrouter/stt.py +++ b/src/openrouter/stt.py @@ -166,6 +166,11 @@ def create_transcription( errors.NotFoundResponseErrorData, http_res ) raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) if utils.match_response(http_res, "429", "application/json"): response_data = unmarshal_json_response( errors.TooManyRequestsResponseErrorData, http_res @@ -363,6 +368,11 @@ async def create_transcription_async( errors.NotFoundResponseErrorData, http_res ) raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) if utils.match_response(http_res, "429", "application/json"): response_data = unmarshal_json_response( errors.TooManyRequestsResponseErrorData, http_res @@ -560,6 +570,11 @@ def create_transcription_multipart( errors.NotFoundResponseErrorData, http_res ) raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) if utils.match_response(http_res, "429", "application/json"): response_data = unmarshal_json_response( errors.TooManyRequestsResponseErrorData, http_res @@ -757,6 +772,11 @@ async def create_transcription_multipart_async( errors.NotFoundResponseErrorData, http_res ) raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) if utils.match_response(http_res, "429", "application/json"): response_data = unmarshal_json_response( errors.TooManyRequestsResponseErrorData, http_res diff --git a/src/openrouter/tts.py b/src/openrouter/tts.py index 96d5f3a8..4c5f0647 100644 --- a/src/openrouter/tts.py +++ b/src/openrouter/tts.py @@ -179,6 +179,14 @@ def create_speech( errors.NotFoundResponseErrorData, http_res, http_res_text ) raise errors.NotFoundResponseError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "413", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res, http_res_text + ) + raise errors.PayloadTooLargeResponseError( + response_data, http_res, http_res_text + ) if utils.match_response(http_res, "429", "application/json"): http_res_text = utils.stream_to_text(http_res) response_data = unmarshal_json_response( @@ -407,6 +415,14 @@ async def create_speech_async( errors.NotFoundResponseErrorData, http_res, http_res_text ) raise errors.NotFoundResponseError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "413", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res, http_res_text + ) + raise errors.PayloadTooLargeResponseError( + response_data, http_res, http_res_text + ) if utils.match_response(http_res, "429", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) response_data = unmarshal_json_response( diff --git a/src/openrouter/video_generation.py b/src/openrouter/video_generation.py index d6a2f5b2..d7a5997d 100644 --- a/src/openrouter/video_generation.py +++ b/src/openrouter/video_generation.py @@ -202,6 +202,11 @@ def generate( errors.NotFoundResponseErrorData, http_res ) raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) if utils.match_response(http_res, "429", "application/json"): response_data = unmarshal_json_response( errors.TooManyRequestsResponseErrorData, http_res @@ -414,6 +419,11 @@ async def generate_async( errors.NotFoundResponseErrorData, http_res ) raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "413", "application/json"): + response_data = unmarshal_json_response( + errors.PayloadTooLargeResponseErrorData, http_res + ) + raise errors.PayloadTooLargeResponseError(response_data, http_res) if utils.match_response(http_res, "429", "application/json"): response_data = unmarshal_json_response( errors.TooManyRequestsResponseErrorData, http_res diff --git a/uv.lock b/uv.lock index 42538046..fbe55168 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.85" +version = "1.1.86" source = { editable = "." } dependencies = [ { name = "httpcore" }, From 3a6d5102942c8d0c660823c3319473c9cf395765 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:34:56 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow