diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a6204805..f0d2748c 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: 74c0bf30bff3fde3c6830e3f608d065e + docChecksum: 96232da04228ca818101a294545ecf0b docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.76 - configChecksum: c282f0cacbf8f58a58799ae5e22760ca + releaseVersion: 1.1.77 + configChecksum: 7448f44d4eeacd36dc8acb9ab0a7fbeb repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 1e1e5fdc-52d4-4884-b0a8-02708bf27e41 - pristine_commit_hash: cc998fb17a324275bcb922aad20aac8b6eaedc60 - pristine_tree_hash: 16561d398379783b95c2157b86604e2536ee1f90 + generation_id: 47cbdda2-41a7-40ea-b4c4-d1ca30637c45 + pristine_commit_hash: 2e1498b0c5c1cdf53e7aac3825ca32865600fd72 + pristine_tree_hash: abeba3af2c23d395684bbb24336dd97d08016cb0 features: python: acceptHeaders: 3.0.0 @@ -6090,8 +6090,8 @@ trackedFiles: pristine_git_object: 9ec01bf61826e888c544e698af19baaa8c51980a docs/operations/createkeysrequestbody.mdx: id: 77bb49febf62 - last_write_checksum: sha1:6f150fbcbab58887eeaa41b37f2c511b6ec60879 - pristine_git_object: 37ca00af34f104adb27c9675861130e30fcca1be + last_write_checksum: sha1:6213dff2e8fefca272475c4ec539d346a9b4ec4b + pristine_git_object: a9d4386580047bb51b7aaffe9cc39d7ae51484a7 docs/operations/createkeysresponse.mdx: id: 08e825fab080 last_write_checksum: sha1:ecbb7dd123519f348339649a9f038d44c24d12d6 @@ -7238,8 +7238,8 @@ trackedFiles: pristine_git_object: c1634706646332455817340f5891b4b5c9c6d16c docs/sdks/apikeys/README.mdx: id: 27fcaae1c346 - last_write_checksum: sha1:b8bd517a7a2960d003ab350130008b402927af6b - pristine_git_object: c8541c5c189bae01e80db73fd88767391d7dbb9b + last_write_checksum: sha1:9b13c67de67288664d9a4547d2a8301481d70741 + pristine_git_object: 2e4066d36efa1c22443d7419546dfb3e99045cdf docs/sdks/benchmarks/README.mdx: id: 5b483a6770ba last_write_checksum: sha1:885b70fcbd2be60f51a2f58e133fd6452eb21600 @@ -7354,8 +7354,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:106ec011c72b0b8e0f336c1e628e3f9664aa29e5 - pristine_git_object: 6d77f0fc48caedbbe5c0a4abff409bdfc7e769c3 + last_write_checksum: sha1:c8511c58b2809c050315c495505344bab04792a9 + pristine_git_object: f242cc052d73c451de2de69a6df515e90cdf4838 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7382,16 +7382,16 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:e2caf13be4cb8b4f3c6055f0f45384eb9f1d40b2 - pristine_git_object: ba614265f77e96a5b108051c122c5c7d0c4ec15c + last_write_checksum: sha1:861e228e709562b43a34f26b4f82024aaaa41db7 + pristine_git_object: 5d2ba9222d03dee629788bd7a5766c37ef466e9c src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9 pristine_git_object: 9587309db4d5e25a00131a48788456139c25e4c0 src/openrouter/api_keys.py: id: 876fac88fff6 - last_write_checksum: sha1:ada03aff96976f0570e594a3143595c25ca05f18 - pristine_git_object: dec0852524b4b59e697be154204a726ad6afbdbc + last_write_checksum: sha1:e31fbde103e262986c006b01d7cc1f32a3ba5b82 + pristine_git_object: 28c0c7fbf9268e4f5c0f9dc84dad710e919d9fb2 src/openrouter/basesdk.py: id: c5733c5a1e12 last_write_checksum: sha1:65769ff2cb5473f85b364c6213a0ddc8c68644ea @@ -10098,8 +10098,8 @@ trackedFiles: pristine_git_object: 8216a656ec1412a034878e257bd9de9e94fa8da1 src/openrouter/operations/createkeys.py: id: 64ad31fdaa6c - last_write_checksum: sha1:1a2ca941bdd6ba1ca36ed801469564c5ae886e83 - pristine_git_object: aea3bdb497d2d0bc6d38bc8858eaccd15b3532fb + last_write_checksum: sha1:2c18814f8b05cc2143dbcec433d82471912bbcda + pristine_git_object: 027f7c8d7521396a4f37483bd0684609be05beee src/openrouter/operations/createobservabilitydestination.py: id: ce29c303fb0d last_write_checksum: sha1:b9dfa5198721adbca45f48b7fb632bee09780fff @@ -12382,4 +12382,6 @@ examples: "503": application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.containers.list_container_files()`: `request` **Changed** (Breaking ⚠️)\n* `open_router.containers.get_container_file()`: `request` **Changed** (Breaking ⚠️)\n* `open_router.containers.download_container_file_content()`: `request` **Changed** (Breaking ⚠️)\n* `open_router.presets.create_presets_messages()`: \n * `request.messages[].content.union(Array<>)[]` **Changed**\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[]` **Changed**\n* `open_router.responses.send()`: \n * `request.input.union(Array<>)[]` **Changed**\n * `response` **Changed**\n* `open_router.beta.responses.send()`: \n * `request.input.union(Array<>)[]` **Changed**\n * `response` **Changed**\n" +releaseNotes: | + ## Python SDK Changes: + * `open_router.api_keys.create()`: `request.external_api_key` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index cb75312c..62df417f 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.76 + version: 1.1.77 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 0c92cdd4..07cae743 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -33797,6 +33797,11 @@ paths: type: - 'string' - 'null' + external_api_key: + description: 'Optional partner-supplied API key. Stored as a SHA-256 hash and never returned. Accepted only when authenticating with a Connect client secret.' + maxLength: 512 + minLength: 1 + type: 'string' include_byok_in_limit: description: 'Whether to include BYOK usage in the limit' example: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 3a64ab77..7adc5af3 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:7b4e8be79ce173cf2faa1976c20c00950860794151e639da897ccbdc572931ac - sourceBlobDigest: sha256:e03d85f26ff90565812046a26f9039130ee61f109a1294e40c69b05df64d6955 + sourceRevisionDigest: sha256:5322c0f83fc765da9e7910255d7df76ec493d94d5c548b6b9ebb87a26d022b51 + sourceBlobDigest: sha256:1089499afd1bcc97d0a6ec8b6141196838612da5f643a5691211ad9875906e32 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:7b4e8be79ce173cf2faa1976c20c00950860794151e639da897ccbdc572931ac - sourceBlobDigest: sha256:e03d85f26ff90565812046a26f9039130ee61f109a1294e40c69b05df64d6955 + sourceRevisionDigest: sha256:5322c0f83fc765da9e7910255d7df76ec493d94d5c548b6b9ebb87a26d022b51 + sourceBlobDigest: sha256:1089499afd1bcc97d0a6ec8b6141196838612da5f643a5691211ad9875906e32 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:b7825e3933569aeb010f4102dfba37d87abee17e7ba96ef800f8c3c411172d81 + codeSamplesRevisionDigest: sha256:2c97d10315126b2f96b73c1db110f1179a1a473fbffb6600f287318402813bf0 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index f23d61a3..f5b527b6 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1549,4 +1549,14 @@ Based on: ### Generated - [python v1.1.76] . ### Releases -- [PyPI v1.1.76] https://pypi.org/project/openrouter/1.1.76 - . \ No newline at end of file +- [PyPI v1.1.76] https://pypi.org/project/openrouter/1.1.76 - . + +## 2026-08-24 07:38:19 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.77] . +### Releases +- [PyPI v1.1.77] https://pypi.org/project/openrouter/1.1.77 - . \ No newline at end of file diff --git a/docs/operations/createkeysrequestbody.mdx b/docs/operations/createkeysrequestbody.mdx index 37ca00af..a9d43865 100644 --- a/docs/operations/createkeysrequestbody.mdx +++ b/docs/operations/createkeysrequestbody.mdx @@ -8,6 +8,7 @@ title: "CreateKeysRequestBody" | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `creator_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key. | user_2dHFtVWx2n56w6HkM0000000000 | | `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected | 2027-12-31T23:59:59Z | +| `external_api_key` | *Optional[str]* | :heavy_minus_sign: | Optional partner-supplied API key. Stored as a SHA-256 hash and never returned. Accepted only when authenticating with a Connect client secret. | | | `include_byok_in_limit` | *Optional[bool]* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true | | `limit` | *OptionalNullable[float]* | :heavy_minus_sign: | Optional spending limit for the API key in USD | 50 | | `limit_reset` | [OptionalNullable[operations.CreateKeysLimitReset]](../operations/createkeyslimitreset.mdx) | :heavy_minus_sign: | Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | monthly | diff --git a/docs/sdks/apikeys/README.mdx b/docs/sdks/apikeys/README.mdx index c8541c5c..2e4066d3 100644 --- a/docs/sdks/apikeys/README.mdx +++ b/docs/sdks/apikeys/README.mdx @@ -149,6 +149,7 @@ with OpenRouter( | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `creator_user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key. | user_2dHFtVWx2n56w6HkM0000000000 | | `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected | 2027-12-31T23:59:59Z | +| `external_api_key` | *Optional[str]* | :heavy_minus_sign: | Optional partner-supplied API key. Stored as a SHA-256 hash and never returned. Accepted only when authenticating with a Connect client secret. | | | `include_byok_in_limit` | *Optional[bool]* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true | | `limit` | *OptionalNullable[float]* | :heavy_minus_sign: | Optional spending limit for the API key in USD | 50 | | `limit_reset` | [OptionalNullable[operations.CreateKeysLimitReset]](../../operations/createkeyslimitreset.mdx) | :heavy_minus_sign: | Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | monthly | diff --git a/pyproject.toml b/pyproject.toml index 6d77f0fc..f242cc05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.76" +version = "1.1.77" 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 ba614265..5d2ba922 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.76" +__version__: str = "1.1.77" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.76 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.77 2.914.0 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 dec08525..28c0c7fb 100644 --- a/src/openrouter/api_keys.py +++ b/src/openrouter/api_keys.py @@ -540,6 +540,7 @@ def create( x_open_router_categories: Optional[str] = None, creator_user_id: OptionalNullable[str] = UNSET, expires_at: OptionalNullable[datetime] = UNSET, + external_api_key: Optional[str] = None, include_byok_in_limit: Optional[bool] = None, limit: OptionalNullable[float] = UNSET, limit_reset: OptionalNullable[operations.CreateKeysLimitReset] = UNSET, @@ -563,6 +564,7 @@ def create( :param creator_user_id: Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key. :param expires_at: Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected + :param external_api_key: Optional partner-supplied API key. Stored as a SHA-256 hash and never returned. Accepted only when authenticating with a Connect client secret. :param include_byok_in_limit: Whether to include BYOK usage in the limit :param limit: Optional spending limit for the API key in USD :param limit_reset: Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. @@ -589,6 +591,7 @@ def create( request_body=operations.CreateKeysRequestBody( creator_user_id=creator_user_id, expires_at=expires_at, + external_api_key=external_api_key, include_byok_in_limit=include_byok_in_limit, limit=limit, limit_reset=limit_reset, @@ -705,6 +708,7 @@ async def create_async( x_open_router_categories: Optional[str] = None, creator_user_id: OptionalNullable[str] = UNSET, expires_at: OptionalNullable[datetime] = UNSET, + external_api_key: Optional[str] = None, include_byok_in_limit: Optional[bool] = None, limit: OptionalNullable[float] = UNSET, limit_reset: OptionalNullable[operations.CreateKeysLimitReset] = UNSET, @@ -728,6 +732,7 @@ async def create_async( :param creator_user_id: Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key. :param expires_at: Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected + :param external_api_key: Optional partner-supplied API key. Stored as a SHA-256 hash and never returned. Accepted only when authenticating with a Connect client secret. :param include_byok_in_limit: Whether to include BYOK usage in the limit :param limit: Optional spending limit for the API key in USD :param limit_reset: Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. @@ -754,6 +759,7 @@ async def create_async( request_body=operations.CreateKeysRequestBody( creator_user_id=creator_user_id, expires_at=expires_at, + external_api_key=external_api_key, include_byok_in_limit=include_byok_in_limit, limit=limit, limit_reset=limit_reset, diff --git a/src/openrouter/operations/createkeys.py b/src/openrouter/operations/createkeys.py index aea3bdb4..027f7c8d 100644 --- a/src/openrouter/operations/createkeys.py +++ b/src/openrouter/operations/createkeys.py @@ -99,6 +99,8 @@ class CreateKeysRequestBodyTypedDict(TypedDict): r"""Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key.""" expires_at: NotRequired[Nullable[datetime]] r"""Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected""" + external_api_key: NotRequired[str] + r"""Optional partner-supplied API key. Stored as a SHA-256 hash and never returned. Accepted only when authenticating with a Connect client secret.""" include_byok_in_limit: NotRequired[bool] r"""Whether to include BYOK usage in the limit""" limit: NotRequired[Nullable[float]] @@ -119,6 +121,9 @@ class CreateKeysRequestBody(BaseModel): expires_at: OptionalNullable[datetime] = UNSET r"""Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected""" + external_api_key: Optional[str] = None + r"""Optional partner-supplied API key. Stored as a SHA-256 hash and never returned. Accepted only when authenticating with a Connect client secret.""" + include_byok_in_limit: Optional[bool] = None r"""Whether to include BYOK usage in the limit""" @@ -137,6 +142,7 @@ def serialize_model(self, handler): [ "creator_user_id", "expires_at", + "external_api_key", "include_byok_in_limit", "limit", "limit_reset", diff --git a/uv.lock b/uv.lock index 553872d2..995d3cba 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.76" +version = "1.1.77" source = { editable = "." } dependencies = [ { name = "httpcore" },