Skip to main content
POST

Overview

Creates a new API key for the authenticated user. The plaintext key is returned only once in this response — store it securely. Optionally restrict the key to specific services, tools, or spending limits using the permissions field. Auth: Requires JWT token (Authorization: Bearer <token>).

Body Parameters

name
string
required
Display name for the API key (e.g., “Production”, “Agent Key”)
permissions
object
Optional resource-based permissions. If omitted or null, the key has unrestricted access.

Response

id
string
API key UUID
key
string
The plaintext API key (shown once only — store securely)
key_prefix
string
First 8 characters of the key (for identification)
name
string
Display name
created_at
string
ISO 8601 creation timestamp
last_used
string
Last usage timestamp (null on creation)
permissions
object
Resource permissions (null = unrestricted)

Example