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
47 changes: 32 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: dd844eac13f976ba74b21b1e501372a5
docChecksum: e26b8aa17f6f45241fc4951237a29000
docVersion: 1.0.0
speakeasyVersion: 1.787.0
generationVersion: 2.914.0
releaseVersion: 1.3.18
configChecksum: eaeed3df3e4e78face49fcef6e620417
releaseVersion: 1.3.19
configChecksum: 87456f6f148d309df07e48d003860def
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
generation_id: fcc256d0-08e9-439d-baaf-2ce814fe36c9
pristine_commit_hash: 914891a5475c37ce0ebcb5ea12e09d9c508df8c3
pristine_tree_hash: ca77f14e6c48730bdad24a1ccdfb1358445e29b2
generation_id: 8bdc1dba-e817-48bc-8ab2-77ad1ab37468
pristine_commit_hash: 20353418b707d78c5ea6272809f71158c666a268
pristine_tree_hash: cf8aee80660bf4495a3d3312432f0d9300445178
features:
python:
acceptHeaders: 3.0.0
Expand Down Expand Up @@ -9800,8 +9800,8 @@ trackedFiles:
pristine_git_object: c1634706646332455817340f5891b4b5c9c6d16c
docs/sdks/apikeys/README.mdx:
id: 27fcaae1c346
last_write_checksum: sha1:3b8ddf3e038f2dc75d60c4936f270543950020a2
pristine_git_object: 05cb8497207bd506ac4d84c53a5977e110114806
last_write_checksum: sha1:40f52532a5846a5ef9fd20f3ddf00448a15e0890
pristine_git_object: 0c76b2d59bd6a8956de83eb064c6205fcedae331
docs/sdks/batch/README.mdx:
id: e367aa4f4295
last_write_checksum: sha1:7e385b464cd4f95f6bbe7454e99a412041017ac7
Expand Down Expand Up @@ -9948,8 +9948,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
last_write_checksum: sha1:e66a3439925efa1634896c19c538834f67f793ca
pristine_git_object: b76990ff27d4979ff3b6ec1cf668193b6d3b93df
last_write_checksum: sha1:6478300ed0220742fd001e94ac77e058cf94dbf1
pristine_git_object: 33abb1bc7c1bfe2d3c5323de18901698616b91fb
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
Expand All @@ -9976,8 +9976,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py:
id: d8d15ad6c586
last_write_checksum: sha1:a867b35b239e6ccc11812f193e14e29eccacf0c6
pristine_git_object: 70d4881e1a86b1641e4821f1d2ef8729cbc0b656
last_write_checksum: sha1:9aaa05abbad118e10741d8e7a6dd24396fd2a45a
pristine_git_object: 5020f4771011c5e9d1b51dca9a739b27cb6fdc80
src/openrouter/alpha.py:
id: 306c4d93308d
last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a
Expand All @@ -9988,8 +9988,8 @@ trackedFiles:
pristine_git_object: 9587309db4d5e25a00131a48788456139c25e4c0
src/openrouter/api_keys.py:
id: 876fac88fff6
last_write_checksum: sha1:5c198eef830a56d6030573a073bf0e349a0d8289
pristine_git_object: 94dd64726b491afb7913f00e8c90d94ef58d1115
last_write_checksum: sha1:40921c10e77aceb82de5eaf1470975e9593eaf3f
pristine_git_object: 7647d4bc7dfba28a1d8d31c66c1d4331f37b139c
src/openrouter/basesdk.py:
id: c5733c5a1e12
last_write_checksum: sha1:65769ff2cb5473f85b364c6213a0ddc8c68644ea
Expand Down Expand Up @@ -14651,6 +14651,24 @@ examples:
application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}}
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
invalid_parameters:
parameters:
path:
hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943"
requestBody:
application/json: {}
responses:
"400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
no_update_fields:
parameters:
path:
hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943"
requestBody:
application/json: {}
responses:
"400":
application/json: {"error": {"code": 400, "message": "No update fields provided"}}
deleteKeys:
speakeasy-default-delete-keys:
parameters:
Expand Down Expand Up @@ -18224,4 +18242,3 @@ examples:
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
examplesVersion: 1.0.2
releaseNotes: "## Python SDK Changes:\n* `open_router.images.generate()`: \n * `request.resolution.enum(1.5k)` **Added**\n"
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.3.18
version: 1.3.19
additionalDependencies:
dev: {}
main: {}
Expand Down
20 changes: 15 additions & 5 deletions .speakeasy/out.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43974,7 +43974,7 @@ paths:
- 'API Keys'
x-speakeasy-name-override: 'get'
patch:
description: 'Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys).'
description: "Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys).\n\n<Warning>\nYou can't change `workspace_id` through the API. The request body accepts only the fields listed below, and unrecognized fields are ignored. To move a key to another workspace, use the OpenRouter dashboard. If the body contains none of the accepted fields, the request fails with `400` and the message `No update fields provided`.\n</Warning>"
operationId: 'updateKeys'
parameters:
- description: 'The hash identifier of the API key to update'
Expand Down Expand Up @@ -44257,10 +44257,20 @@ paths:
'400':
content:
application/json:
example:
error:
code: 400
message: 'Invalid request parameters'
examples:
invalid_parameters:
summary: 'Invalid request parameters'
value:
error:
code: 400
message: 'Invalid request parameters'
no_update_fields:
description: 'Returned when the body contains none of the accepted fields, for example `{"workspace_id": "..."}`. `workspace_id` can''t be changed through the API.'
summary: 'No accepted fields in the request body'
value:
error:
code: 400
message: 'No update fields provided'
schema:
$ref: '#/components/schemas/BadRequestResponse'
description: 'Bad Request - Invalid request parameters or malformed input'
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:a2fb53173f0847a6b6729eca0d73d0690987533ee30075a5212d7ac03f152830
sourceBlobDigest: sha256:9a886d465d8ca1bbc7393650bea8ce94d547f54e5fe77dba77be5035fd6a793d
sourceRevisionDigest: sha256:228bbd13e686a285629ab31d64197c92d3975830d39dba91163445d623d64a2d
sourceBlobDigest: sha256:160a74c1c4af1037a6734cd8af4f548caec7a4faa975b242ee4119a4b81fd0c6
tags:
- latest
- 1.0.0
targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:a2fb53173f0847a6b6729eca0d73d0690987533ee30075a5212d7ac03f152830
sourceBlobDigest: sha256:9a886d465d8ca1bbc7393650bea8ce94d547f54e5fe77dba77be5035fd6a793d
sourceRevisionDigest: sha256:228bbd13e686a285629ab31d64197c92d3975830d39dba91163445d623d64a2d
sourceBlobDigest: sha256:160a74c1c4af1037a6734cd8af4f548caec7a4faa975b242ee4119a4b81fd0c6
codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:326882ce35a53ebbcff4f5191e760daf76f5d8001826f8d943e3a23b3e3c38ba
codeSamplesRevisionDigest: sha256:8fd3208e5a389f6b3b7a4f9a0d23dad49e49c194a0ff83d30d6456c74202f36f
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 @@ -2949,4 +2949,14 @@ Based on:
### Generated
- [python v1.3.18] .
### Releases
- [PyPI v1.3.18] https://pypi.org/project/openrouter/1.3.18 - .
- [PyPI v1.3.18] https://pypi.org/project/openrouter/1.3.18 - .

## 2026-10-01 21:32:05
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v1.3.19] .
### Releases
- [PyPI v1.3.19] https://pypi.org/project/openrouter/1.3.19 - .
28 changes: 26 additions & 2 deletions docs/sdks/apikeys/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,31 @@ with OpenRouter(

Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys).

### Example Usage
\<Warning>
You can't change `workspace_id` through the API. The request body accepts only the fields listed below, and unrecognized fields are ignored. To move a key to another workspace, use the OpenRouter dashboard. If the body contains none of the accepted fields, the request fails with `400` and the message `No update fields provided`.
</Warning>

### Example Usage: invalid_parameters

```python
from openrouter import OpenRouter
import os


with OpenRouter(
http_referer="<value>",
x_open_router_title="<value>",
x_open_router_categories="<value>",
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:

res = open_router.api_keys.update(hash="f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943")

# Handle response
print(res)

```
### Example Usage: no_update_fields

```python
from openrouter import OpenRouter
Expand All @@ -287,7 +311,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:

res = open_router.api_keys.update(hash="f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", disabled=False, include_byok_in_limit=True, limit=75, limit_reset="daily", name="Updated API Key Name")
res = open_router.api_keys.update(hash="f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943")

# Handle response
print(res)
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.3.18"
version = "1.3.19"
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.3.18"
__version__: str = "1.3.19"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.914.0"
__user_agent__: str = "speakeasy-sdk/python 1.3.18 2.914.0 1.0.0 openrouter"
__user_agent__: str = "speakeasy-sdk/python 1.3.19 2.914.0 1.0.0 openrouter"

try:
if __package__ is not None:
Expand Down
8 changes: 8 additions & 0 deletions src/openrouter/api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,10 @@ def update(

Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys).

<Warning>
You can't change `workspace_id` through the API. The request body accepts only the fields listed below, and unrecognized fields are ignored. To move a key to another workspace, use the OpenRouter dashboard. If the body contains none of the accepted fields, the request fails with `400` and the message `No update fields provided`.
</Warning>

:param hash: The hash identifier of the API key to update
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
Expand Down Expand Up @@ -1590,6 +1594,10 @@ async def update_async(

Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys).

<Warning>
You can't change `workspace_id` through the API. The request body accepts only the fields listed below, and unrecognized fields are ignored. To move a key to another workspace, use the OpenRouter dashboard. If the body contains none of the accepted fields, the request fails with `400` and the message `No update fields provided`.
</Warning>

:param hash: The hash identifier of the API key to update
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
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