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: A dashboard session (Authorization: Bearer <jwt>) or an API key (danube-api-key). An agent can manage keys with its own key.

Body Parameters

string
required
Display name for the API key (e.g., “Production”, “Agent Key”)
object
Optional resource-based permissions. If omitted or null, the key has unrestricted access.
string
Name of the agent this key belongs to, shown in the dashboard and the audit log
string
One of coding_agent, assistant, workflow, service, other
string
One line on what the key is for
string
The organization the key belongs to. The caller must be a member (404 for an unknown organization, 403 for one you do not belong to). Calls made with the key run in that organization’s context without a danube-org-id header, and its owners and admins can revoke it. Omitted, the key belongs to your personal organization. See Organizations.

Response

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

Example