Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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**
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
version: 1.1.143
version: 1.1.144
additionalDependencies:
dev: {}
main: {}
Expand Down
22 changes: 21 additions & 1 deletion .speakeasy/out.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ 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
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
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2219,4 +2219,14 @@ Based on:
### Generated
- [python v1.1.143] .
### Releases
- [PyPI v1.1.143] https://pypi.org/project/openrouter/1.1.143 - .
- [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 - .
2 changes: 2 additions & 0 deletions docs/sdks/guardrails/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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 | \*/\* |
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/openrouter/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 20 additions & 0 deletions src/openrouter/guardrails.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading