Skip to main content
POST
Create API Key

Authorizations

Authorization
string
header
required

Key on the FULL preset, or any key whose permissions include the ones this API lists. Prefix it with "Key ", e.g. Authorization: Key YOUR_API_KEY

Body

application/json
alias
string
required

Required friendly name for the API key

Required string length: 1 - 255
Example:

"Production Key"

description
string

Optional description of what the key is for

Maximum string length: 1000
Example:

"CI deploy key for the main environment"

preset
enum<string>

Named permission preset to apply. Defaults to "API" when neither preset nor permissions is given. Mutually exclusive with permissions.

Available options:
FULL,
AGENT,
API,
DEPLOY,
READONLY,
BILLING,
COMPUTE,
SERVERLESS
Example:

"API"

permissions
string[]

Explicit list of permissions to grant instead of a preset. Mutually exclusive with preset.

Minimum array length: 1
Example:
expires_at
string<date-time>

ISO8601 timestamp after which the key stops working

Example:

"2025-07-15T12:00:00Z"

Response

API key created successfully. Store the key_secret securely - it will not be shown again.

Response containing the newly created API key credentials. The key_secret is only returned once.

key_id
string
required

Unique identifier for the newly created API key

Example:

"abc123def456"

key_secret
string
required

Secret portion of the API key. IMPORTANT: This is only returned once at creation time and cannot be retrieved again.

Example:

"sk_live_abc123..."

key
string
required

Full API key in the format 'key_id:key_secret'. Use this value directly for API authorization. IMPORTANT: This is only returned once at creation time and cannot be retrieved again.

Example:

"abc123def456:sk_live_abc123..."