Docs

API reference · AI gateway

Create a gateway key for the AI gateway

POST/v1/orgs/{org}/ai/keys

Create 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

NameInTypeRequiredNotes
orgpathstringyesfor example "org_01h455vb4pex5vsknk084sn02q"
Idempotency-KeyheaderstringnoOne 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-assignmentheaderstringnoSelect 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

FieldTypeRequiredNotes
namestringyes1 to 100 characters
aliasesarray of stringno0 to 100 items; default []
allAliasesbooleannodefault false
requestsPerMinuteintegerno0 to 1000000000; default 0
tokensPerMinuteintegerno0 to 1000000000000; default 0
allowOutsideEubooleannodefault false
budgetstringnofor example "bud_01h455vb4pex5vsknk084sn02q"

Response 201

FieldTypeRequiredNotes
idstringyesfor example "gwk_01h455vb4pex5vsknk084sn02q"
orgIdstringyesfor example "org_01h455vb4pex5vsknk084sn02q"
namestringyes
aliasesarray of stringyes
allAliasesbooleanyes
requestsPerMinuteintegeryes0 to 1000000000
tokensPerMinuteintegeryes0 to 1000000000000
allowOutsideEubooleanyes
budgetstring or nullyes
budgetNamestring or nullyes
createdAtstring (date-time)yesUTC, ISO 8601.
revokedAtstring (date-time) or nullyes
secretstringyesThe key, `<id>.<secret>`, as the client sends it to the gateway. Shown once, never stored in clear.