diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ce9a906e8..96b34bcac 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: 7f8b1aa33038faeebc0a400db6f92c1d + docChecksum: 329734feca974c9af4144746bd149689 docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.183 - configChecksum: db6042bc8a7fc374e95f7bd95037f820 + releaseVersion: 1.3.184 + configChecksum: fc7db2dc2dd88e5c3b32a6d8d74409d5 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 822acc7e-2e5d-40ea-9aeb-915a6c080136 - pristine_commit_hash: b3a3a2effb2c7695e276f450b4948cb6713b0fb8 - pristine_tree_hash: 6b4ae1092de6f09cef3eed145f5c2371509e59b4 + generation_id: b1a8a3a5-28aa-4a97-95a1-571cc09bd3db + pristine_commit_hash: 7445e113510a2e567eb7a7cdae4145be662cd7f4 + pristine_tree_hash: dbb4084b0b5fab948cdf0c40d911738c728d2749 features: python: acceptHeaders: 3.0.0 @@ -11524,8 +11524,8 @@ trackedFiles: pristine_git_object: ccdae17cd63930fb0d65fe1171735373c233e38b docs/sdks/apikeys/README.mdx: id: 27fcaae1c346 - last_write_checksum: sha1:0b5ed3f2c7273047e472fe10da442706cfec9504 - pristine_git_object: c57d9d064d27b93eee0d99f597c6f7785c27503b + last_write_checksum: sha1:a27e7a3f00c9e51019301f4c67099aa8dd1cf397 + pristine_git_object: 070e0c9100460700192c8658676671f931949fa6 docs/sdks/batch/README.mdx: id: e367aa4f4295 last_write_checksum: sha1:e64f336f38e4d0f8fd3ca26d324aecf66f5076ca @@ -11680,8 +11680,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:aef33794899ae5ac37fd27e773bfda692a5d738d - pristine_git_object: c79e10db0e0074b3719a182b0411f2df7519746f + last_write_checksum: sha1:c90dc0eb350e122b849bd89a0ceac03f99e02edb + pristine_git_object: 0807489a62013955b5755f21f6c71d794dc91cc2 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -11708,8 +11708,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:367fe6441c8066fb40a0e8fce8293d655ef9fa2b - pristine_git_object: feaa1e5a220a3812da215a9b5c933a2982a7a2e0 + last_write_checksum: sha1:765e64372cbcfab0769279442f0941145cf95242 + pristine_git_object: 6b34a5c63943f70b34badded0ca9193d0d961145 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -11720,8 +11720,8 @@ trackedFiles: pristine_git_object: 6dc3ecedfec396bd5a0f46c89178563f84c72dd7 src/openrouter/api_keys.py: id: 876fac88fff6 - last_write_checksum: sha1:f2ec48a54a682e5d3474e5f9809f66f287d690e2 - pristine_git_object: 9c0180614cfceec282a805ffa569840decedeb8a + last_write_checksum: sha1:4956d622986029e5f89f8a47b6b1980ff34b28d7 + pristine_git_object: 359f989def88f0223607d332bf3d72693fc3e78c src/openrouter/basesdk.py: id: c5733c5a1e12 last_write_checksum: sha1:65769ff2cb5473f85b364c6213a0ddc8c68644ea @@ -21719,3 +21719,6 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 +releaseNotes: | + ## Python SDK Changes: + * `open_router.api_keys.list()`: `request` **Changed** (Breaking ⚠️) diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 44ac5132a..cb3387e4b 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.183 + version: 1.3.184 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 934836177..191c83f92 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -51133,6 +51133,7 @@ paths: summary: 'List API keys' tags: - 'API Keys' + x-speakeasy-max-method-params: 5 x-speakeasy-name-override: 'list' x-speakeasy-pagination: inputs: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 4f896d855..587755032 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:33e4fbee849b5eeaa7595a578af7425391298cc7b01009fff88e68cb2c973aaf - sourceBlobDigest: sha256:18212fccb77e98f31f79cf1e11223aa33692f5105bdd30a81c332153db11789b + sourceRevisionDigest: sha256:e03a89ad7cda8391ea2f72c97b127aabf29cae7c1637c1bccc967b78902ec4a7 + sourceBlobDigest: sha256:28d7010dc24ee9c307a8271fffc452c0204c0ece7b363e756d3969ffb612a0bc tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:33e4fbee849b5eeaa7595a578af7425391298cc7b01009fff88e68cb2c973aaf - sourceBlobDigest: sha256:18212fccb77e98f31f79cf1e11223aa33692f5105bdd30a81c332153db11789b + sourceRevisionDigest: sha256:e03a89ad7cda8391ea2f72c97b127aabf29cae7c1637c1bccc967b78902ec4a7 + sourceBlobDigest: sha256:28d7010dc24ee9c307a8271fffc452c0204c0ece7b363e756d3969ffb612a0bc codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:cf46cf2dca74cca00068c77d4022ffebbdb7e6cda374a77dc434b70dd34fc361 + codeSamplesRevisionDigest: sha256:8126f8b55d107e9dc94923721bc20e807893c7cf009a29446cc666cd7a6b7dbb workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 43818ffbc..ec91e208b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4599,4 +4599,14 @@ Based on: ### Generated - [python v1.3.183] . ### Releases -- [PyPI v1.3.183] https://pypi.org/project/openrouter/1.3.183 - . \ No newline at end of file +- [PyPI v1.3.183] https://pypi.org/project/openrouter/1.3.183 - . + +## 2026-11-17 18:23:04 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.184] . +### Releases +- [PyPI v1.3.184] https://pypi.org/project/openrouter/1.3.184 - . \ No newline at end of file diff --git a/docs/sdks/apikeys/README.mdx b/docs/sdks/apikeys/README.mdx index c57d9d064..070e0c910 100644 --- a/docs/sdks/apikeys/README.mdx +++ b/docs/sdks/apikeys/README.mdx @@ -91,16 +91,10 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `http_referer` | *Optional[str]* | ➖ | 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.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `include_disabled` | *Optional[bool]* | ➖ | Whether to include disabled API keys in the response | false | -| `include_expired` | *Optional[bool]* | ➖ | Whether to include expired API keys in the response. Expired keys are excluded by default and returned only when this is true. | false | -| `offset` | *OptionalNullable[int]* | ➖ | Number of API keys to skip for pagination | 0 | -| `workspace_id` | *Optional[str]* | ➖ | Filter API keys by workspace ID. By default an organization-scoped management key gets the default workspace; a workspace-scoped management key always gets its own workspace and cannot list another. | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [operations.ListRequest](../../operations/listrequest.mdx) | ✔️ | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | ### Response diff --git a/pyproject.toml b/pyproject.toml index c79e10db0..0807489a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.183" +version = "1.3.184" 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 feaa1e5a2..6b34a5c63 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.183" +__version__: str = "1.3.184" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.183 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.184 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/api_keys.py b/src/openrouter/api_keys.py index 9c0180614..359f989de 100644 --- a/src/openrouter/api_keys.py +++ b/src/openrouter/api_keys.py @@ -5,10 +5,10 @@ from jsonpath import JSONPath from openrouter import components, errors, operations, utils from openrouter._hooks import HookContext -from openrouter.types import OptionalNullable, UNSET +from openrouter.types import BaseModel, OptionalNullable, UNSET from openrouter.utils import get_security_from_env from openrouter.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Awaitable, Dict, List, Mapping, Optional, Union +from typing import Any, Awaitable, Dict, List, Mapping, Optional, Union, cast class APIKeys(BaseSDK): @@ -257,13 +257,9 @@ async def get_current_key_metadata_async( def list( self, *, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - include_disabled: Optional[bool] = None, - include_expired: Optional[bool] = None, - offset: OptionalNullable[int] = UNSET, - workspace_id: Optional[str] = None, + request: Union[ + operations.ListRequest, operations.ListRequestTypedDict + ] = operations.ListRequest(), retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -273,17 +269,7 @@ def list( List all API keys for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. - :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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param include_disabled: Whether to include disabled API keys in the response - :param include_expired: Whether to include expired API keys in the response. Expired keys are excluded by default and returned only when this is true. - :param offset: Number of API keys to skip for pagination - :param workspace_id: Filter API keys by workspace ID. By default an organization-scoped management key gets the default workspace; a workspace-scoped management key always gets its own workspace and cannot list another. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -299,15 +285,9 @@ def list( else: base_url = self._get_url(base_url, url_variables) - request = operations.ListRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - include_disabled=include_disabled, - include_expired=include_expired, - offset=offset, - workspace_id=workspace_id, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListRequest) + request = cast(operations.ListRequest, request) req = self._build_request( method="GET", @@ -373,13 +353,15 @@ def next_func() -> Optional[operations.ListResponse]: next_offset = offset + len(results[0]) return self.list( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - include_disabled=include_disabled, - include_expired=include_expired, - offset=next_offset, - workspace_id=workspace_id, + request=operations.ListRequest( + http_referer=request.http_referer, + x_open_router_title=request.x_open_router_title, + x_open_router_categories=request.x_open_router_categories, + include_disabled=request.include_disabled, + include_expired=request.include_expired, + offset=next_offset, + workspace_id=request.workspace_id, + ), retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -438,13 +420,9 @@ def next_func() -> Optional[operations.ListResponse]: async def list_async( self, *, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - include_disabled: Optional[bool] = None, - include_expired: Optional[bool] = None, - offset: OptionalNullable[int] = UNSET, - workspace_id: Optional[str] = None, + request: Union[ + operations.ListRequest, operations.ListRequestTypedDict + ] = operations.ListRequest(), retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -454,17 +432,7 @@ async def list_async( List all API keys for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. - :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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param include_disabled: Whether to include disabled API keys in the response - :param include_expired: Whether to include expired API keys in the response. Expired keys are excluded by default and returned only when this is true. - :param offset: Number of API keys to skip for pagination - :param workspace_id: Filter API keys by workspace ID. By default an organization-scoped management key gets the default workspace; a workspace-scoped management key always gets its own workspace and cannot list another. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -480,15 +448,9 @@ async def list_async( else: base_url = self._get_url(base_url, url_variables) - request = operations.ListRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - include_disabled=include_disabled, - include_expired=include_expired, - offset=offset, - workspace_id=workspace_id, - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListRequest) + request = cast(operations.ListRequest, request) req = self._build_request_async( method="GET", @@ -557,13 +519,15 @@ async def empty_result(): next_offset = offset + len(results[0]) return self.list_async( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - include_disabled=include_disabled, - include_expired=include_expired, - offset=next_offset, - workspace_id=workspace_id, + request=operations.ListRequest( + http_referer=request.http_referer, + x_open_router_title=request.x_open_router_title, + x_open_router_categories=request.x_open_router_categories, + include_disabled=request.include_disabled, + include_expired=request.include_expired, + offset=next_offset, + workspace_id=request.workspace_id, + ), retries=retries, server_url=server_url, timeout_ms=timeout_ms, diff --git a/uv.lock b/uv.lock index 8fd819e2d..5732e88d2 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.183" +version = "1.3.184" source = { editable = "." } dependencies = [ { name = "httpcore" },