Skip to content

Commit f877e12

Browse files
committed
## Python SDK Changes:
* `open_router.guardrails.update()`: `error.status[403]` **Added** * `open_router.guardrails.bulk_assign_keys()`: `error.status[403]` **Added**
1 parent 9658314 commit f877e12

10 files changed

Lines changed: 84 additions & 27 deletions

File tree

‎.speakeasy/gen.lock‎

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
lockVersion: 2.0.0
22
id: c48cf606-fb42-4a45-9c23-8f0555307828
33
management:
4-
docChecksum: 68c742eaf58c38c304bb91cbf1f3be39
4+
docChecksum: 64c7fdab9cd5094257d03795e1c32093
55
docVersion: 1.0.0
66
speakeasyVersion: 1.787.0
77
generationVersion: 2.914.0
8-
releaseVersion: 1.1.143
9-
configChecksum: ff27bb8d48d09365dcdd5b9390426d82
8+
releaseVersion: 1.1.144
9+
configChecksum: 5003e7c8d10125dcfac77dd91f99f61d
1010
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
1111
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
1212
published: true
1313
persistentEdits:
14-
generation_id: dd2064d2-d032-41eb-9c3f-349057e1f4da
15-
pristine_commit_hash: 2539a4e8f102ceebc4a0459e04d10adce03b42ec
16-
pristine_tree_hash: a036aeb5be3ffc29f2a48a3c26d5c167092714f9
14+
generation_id: c32a6f51-0d86-4287-a290-9f50713de8a5
15+
pristine_commit_hash: fe705ca96236ca6dc68684dfa15596cbfe45c72f
16+
pristine_tree_hash: 65aab2e1250767a7446a834d74530f028f849204
1717
features:
1818
python:
1919
acceptHeaders: 3.0.0
@@ -7602,8 +7602,8 @@ trackedFiles:
76027602
pristine_git_object: 064751ea194bff6b8111575603f804362960b886
76037603
docs/sdks/guardrails/README.mdx:
76047604
id: a0cd4218b8fa
7605-
last_write_checksum: sha1:aa3566d7a19dc851c85901311697c163b507d92b
7606-
pristine_git_object: 0475a645cfeab55bb1f13d15ba1e941f75ae562a
7605+
last_write_checksum: sha1:5d726806705c8c06aa1df8ecbebfa04a0214d8d4
7606+
pristine_git_object: d419fd3ee53c199c96b5228f7b656fa8e732bd69
76077607
docs/sdks/images/README.mdx:
76087608
id: 534a6c102c4f
76097609
last_write_checksum: sha1:bc62f91590ac816c58ad954f4a888a46aee71bb9
@@ -7666,8 +7666,8 @@ trackedFiles:
76667666
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
76677667
pyproject.toml:
76687668
id: 5d07e7d72637
7669-
last_write_checksum: sha1:8f8e5267759de894d383ae4dd32d970e531dbaaa
7670-
pristine_git_object: 2e88d86d03214de7322bd4314ea223a6c074f178
7669+
last_write_checksum: sha1:9a1514fe82c68fc00bebd81cbe2cf268a2de618a
7670+
pristine_git_object: bbf6a5610eca8513157195c5bb5f33dad5910098
76717671
scripts/prepare_readme.py:
76727672
id: e0c5957a6035
76737673
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -7694,8 +7694,8 @@ trackedFiles:
76947694
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
76957695
src/openrouter/_version.py:
76967696
id: d8d15ad6c586
7697-
last_write_checksum: sha1:49e0609d0f28924046aaf81c882bc136c3a9d5a0
7698-
pristine_git_object: 093c988002cf87bcd29ed90b8885463a013c6d89
7697+
last_write_checksum: sha1:fd87a6f9d7a5fa6125885e31a718aae32d00d825
7698+
pristine_git_object: b4f8e9ce1fcf8b233ff0ddf1a527e23384b7026f
76997699
src/openrouter/analytics.py:
77007700
id: cb406b5aaabb
77017701
last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9
@@ -10414,8 +10414,8 @@ trackedFiles:
1041410414
pristine_git_object: d5990c4254d4b3c5dae3f548bbec02558adadae1
1041510415
src/openrouter/guardrails.py:
1041610416
id: 705839f34e66
10417-
last_write_checksum: sha1:a59c2b030c154738e49d0a4ae99970d0ae343051
10418-
pristine_git_object: cf9a6c64cfdbc97b68586fde67d9a66a19b06496
10417+
last_write_checksum: sha1:1551845b6a9776480d99ef0fc1fca61e845f3de2
10418+
pristine_git_object: 785964ad30a2043c9d70272f15d1a3fac9635b73
1041910419
src/openrouter/httpclient.py:
1042010420
id: e9311185443d
1042110421
last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7
@@ -11434,6 +11434,8 @@ examples:
1143411434
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
1143511435
"409":
1143611436
application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}}
11437+
"403":
11438+
application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}}
1143711439
deleteGuardrail:
1143811440
speakeasy-default-delete-guardrail:
1143911441
parameters:
@@ -11509,6 +11511,8 @@ examples:
1150911511
application/json: {"error": {"code": 404, "message": "Resource not found"}}
1151011512
"500":
1151111513
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
11514+
"403":
11515+
application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}}
1151211516
listGuardrailMemberAssignments:
1151311517
speakeasy-default-list-guardrail-member-assignments:
1151411518
parameters:
@@ -12920,4 +12924,5 @@ examples:
1292012924
examplesVersion: 1.0.2
1292112925
releaseNotes: |
1292212926
## Python SDK Changes:
12923-
* `open_router.images.generate()`: `request.aspect_ratio` **Changed**
12927+
* `open_router.guardrails.update()`: `error.status[403]` **Added**
12928+
* `open_router.guardrails.bulk_assign_keys()`: `error.status[403]` **Added**

‎.speakeasy/gen.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ generation:
3636
documentation: mintlify
3737
preApplyUnionDiscriminators: true
3838
python:
39-
version: 1.1.143
39+
version: 1.1.144
4040
additionalDependencies:
4141
dev: {}
4242
main: {}

‎.speakeasy/out.openapi.yaml‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33482,7 +33482,7 @@ paths:
3348233482
message: 'Only management keys can perform this operation'
3348333483
schema:
3348433484
$ref: '#/components/schemas/ForbiddenResponse'
33485-
description: 'Forbidden - Authentication successful but insufficient permissions'
33485+
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.'
3348633486
'500':
3348733487
content:
3348833488
application/json:
@@ -33704,6 +33704,16 @@ paths:
3370433704
schema:
3370533705
$ref: '#/components/schemas/UnauthorizedResponse'
3370633706
description: 'Unauthorized - Authentication required or invalid credentials'
33707+
'403':
33708+
content:
33709+
application/json:
33710+
example:
33711+
error:
33712+
code: 403
33713+
message: 'Only management keys can perform this operation'
33714+
schema:
33715+
$ref: '#/components/schemas/ForbiddenResponse'
33716+
description: 'The update would give a HIPAA-enabled workspace a person-name or address sensitive-info filter, which is not available there.'
3370733717
'404':
3370833718
content:
3370933719
application/json:
@@ -33893,6 +33903,16 @@ paths:
3389333903
schema:
3389433904
$ref: '#/components/schemas/UnauthorizedResponse'
3389533905
description: 'Unauthorized - Authentication required or invalid credentials'
33906+
'403':
33907+
content:
33908+
application/json:
33909+
example:
33910+
error:
33911+
code: 403
33912+
message: 'Only management keys can perform this operation'
33913+
schema:
33914+
$ref: '#/components/schemas/ForbiddenResponse'
33915+
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.'
3389633916
'404':
3389733917
content:
3389833918
application/json:

‎.speakeasy/workflow.lock‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ speakeasyVersion: 1.787.0
22
sources:
33
OpenRouter API:
44
sourceNamespace: open-router-chat-completions-api
5-
sourceRevisionDigest: sha256:a1c1a7dfa8fd686746b1ec766cf2b379cf9814e2bc09f12445b6f3d9e997339d
6-
sourceBlobDigest: sha256:4bed40678f6bcb9a610c5d9586f1a4f50ebf3beb75cb9f330be7ee3ee040fdf1
5+
sourceRevisionDigest: sha256:ee0f13cf90935764a5a44bf73b50e3a766cb937ac330dd03b1b9f6583353de57
6+
sourceBlobDigest: sha256:4786181ada8544b07cd92a0521d3eb252237fd746407b4ce54802da36d3a6c94
77
tags:
88
- latest
99
- 1.0.0
1010
targets:
1111
open-router:
1212
source: OpenRouter API
1313
sourceNamespace: open-router-chat-completions-api
14-
sourceRevisionDigest: sha256:a1c1a7dfa8fd686746b1ec766cf2b379cf9814e2bc09f12445b6f3d9e997339d
15-
sourceBlobDigest: sha256:4bed40678f6bcb9a610c5d9586f1a4f50ebf3beb75cb9f330be7ee3ee040fdf1
14+
sourceRevisionDigest: sha256:ee0f13cf90935764a5a44bf73b50e3a766cb937ac330dd03b1b9f6583353de57
15+
sourceBlobDigest: sha256:4786181ada8544b07cd92a0521d3eb252237fd746407b4ce54802da36d3a6c94
1616
codeSamplesNamespace: open-router-python-code-samples
17-
codeSamplesRevisionDigest: sha256:83260deab8c5b242f4886ce40307175ec7f64f6d1a9517927188a5da4cf0255e
17+
codeSamplesRevisionDigest: sha256:ee461b6c8cde89dd29d1f8425e63ab42906c1c51856454f7d72eba1d1c5c34fd
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: 1.787.0

‎RELEASES.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2219,4 +2219,14 @@ Based on:
22192219
### Generated
22202220
- [python v1.1.143] .
22212221
### Releases
2222-
- [PyPI v1.1.143] https://pypi.org/project/openrouter/1.1.143 - .
2222+
- [PyPI v1.1.143] https://pypi.org/project/openrouter/1.1.143 - .
2223+
2224+
## 2026-09-15 16:52:38
2225+
### Changes
2226+
Based on:
2227+
- OpenAPI Doc
2228+
- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
2229+
### Generated
2230+
- [python v1.1.144] .
2231+
### Releases
2232+
- [PyPI v1.1.144] https://pypi.org/project/openrouter/1.1.144 - .

‎docs/sdks/guardrails/README.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ with OpenRouter(
313313
| ---------------------------------- | ---------------------------------- | ---------------------------------- |
314314
| errors.BadRequestResponseError | 400 | application/json |
315315
| errors.UnauthorizedResponseError | 401 | application/json |
316+
| errors.ForbiddenResponseError | 403 | application/json |
316317
| errors.NotFoundResponseError | 404 | application/json |
317318
| errors.ConflictResponseError | 409 | application/json |
318319
| errors.InternalServerResponseError | 500 | application/json |
@@ -418,6 +419,7 @@ with OpenRouter(
418419
| ---------------------------------- | ---------------------------------- | ---------------------------------- |
419420
| errors.BadRequestResponseError | 400 | application/json |
420421
| errors.UnauthorizedResponseError | 401 | application/json |
422+
| errors.ForbiddenResponseError | 403 | application/json |
421423
| errors.NotFoundResponseError | 404 | application/json |
422424
| errors.InternalServerResponseError | 500 | application/json |
423425
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "openrouter"
3-
version = "1.1.143"
3+
version = "1.1.144"
44
description = "Official Python Client SDK for OpenRouter."
55
authors = [{ name = "OpenRouter" },]
66
readme = "README-PYPI.md"

‎src/openrouter/_version.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import importlib.metadata
44

55
__title__: str = "openrouter"
6-
__version__: str = "1.1.143"
6+
__version__: str = "1.1.144"
77
__openapi_doc_version__: str = "1.0.0"
88
__gen_version__: str = "2.914.0"
9-
__user_agent__: str = "speakeasy-sdk/python 1.1.143 2.914.0 1.0.0 openrouter"
9+
__user_agent__: str = "speakeasy-sdk/python 1.1.144 2.914.0 1.0.0 openrouter"
1010

1111
try:
1212
if __package__ is not None:

‎src/openrouter/guardrails.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,11 @@ def update(
15411541
errors.UnauthorizedResponseErrorData, http_res
15421542
)
15431543
raise errors.UnauthorizedResponseError(response_data, http_res)
1544+
if utils.match_response(http_res, "403", "application/json"):
1545+
response_data = unmarshal_json_response(
1546+
errors.ForbiddenResponseErrorData, http_res
1547+
)
1548+
raise errors.ForbiddenResponseError(response_data, http_res)
15441549
if utils.match_response(http_res, "404", "application/json"):
15451550
response_data = unmarshal_json_response(
15461551
errors.NotFoundResponseErrorData, http_res
@@ -1780,6 +1785,11 @@ async def update_async(
17801785
errors.UnauthorizedResponseErrorData, http_res
17811786
)
17821787
raise errors.UnauthorizedResponseError(response_data, http_res)
1788+
if utils.match_response(http_res, "403", "application/json"):
1789+
response_data = unmarshal_json_response(
1790+
errors.ForbiddenResponseErrorData, http_res
1791+
)
1792+
raise errors.ForbiddenResponseError(response_data, http_res)
17831793
if utils.match_response(http_res, "404", "application/json"):
17841794
response_data = unmarshal_json_response(
17851795
errors.NotFoundResponseErrorData, http_res
@@ -2269,6 +2279,11 @@ def bulk_assign_keys(
22692279
errors.UnauthorizedResponseErrorData, http_res
22702280
)
22712281
raise errors.UnauthorizedResponseError(response_data, http_res)
2282+
if utils.match_response(http_res, "403", "application/json"):
2283+
response_data = unmarshal_json_response(
2284+
errors.ForbiddenResponseErrorData, http_res
2285+
)
2286+
raise errors.ForbiddenResponseError(response_data, http_res)
22722287
if utils.match_response(http_res, "404", "application/json"):
22732288
response_data = unmarshal_json_response(
22742289
errors.NotFoundResponseErrorData, http_res
@@ -2414,6 +2429,11 @@ async def bulk_assign_keys_async(
24142429
errors.UnauthorizedResponseErrorData, http_res
24152430
)
24162431
raise errors.UnauthorizedResponseError(response_data, http_res)
2432+
if utils.match_response(http_res, "403", "application/json"):
2433+
response_data = unmarshal_json_response(
2434+
errors.ForbiddenResponseErrorData, http_res
2435+
)
2436+
raise errors.ForbiddenResponseError(response_data, http_res)
24172437
if utils.match_response(http_res, "404", "application/json"):
24182438
response_data = unmarshal_json_response(
24192439
errors.NotFoundResponseErrorData, http_res

‎uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)