Create a new API key
API Keys
Create API Key
Create a new API key in the authenticated workspace.
POST
Create a new API key
This endpoint requires a management API key. Standard Gateway API keys are not accepted.
limit, limit_reset, and include_byok_in_limit fields are accepted; AI Stats currently treats include_byok_in_limit as compatibility-only and always excludes BYOK from this key limit field.Authorizations
Bearer token authentication
Body
application/json
Minimum string length:
1Example:
"Analytics Service Key"
Optional workspace override for internal callers.
Example:
"[\"chat.completions\",\"responses\"]"
Optional spend limit in USD for this key.
Required range:
x >= 0Period used for the spend limit window.
Available options:
daily, weekly, monthly Accepted for compatibility. Current AI Stats behavior always excludes BYOK from this limit field.
Response
API key created
Last modified on April 29, 2026