diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index af48d6a1..872f055b 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: e9a90c8d19ffe3953003c7205605e71a + docChecksum: f801f4232e52128b7111557fa57d74b5 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.3.53 - configChecksum: 085f3a7f657752ae6e58d31556252e93 + releaseVersion: 1.3.54 + configChecksum: 00d313ba18dc981810cce55a2880d555 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: be52aea6-d641-420b-b94f-005bb8509b74 - pristine_commit_hash: dfc24c324429ff5435a119516fe08cd16ddfbd46 - pristine_tree_hash: dfc856ef1d660f372890ef9577ac6e7351ea2b5c + generation_id: defe980f-7620-40e8-b3ce-989ccb235d58 + pristine_commit_hash: c0852c28237f34d5322a4857ed118f373cd0a42c + pristine_tree_hash: 85e23e2d3ce5ccb139dca246812b231e581d3a45 features: python: acceptHeaders: 3.0.0 @@ -10204,8 +10204,8 @@ trackedFiles: pristine_git_object: bc1a56cbb41c8f9114c81b547713632272184da6 docs/sdks/guardrails/README.mdx: id: a0cd4218b8fa - last_write_checksum: sha1:6ff1e93f1a874c378bb2cb2f0af40fe081836afc - pristine_git_object: aab47cc3f4a0f7fc492b790cfd9386eb80582fc1 + last_write_checksum: sha1:e67795373d937768a569398179833cd25926bddd + pristine_git_object: ed0b2775e57904a66e9f92a8c51d18b56132623b docs/sdks/images/README.mdx: id: 534a6c102c4f last_write_checksum: sha1:82a8bd22fb399fe419076afe29b9234950baf9f9 @@ -10288,8 +10288,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:fb7ea64431a1f52d038ff3888e915eb074837787 - pristine_git_object: eb5f2f8a591009642cd2b9041599e02e28930c8f + last_write_checksum: sha1:86cbe7493a02b92000f3f7c4cdf79b72828a3ed1 + pristine_git_object: 1b0c571a8a31e326918aeb82851c57a85fe1e91e scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10316,8 +10316,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:222f8fdf7be02811734ec260536e0d5a0b21951e - pristine_git_object: 109494ac321ccfde4864fa15671f82165cc5435f + last_write_checksum: sha1:b0d4346fe4f5e5d3afe0f46e5b3f1b2ba53018b6 + pristine_git_object: ac9989f813165143912560931173c387bd9f2535 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a @@ -13976,8 +13976,8 @@ trackedFiles: pristine_git_object: 5698c384a36929846530cae98f69ce83a0966217 src/openrouter/guardrails.py: id: 705839f34e66 - last_write_checksum: sha1:c14a1e1b1721f4810239d1c8ecb08a7c2ef03cc3 - pristine_git_object: 17cae7153e003ded426dda8ce51995d3479f0980 + last_write_checksum: sha1:48c20d189c3531928c774bef03b14bc9040e105c + pristine_git_object: 434ea641f79989998fbe92131686d5be0ed9a072 src/openrouter/httpclient.py: id: e9311185443d last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 @@ -15257,6 +15257,10 @@ examples: application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} listMemberAssignments: speakeasy-default-list-member-assignments: parameters: @@ -15270,6 +15274,10 @@ examples: application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} listGuardrailKeyAssignments: speakeasy-default-list-guardrail-key-assignments: parameters: @@ -18740,5 +18748,5 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Python SDK Changes: - * `open_router.endpoints.list_zdr_endpoints()`: `response.data[].supports_diarization` **Added** - * `open_router.endpoints.list()`: `response.data.endpoints[].supports_diarization` **Added** + * `open_router.guardrails.list_key_assignments()`: `error` **Changed** + * `open_router.guardrails.list_member_assignments()`: `error` **Changed** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 304b8c53..8dd0e656 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.53 + version: 1.3.54 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index a77664b9..c9168606 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -41782,6 +41782,16 @@ paths: schema: $ref: '#/components/schemas/ListKeyAssignmentsResponse' description: 'List of key assignments' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: @@ -41792,6 +41802,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: @@ -41866,6 +41886,16 @@ paths: schema: $ref: '#/components/schemas/ListMemberAssignmentsResponse' description: 'List of member assignments' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: @@ -41876,6 +41906,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 6dadc4c2..1ed230d6 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:8d1b44b982b4840c9e943cbabf385a4568cba41e6c28d8e3043caab80cd73504 - sourceBlobDigest: sha256:b413922fd2257f2be2218da4ef602bb90a8f0317fd4ae70a68a821e60e5c785c + sourceRevisionDigest: sha256:eb5e9d2ccf05815bcb4fdd8abd8b0ecde72e723e91eed3cce85a3a61a3748883 + sourceBlobDigest: sha256:7df2244c6c4e11befed94c7004a0197585fae4f2409e1dd3b0ea2cb7b17a7319 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:8d1b44b982b4840c9e943cbabf385a4568cba41e6c28d8e3043caab80cd73504 - sourceBlobDigest: sha256:b413922fd2257f2be2218da4ef602bb90a8f0317fd4ae70a68a821e60e5c785c + sourceRevisionDigest: sha256:eb5e9d2ccf05815bcb4fdd8abd8b0ecde72e723e91eed3cce85a3a61a3748883 + sourceBlobDigest: sha256:7df2244c6c4e11befed94c7004a0197585fae4f2409e1dd3b0ea2cb7b17a7319 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:4704fcaaf14e1e9383c197ba59fd569816d88ff15709363ea60e2633a0e2d1a5 + codeSamplesRevisionDigest: sha256:a0aa237795df3f526a013aeed2dbf725150e77a18eb9c9bde5ddf56798949ec8 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 2a9b90c8..67b02228 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3299,4 +3299,14 @@ Based on: ### Generated - [python v1.3.53] . ### Releases -- [PyPI v1.3.53] https://pypi.org/project/openrouter/1.3.53 - . \ No newline at end of file +- [PyPI v1.3.53] https://pypi.org/project/openrouter/1.3.53 - . + +## 2026-10-14 22:30:38 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.54] . +### Releases +- [PyPI v1.3.54] https://pypi.org/project/openrouter/1.3.54 - . \ No newline at end of file diff --git a/docs/sdks/guardrails/README.mdx b/docs/sdks/guardrails/README.mdx index 7ff604e4..a7e51455 100644 --- a/docs/sdks/guardrails/README.mdx +++ b/docs/sdks/guardrails/README.mdx @@ -684,7 +684,9 @@ with OpenRouter( | Error Type | Status Code | Content Type | | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | @@ -734,6 +736,8 @@ with OpenRouter( | Error Type | Status Code | Content Type | | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index eb5f2f8a..1b0c571a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.53" +version = "1.3.54" 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 109494ac..ac9989f8 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.53" +__version__: str = "1.3.54" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.3.53 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.54 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/guardrails.py b/src/openrouter/guardrails.py index 17cae715..434ea641 100644 --- a/src/openrouter/guardrails.py +++ b/src/openrouter/guardrails.py @@ -3837,11 +3837,21 @@ def next_func() -> Optional[operations.ListKeyAssignmentsResponse]: ), next=next_func, ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): response_data = unmarshal_json_response( errors.UnauthorizedResponseErrorData, http_res ) raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) if utils.match_response(http_res, "500", "application/json"): response_data = unmarshal_json_response( errors.InternalServerResponseErrorData, http_res @@ -3998,11 +4008,21 @@ async def empty_result(): ), next=next_func, ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): response_data = unmarshal_json_response( errors.UnauthorizedResponseErrorData, http_res ) raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) if utils.match_response(http_res, "500", "application/json"): response_data = unmarshal_json_response( errors.InternalServerResponseErrorData, http_res @@ -4156,11 +4176,21 @@ def next_func() -> Optional[operations.ListMemberAssignmentsResponse]: ), next=next_func, ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): response_data = unmarshal_json_response( errors.UnauthorizedResponseErrorData, http_res ) raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) if utils.match_response(http_res, "500", "application/json"): response_data = unmarshal_json_response( errors.InternalServerResponseErrorData, http_res @@ -4319,11 +4349,21 @@ async def empty_result(): ), next=next_func, ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): response_data = unmarshal_json_response( errors.UnauthorizedResponseErrorData, http_res ) raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) if utils.match_response(http_res, "500", "application/json"): response_data = unmarshal_json_response( errors.InternalServerResponseErrorData, http_res diff --git a/uv.lock b/uv.lock index a3fa1a75..c8d5a562 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.53" +version = "1.3.54" source = { editable = "." } dependencies = [ { name = "httpcore" },