API reference · AI gateway
Create a gateway key for the AI gateway
POST
/v1/orgs/{org}/ai/keysCreate a gateway key for the AI gateway. Its secret is shown once
- Permission
ai.keys.manage- Audit log
ai.key.create- Operation
ai.keys.create
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
org | path | string | yes | for example "org_01h455vb4pex5vsknk084sn02q" |
Idempotency-Key | header | string | no | One key per intended mutation. A retry with the key never executes twice; its response carries a secret and is not replayed: a duplicate answers 409 idempotency_outcome_committed. For example "01h455vb4pex5vsknk084sn02q" |
x-obhut-management-assignment | header | string | no | Select one staff assignment. Direct membership remains the default. Bound API tokens use their stored source and ignore this selector. For example "masg_01h455vb4pex5vsknk084sn02q" |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | yes | 1 to 100 characters |
aliases | array of string | no | 0 to 100 items; default [] |
allAliases | boolean | no | default false |
requestsPerMinute | integer | no | 0 to 1000000000; default 0 |
tokensPerMinute | integer | no | 0 to 1000000000000; default 0 |
allowOutsideEu | boolean | no | default false |
budget | string | no | for example "bud_01h455vb4pex5vsknk084sn02q" |
Response 201
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | for example "gwk_01h455vb4pex5vsknk084sn02q" |
orgId | string | yes | for example "org_01h455vb4pex5vsknk084sn02q" |
name | string | yes | |
aliases | array of string | yes | |
allAliases | boolean | yes | |
requestsPerMinute | integer | yes | 0 to 1000000000 |
tokensPerMinute | integer | yes | 0 to 1000000000000 |
allowOutsideEu | boolean | yes | |
budget | string or null | yes | |
budgetName | string or null | yes | |
createdAt | string (date-time) | yes | UTC, ISO 8601. |
revokedAt | string (date-time) or null | yes | |
secret | string | yes | The key, `<id>.<secret>`, as the client sends it to the gateway. Shown once, never stored in clear. |