API Keys
Create a new API key
Create a new API key for the authenticated user. The plaintext key is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Management key required.
post/keys
Request body
Example request
{
"expires_at": "2027-12-31T23:59:59Z",
"include_byok_in_limit": true,
"limit": 50,
"limit_reset": "monthly",
"name": "My New API Key"
}Response
API key created successfully
Example response
{
"data": {
"byok_usage": 0,
"byok_usage_daily": 0,
"byok_usage_monthly": 0,
"byok_usage_weekly": 0,
"created_at": "2025-08-24T10:30:00Z",
"creator_user_id": "user_2dHFtVWx2n56w6HkM0000000000",
"disabled": false,
"expires_at": "2027-12-31T23:59:59Z",
"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943",
"include_byok_in_limit": true,
"label": "My New API Key",
"limit": 50,
"limit_remaining": 50,
"limit_reset": "monthly",
"name": "My New API Key",
"updated_at": null,
"usage": 0,
"usage_daily": 0,
"usage_monthly": 0,
"usage_weekly": 0,
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
},
"key": "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"
}