From f877e129efd63d4f40e4a8017752b5ea692f63aa Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 15 Sep 2026 16:54:45 +0000 Subject: [PATCH 1/2] ## Python SDK Changes: * `open_router.guardrails.update()`: `error.status[403]` **Added** * `open_router.guardrails.bulk_assign_keys()`: `error.status[403]` **Added** --- .speakeasy/gen.lock | 35 +++++++++++++++++++-------------- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 22 ++++++++++++++++++++- .speakeasy/workflow.lock | 10 +++++----- RELEASES.md | 12 ++++++++++- docs/sdks/guardrails/README.mdx | 2 ++ pyproject.toml | 2 +- src/openrouter/_version.py | 4 ++-- src/openrouter/guardrails.py | 20 +++++++++++++++++++ uv.lock | 2 +- 10 files changed, 84 insertions(+), 27 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ab516cbe..8fd7a73c 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: 68c742eaf58c38c304bb91cbf1f3be39 + docChecksum: 64c7fdab9cd5094257d03795e1c32093 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.143 - configChecksum: ff27bb8d48d09365dcdd5b9390426d82 + releaseVersion: 1.1.144 + configChecksum: 5003e7c8d10125dcfac77dd91f99f61d repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: dd2064d2-d032-41eb-9c3f-349057e1f4da - pristine_commit_hash: 2539a4e8f102ceebc4a0459e04d10adce03b42ec - pristine_tree_hash: a036aeb5be3ffc29f2a48a3c26d5c167092714f9 + generation_id: c32a6f51-0d86-4287-a290-9f50713de8a5 + pristine_commit_hash: fe705ca96236ca6dc68684dfa15596cbfe45c72f + pristine_tree_hash: 65aab2e1250767a7446a834d74530f028f849204 features: python: acceptHeaders: 3.0.0 @@ -7602,8 +7602,8 @@ trackedFiles: pristine_git_object: 064751ea194bff6b8111575603f804362960b886 docs/sdks/guardrails/README.mdx: id: a0cd4218b8fa - last_write_checksum: sha1:aa3566d7a19dc851c85901311697c163b507d92b - pristine_git_object: 0475a645cfeab55bb1f13d15ba1e941f75ae562a + last_write_checksum: sha1:5d726806705c8c06aa1df8ecbebfa04a0214d8d4 + pristine_git_object: d419fd3ee53c199c96b5228f7b656fa8e732bd69 docs/sdks/images/README.mdx: id: 534a6c102c4f last_write_checksum: sha1:bc62f91590ac816c58ad954f4a888a46aee71bb9 @@ -7666,8 +7666,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:8f8e5267759de894d383ae4dd32d970e531dbaaa - pristine_git_object: 2e88d86d03214de7322bd4314ea223a6c074f178 + last_write_checksum: sha1:9a1514fe82c68fc00bebd81cbe2cf268a2de618a + pristine_git_object: bbf6a5610eca8513157195c5bb5f33dad5910098 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7694,8 +7694,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:49e0609d0f28924046aaf81c882bc136c3a9d5a0 - pristine_git_object: 093c988002cf87bcd29ed90b8885463a013c6d89 + last_write_checksum: sha1:fd87a6f9d7a5fa6125885e31a718aae32d00d825 + pristine_git_object: b4f8e9ce1fcf8b233ff0ddf1a527e23384b7026f src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9 @@ -10414,8 +10414,8 @@ trackedFiles: pristine_git_object: d5990c4254d4b3c5dae3f548bbec02558adadae1 src/openrouter/guardrails.py: id: 705839f34e66 - last_write_checksum: sha1:a59c2b030c154738e49d0a4ae99970d0ae343051 - pristine_git_object: cf9a6c64cfdbc97b68586fde67d9a66a19b06496 + last_write_checksum: sha1:1551845b6a9776480d99ef0fc1fca61e845f3de2 + pristine_git_object: 785964ad30a2043c9d70272f15d1a3fac9635b73 src/openrouter/httpclient.py: id: e9311185443d last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 @@ -11434,6 +11434,8 @@ examples: application/json: {"error": {"code": 500, "message": "Internal Server Error"}} "409": application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} deleteGuardrail: speakeasy-default-delete-guardrail: parameters: @@ -11509,6 +11511,8 @@ examples: application/json: {"error": {"code": 404, "message": "Resource not found"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} listGuardrailMemberAssignments: speakeasy-default-list-guardrail-member-assignments: parameters: @@ -12920,4 +12924,5 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Python SDK Changes: - * `open_router.images.generate()`: `request.aspect_ratio` **Changed** + * `open_router.guardrails.update()`: `error.status[403]` **Added** + * `open_router.guardrails.bulk_assign_keys()`: `error.status[403]` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 89f8fd61..10285923 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.143 + version: 1.1.144 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index ec599ee4..70cc00f4 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -33482,7 +33482,7 @@ paths: message: 'Only management keys can perform this operation' schema: $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' + description: 'The workspace is not owned by this account, or the guardrail would give a HIPAA-enabled workspace a person-name or address sensitive-info filter, which is not available there.' '500': content: application/json: @@ -33704,6 +33704,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'The update would give a HIPAA-enabled workspace a person-name or address sensitive-info filter, which is not available there.' '404': content: application/json: @@ -33893,6 +33903,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'The guardrail has no workspace and carries a person-name or address sensitive-info filter, and at least one target key belongs to a HIPAA-enabled workspace, where that filter is not available.' '404': content: application/json: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index cbd9612e..c91bbdb8 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:a1c1a7dfa8fd686746b1ec766cf2b379cf9814e2bc09f12445b6f3d9e997339d - sourceBlobDigest: sha256:4bed40678f6bcb9a610c5d9586f1a4f50ebf3beb75cb9f330be7ee3ee040fdf1 + sourceRevisionDigest: sha256:ee0f13cf90935764a5a44bf73b50e3a766cb937ac330dd03b1b9f6583353de57 + sourceBlobDigest: sha256:4786181ada8544b07cd92a0521d3eb252237fd746407b4ce54802da36d3a6c94 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:a1c1a7dfa8fd686746b1ec766cf2b379cf9814e2bc09f12445b6f3d9e997339d - sourceBlobDigest: sha256:4bed40678f6bcb9a610c5d9586f1a4f50ebf3beb75cb9f330be7ee3ee040fdf1 + sourceRevisionDigest: sha256:ee0f13cf90935764a5a44bf73b50e3a766cb937ac330dd03b1b9f6583353de57 + sourceBlobDigest: sha256:4786181ada8544b07cd92a0521d3eb252237fd746407b4ce54802da36d3a6c94 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:83260deab8c5b242f4886ce40307175ec7f64f6d1a9517927188a5da4cf0255e + codeSamplesRevisionDigest: sha256:ee461b6c8cde89dd29d1f8425e63ab42906c1c51856454f7d72eba1d1c5c34fd workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 16b11ca6..06f4744a 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2219,4 +2219,14 @@ Based on: ### Generated - [python v1.1.143] . ### Releases -- [PyPI v1.1.143] https://pypi.org/project/openrouter/1.1.143 - . \ No newline at end of file +- [PyPI v1.1.143] https://pypi.org/project/openrouter/1.1.143 - . + +## 2026-09-15 16:52:38 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.144] . +### Releases +- [PyPI v1.1.144] https://pypi.org/project/openrouter/1.1.144 - . \ No newline at end of file diff --git a/docs/sdks/guardrails/README.mdx b/docs/sdks/guardrails/README.mdx index 0475a645..d419fd3e 100644 --- a/docs/sdks/guardrails/README.mdx +++ b/docs/sdks/guardrails/README.mdx @@ -313,6 +313,7 @@ with OpenRouter( | ---------------------------------- | ---------------------------------- | ---------------------------------- | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.ConflictResponseError | 409 | application/json | | errors.InternalServerResponseError | 500 | application/json | @@ -418,6 +419,7 @@ with OpenRouter( | ---------------------------------- | ---------------------------------- | ---------------------------------- | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | +| errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | diff --git a/pyproject.toml b/pyproject.toml index 2e88d86d..bbf6a561 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.143" +version = "1.1.144" 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 093c9880..b4f8e9ce 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.143" +__version__: str = "1.1.144" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.143 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.144 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 cf9a6c64..785964ad 100644 --- a/src/openrouter/guardrails.py +++ b/src/openrouter/guardrails.py @@ -1541,6 +1541,11 @@ def update( errors.UnauthorizedResponseErrorData, http_res ) raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): response_data = unmarshal_json_response( errors.NotFoundResponseErrorData, http_res @@ -1780,6 +1785,11 @@ async def update_async( errors.UnauthorizedResponseErrorData, http_res ) raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): response_data = unmarshal_json_response( errors.NotFoundResponseErrorData, http_res @@ -2269,6 +2279,11 @@ def bulk_assign_keys( errors.UnauthorizedResponseErrorData, http_res ) raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): response_data = unmarshal_json_response( errors.NotFoundResponseErrorData, http_res @@ -2414,6 +2429,11 @@ async def bulk_assign_keys_async( errors.UnauthorizedResponseErrorData, http_res ) raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + errors.ForbiddenResponseErrorData, http_res + ) + raise errors.ForbiddenResponseError(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): response_data = unmarshal_json_response( errors.NotFoundResponseErrorData, http_res diff --git a/uv.lock b/uv.lock index 7029e25e..50120c5b 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.143" +version = "1.1.144" source = { editable = "." } dependencies = [ { name = "httpcore" }, From c7511c5f28e31726c4e398dc775b5d3bdb258b1c Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 16:54:53 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow