You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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. [Management key](/docs/guides/overview/auth/management-api-keys)required.'
33776
+
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.'
33768
33777
operationId: 'createKeys'
33769
33778
requestBody:
33770
33779
content:
@@ -33798,7 +33807,12 @@ paths:
33798
33807
- 'string'
33799
33808
- 'null'
33800
33809
external_api_key:
33801
-
description: 'Optional partner-supplied API key. Stored as a SHA-256 hash and never returned. Accepted only when authenticating with a Connect client secret.'
33810
+
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.'
33811
+
maxLength: 512
33812
+
minLength: 1
33813
+
type: 'string'
33814
+
external_user:
33815
+
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.'
Copy file name to clipboardExpand all lines: docs/operations/createkeysdata.mdx
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ The created API key information
17
17
|`creator_user_id`|*Nullable[str]*|:heavy_check_mark:| The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID. | user_2dHFtVWx2n56w6HkM0000000000 |
18
18
|`disabled`|*bool*|:heavy_check_mark:| Whether the API key is disabled | false |
19
19
|`expires_at`|[date](https://docs.python.org/3/library/datetime.html#date-objects)|:heavy_minus_sign:| ISO 8601 UTC timestamp when the API key expires, or null if no expiration | 2027-12-31T23:59:59Z |
20
+
|`external_user`|*Nullable[str]*|:heavy_check_mark:| Partner's end-user identifier used for attribution. | null |
20
21
|`hash`|*str*|:heavy_check_mark:| Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 |
21
22
|`include_byok_in_limit`|*bool*|:heavy_check_mark:| Whether to include external BYOK usage in the credit limit | false |
22
23
|`label`|*str*|:heavy_check_mark:| Human-readable label for the API key | sk-or-v1-0e6...1c96 |
0 commit comments