diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 7ffba279..7a8c7157 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: 758ef63a0a08383540ea8dad373f870a + docChecksum: 6347bd6ad6ee679ead12c88b6d9412a3 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.116 - configChecksum: 99dc42c14b3050cf1a52fb4239b25558 + releaseVersion: 1.1.117 + configChecksum: c142c0cf39fae8ab675c3e1cf39b3127 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 6bfdd5aa-7fe3-49f5-b6e1-be62fb470be6 - pristine_commit_hash: 7b309bbd8b47f3279f989ee1fc72d4b11f98f6d6 - pristine_tree_hash: d1ad592a96d37e0a74bfe99f72340279fb64eeb1 + generation_id: 3a52b6a9-d466-42bd-bd76-a8ecef45b80b + pristine_commit_hash: ff88e61e0f61836ced5c04e832f14351e8eabc70 + pristine_tree_hash: c99193b692faf367347038de098f1fe96d857196 features: python: acceptHeaders: 3.0.0 @@ -6198,8 +6198,8 @@ trackedFiles: pristine_git_object: 9ec01bf61826e888c544e698af19baaa8c51980a docs/operations/createkeysrequestbody.mdx: id: 77bb49febf62 - last_write_checksum: sha1:5a335a3de3bbf451fb9d1d0fe06e9d147385f96a - pristine_git_object: f992b9a611c081732503a0046f7f60059013bc66 + last_write_checksum: sha1:4281640ddfeb7fadc0b40c1e5798f0f33f5c4536 + pristine_git_object: 03d2690cbbd53496929b2ccd879640e95a6e70ed docs/operations/createkeysresponse.mdx: id: 08e825fab080 last_write_checksum: sha1:268c49a74956884d1e3b3495fdf6ee6c7383e323 @@ -7354,8 +7354,8 @@ trackedFiles: pristine_git_object: c1634706646332455817340f5891b4b5c9c6d16c docs/sdks/apikeys/README.mdx: id: 27fcaae1c346 - last_write_checksum: sha1:29934f02f5ffec56b4f4cf6c188dbd0bb4aee1c8 - pristine_git_object: 3e9c14ec4293b27570c752f027cf46d60e344054 + last_write_checksum: sha1:7a69e05e81dcd98f56875f9e98e9af5047ec3a32 + pristine_git_object: b1ed0d38565e444b87a7c64c4675a888c00ea9ea docs/sdks/benchmarks/README.mdx: id: 5b483a6770ba last_write_checksum: sha1:885b70fcbd2be60f51a2f58e133fd6452eb21600 @@ -7470,8 +7470,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:caebdc04bcc0970785075f14c8018496682d6897 - pristine_git_object: 200d9497c1138fd059d0219059aa3b78bf7d2f7b + last_write_checksum: sha1:88eb79aeaf2e388babc8e9ef2d78be4699f94b7a + pristine_git_object: 468c99cf3ed4c3d4f66aa5873daf8628835373b5 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7498,16 +7498,16 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:f85ecfa87ecdc756830e9f82b5afbf7d3f76da62 - pristine_git_object: dcb7ae847df12211f68468b2539a966633c180dc + last_write_checksum: sha1:bde1522891c6783143d2a874d1b4e0db642dfcca + pristine_git_object: 7e31b70a8b76efd9b6ce6ee29f9f9d5bfd17edff 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:23c65a3aed7816e6491bb85fd01078317146ebbc - pristine_git_object: f3e2342941ca31703a3a42e9239c8505acdf1790 + last_write_checksum: sha1:ea783a6c3f2fa4478fbccf41bb8eddf8c638cff6 + pristine_git_object: 9f12e9eb70e531679af1f3d64c081aec4b961853 src/openrouter/basesdk.py: id: c5733c5a1e12 last_write_checksum: sha1:65769ff2cb5473f85b364c6213a0ddc8c68644ea @@ -10238,8 +10238,8 @@ trackedFiles: pristine_git_object: 8216a656ec1412a034878e257bd9de9e94fa8da1 src/openrouter/operations/createkeys.py: id: 64ad31fdaa6c - last_write_checksum: sha1:d4b0e625de23fd88a5d03670356dc13547443cd1 - pristine_git_object: 07c74007cee1555d8e5cdb6caaec6627f23778d5 + last_write_checksum: sha1:146edc8153a6ee74f1b8a6cdbd2a6c91733f11d8 + pristine_git_object: 510645f76bbdcc2a8f754f5527d14ae3d0a5a16c src/openrouter/operations/createobservabilitydestination.py: id: ce29c303fb0d last_write_checksum: sha1:b9dfa5198721adbca45f48b7fb632bee09780fff @@ -12579,6 +12579,4 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Python SDK Changes: - * `open_router.chat.send()`: `response` **Changed** - * `open_router.responses.send()`: `response` **Changed** - * `open_router.beta.responses.send()`: `response` **Changed** + * `open_router.api_keys.create()`: `request` **Changed** (Breaking ⚠️) diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2a9ce9d7..ed82824d 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.116 + version: 1.1.117 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 666a0287..3b8ef995 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -34494,7 +34494,7 @@ paths: - 'API Keys' x-speakeasy-name-override: 'list' post: - description: 'Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. `external_user` and `external_api_key` are accepted only with a client secret, and `external_user` is required there; supplying either field with a management key is rejected with 403.' + description: 'Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret.' operationId: 'createKeys' requestBody: content: @@ -34527,16 +34527,6 @@ 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; supplying it with a management key is rejected with 403.' - maxLength: 512 - minLength: 1 - type: 'string' - external_user: - description: 'Partner''s end-user identifier for attribution, between 1 and 512 characters. Accepted only when authenticating with a Connect client secret, where it is required; supplying it with a management key is rejected with 403.' - 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 35002a06..fa5253fa 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:dc2eed6ab6c7c25270db16f8436fb4268867f0933ce5e808a6767e29dd2e2a57 - sourceBlobDigest: sha256:bf6877bc98c487ec6b18040214be92c5fecf75f0f1c93fe1c5bf29f7066c651d + sourceRevisionDigest: sha256:cff2f8843cab07843b51385e80ec0bedbee73ab8f51fbde0e093c469a3d3b878 + sourceBlobDigest: sha256:aaaf189600f77a1e84c459dfaefa6240d3633c8733c89fcf061d8380d3a2ae1e tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:dc2eed6ab6c7c25270db16f8436fb4268867f0933ce5e808a6767e29dd2e2a57 - sourceBlobDigest: sha256:bf6877bc98c487ec6b18040214be92c5fecf75f0f1c93fe1c5bf29f7066c651d + sourceRevisionDigest: sha256:cff2f8843cab07843b51385e80ec0bedbee73ab8f51fbde0e093c469a3d3b878 + sourceBlobDigest: sha256:aaaf189600f77a1e84c459dfaefa6240d3633c8733c89fcf061d8380d3a2ae1e codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:4336ef86e6030915d783554b9ad9ff251be907e2d92e00fd621db20131c4da9e + codeSamplesRevisionDigest: sha256:f3a3ad0383259e5ab498a11676d33a1bbbaca2e5f401918fff7e37c5d9c2dbad workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 8ecfd6ee..373db0b5 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1949,4 +1949,14 @@ Based on: ### Generated - [python v1.1.116] . ### Releases -- [PyPI v1.1.116] https://pypi.org/project/openrouter/1.1.116 - . \ No newline at end of file +- [PyPI v1.1.116] https://pypi.org/project/openrouter/1.1.116 - . + +## 2026-09-02 19:58:21 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.117] . +### Releases +- [PyPI v1.1.117] https://pypi.org/project/openrouter/1.1.117 - . \ No newline at end of file diff --git a/docs/operations/createkeysrequestbody.mdx b/docs/operations/createkeysrequestbody.mdx index f992b9a6..03d2690c 100644 --- a/docs/operations/createkeysrequestbody.mdx +++ b/docs/operations/createkeysrequestbody.mdx @@ -4,14 +4,12 @@ title: "CreateKeysRequestBody" ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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 expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are 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; supplying it with a management key is rejected with 403. | | -| `external_user` | *Optional[str]* | :heavy_minus_sign: | Partner's end-user identifier for attribution, between 1 and 512 characters. Accepted only when authenticating with a Connect client secret, where it is required; supplying it with a management key is rejected with 403. | | -| `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 | -| `name` | *str* | :heavy_check_mark: | Name for the new API key | My New API Key | -| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | The workspace to create the API key in. Defaults to the default workspace if not provided. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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 expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected. | 2027-12-31T23:59:59Z | +| `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 | +| `name` | *str* | :heavy_check_mark: | Name for the new API key | My New API Key | +| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | The workspace to create the API key in. Defaults to the default workspace if not provided. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/sdks/apikeys/README.mdx b/docs/sdks/apikeys/README.mdx index 3e9c14ec..b1ed0d38 100644 --- a/docs/sdks/apikeys/README.mdx +++ b/docs/sdks/apikeys/README.mdx @@ -115,7 +115,7 @@ with OpenRouter( ## create -Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. `external_user` and `external_api_key` are accepted only with a client secret, and `external_user` is required there; supplying either field with a management key is rejected with 403. +Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. ### Example Usage @@ -141,21 +141,19 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | Name for the new API key | My New API Key | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | 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]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `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 expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are 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; supplying it with a management key is rejected with 403. | | -| `external_user` | *Optional[str]* | :heavy_minus_sign: | Partner's end-user identifier for attribution, between 1 and 512 characters. Accepted only when authenticating with a Connect client secret, where it is required; supplying it with a management key is rejected with 403. | | -| `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 | -| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | The workspace to create the API key in. Defaults to the default workspace if not provided. | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Name for the new API key | My New API Key | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | 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]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `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 expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected. | 2027-12-31T23:59:59Z | +| `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 | +| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | The workspace to create the API key in. Defaults to the default workspace if not provided. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/pyproject.toml b/pyproject.toml index 200d9497..468c99cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.116" +version = "1.1.117" 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 dcb7ae84..7e31b70a 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.116" +__version__: str = "1.1.117" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.116 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.117 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 f3e23429..9f12e9eb 100644 --- a/src/openrouter/api_keys.py +++ b/src/openrouter/api_keys.py @@ -540,8 +540,6 @@ 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, - external_user: Optional[str] = None, include_byok_in_limit: Optional[bool] = None, limit: OptionalNullable[float] = UNSET, limit_reset: OptionalNullable[operations.CreateKeysLimitReset] = UNSET, @@ -553,7 +551,7 @@ def create( ) -> operations.CreateKeysResponse: r"""Create a new API key - Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. `external_user` and `external_api_key` are accepted only with a client secret, and `external_user` is required there; supplying either field with a management key is rejected with 403. + Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. :param name: Name for the new API key :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -565,8 +563,6 @@ 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 expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are 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; supplying it with a management key is rejected with 403. - :param external_user: Partner's end-user identifier for attribution, between 1 and 512 characters. Accepted only when authenticating with a Connect client secret, where it is required; supplying it with a management key is rejected with 403. :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. @@ -593,8 +589,6 @@ def create( request_body=operations.CreateKeysRequestBody( creator_user_id=creator_user_id, expires_at=expires_at, - external_api_key=external_api_key, - external_user=external_user, include_byok_in_limit=include_byok_in_limit, limit=limit, limit_reset=limit_reset, @@ -711,8 +705,6 @@ 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, - external_user: Optional[str] = None, include_byok_in_limit: Optional[bool] = None, limit: OptionalNullable[float] = UNSET, limit_reset: OptionalNullable[operations.CreateKeysLimitReset] = UNSET, @@ -724,7 +716,7 @@ async def create_async( ) -> operations.CreateKeysResponse: r"""Create a new API key - Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. `external_user` and `external_api_key` are accepted only with a client secret, and `external_user` is required there; supplying either field with a management key is rejected with 403. + Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret. :param name: Name for the new API key :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -736,8 +728,6 @@ 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 expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are 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; supplying it with a management key is rejected with 403. - :param external_user: Partner's end-user identifier for attribution, between 1 and 512 characters. Accepted only when authenticating with a Connect client secret, where it is required; supplying it with a management key is rejected with 403. :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. @@ -764,8 +754,6 @@ async def create_async( request_body=operations.CreateKeysRequestBody( creator_user_id=creator_user_id, expires_at=expires_at, - external_api_key=external_api_key, - external_user=external_user, 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 07c74007..510645f7 100644 --- a/src/openrouter/operations/createkeys.py +++ b/src/openrouter/operations/createkeys.py @@ -99,10 +99,6 @@ 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 expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are 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; supplying it with a management key is rejected with 403.""" - external_user: NotRequired[str] - r"""Partner's end-user identifier for attribution, between 1 and 512 characters. Accepted only when authenticating with a Connect client secret, where it is required; supplying it with a management key is rejected with 403.""" include_byok_in_limit: NotRequired[bool] r"""Whether to include BYOK usage in the limit""" limit: NotRequired[Nullable[float]] @@ -123,12 +119,6 @@ class CreateKeysRequestBody(BaseModel): expires_at: OptionalNullable[datetime] = UNSET r"""Optional ISO 8601 UTC expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are 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; supplying it with a management key is rejected with 403.""" - - external_user: Optional[str] = None - r"""Partner's end-user identifier for attribution, between 1 and 512 characters. Accepted only when authenticating with a Connect client secret, where it is required; supplying it with a management key is rejected with 403.""" - include_byok_in_limit: Optional[bool] = None r"""Whether to include BYOK usage in the limit""" @@ -147,8 +137,6 @@ def serialize_model(self, handler): [ "creator_user_id", "expires_at", - "external_api_key", - "external_user", "include_byok_in_limit", "limit", "limit_reset", diff --git a/uv.lock b/uv.lock index 1c4a33e4..094a654b 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.116" +version = "1.1.117" source = { editable = "." } dependencies = [ { name = "httpcore" },