curl -X POST "https://api.danubeai.com/v1/api-keys" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Production Key",
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null
}
}'
from danube import DanubeClient
client = DanubeClient(api_key="YOUR_API_KEY")
new_key = client.api_keys.create(
name="Production Key",
permissions={
"allowed_services": ["service_uuid_1"],
"allowed_tools": None,
}
)
print(f"Key: {new_key.key}") # Store this securely!
import { DanubeClient } from 'danube';
const client = new DanubeClient({ apiKey: 'YOUR_API_KEY' });
const newKey = await client.apiKeys.create({
name: 'Production Key',
permissions: {
allowedServices: ['service_uuid_1'],
allowedTools: null,
}
});
console.log(`Key: ${newKey.key}`); // Store this securely!
{
"id": "abc123",
"key": "3q2xJd0eK9mPzV5tR8wYs1uB4nC7fH6gLsA2iDoXk5U",
"key_prefix": "3q2xJd0e",
"name": "Production Key",
"created_at": "2026-02-28T10:00:00Z",
"last_used": null,
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null
}
}
API Keys
Create API Key
Create a new API key with optional resource permissions
POST
/
v1
/
api-keys
curl -X POST "https://api.danubeai.com/v1/api-keys" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Production Key",
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null
}
}'
from danube import DanubeClient
client = DanubeClient(api_key="YOUR_API_KEY")
new_key = client.api_keys.create(
name="Production Key",
permissions={
"allowed_services": ["service_uuid_1"],
"allowed_tools": None,
}
)
print(f"Key: {new_key.key}") # Store this securely!
import { DanubeClient } from 'danube';
const client = new DanubeClient({ apiKey: 'YOUR_API_KEY' });
const newKey = await client.apiKeys.create({
name: 'Production Key',
permissions: {
allowedServices: ['service_uuid_1'],
allowedTools: null,
}
});
console.log(`Key: ${newKey.key}`); // Store this securely!
{
"id": "abc123",
"key": "3q2xJd0eK9mPzV5tR8wYs1uB4nC7fH6gLsA2iDoXk5U",
"key_prefix": "3q2xJd0e",
"name": "Production Key",
"created_at": "2026-02-28T10:00:00Z",
"last_used": null,
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null
}
}
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 thepermissions 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.
Show Permissions object
Show Permissions object
array
Service UUIDs this key can access.
null = all services.array
Tool UUIDs this key can access.
null = all tools.integer
Maximum cost per single tool call in cents.
integer
Maximum daily spend for this key in cents.
boolean
When true, a call that writes, sends, spends or deletes answers 409
confirmation_required with a confirm_token until it is repeated with that token (the consent handshake).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, otherstring
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
curl -X POST "https://api.danubeai.com/v1/api-keys" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Production Key",
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null
}
}'
from danube import DanubeClient
client = DanubeClient(api_key="YOUR_API_KEY")
new_key = client.api_keys.create(
name="Production Key",
permissions={
"allowed_services": ["service_uuid_1"],
"allowed_tools": None,
}
)
print(f"Key: {new_key.key}") # Store this securely!
import { DanubeClient } from 'danube';
const client = new DanubeClient({ apiKey: 'YOUR_API_KEY' });
const newKey = await client.apiKeys.create({
name: 'Production Key',
permissions: {
allowedServices: ['service_uuid_1'],
allowedTools: null,
}
});
console.log(`Key: ${newKey.key}`); // Store this securely!
{
"id": "abc123",
"key": "3q2xJd0eK9mPzV5tR8wYs1uB4nC7fH6gLsA2iDoXk5U",
"key_prefix": "3q2xJd0e",
"name": "Production Key",
"created_at": "2026-02-28T10:00:00Z",
"last_used": null,
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null
}
}
