POST /api-keys
This endpoint creates a new API key for the authenticated user.
Request Body
A descriptive name for the API key.
A description of what the key will be used for.
A list of permissions to grant to the key.
An optional expiration date for the key in ISO 8601 format.
Response
The newly created API key. This is the only time the key will be shown in full.
The unique identifier for the API key.
An object containing the key’s metadata.
curl -X POST https://api.llmgenerator.com/api/v1/api-keys \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "New Production Key",
"description": "For the new service integration"
}'
{
"apiKey": "llmgen_xxxxxxxxxxxxxxxxxxxxxxxx",
"id": "key_zzzzzzzzzzzzz",
"metadata": {
"name": "New Production Key",
"description": "For the new service integration",
"permissions": ["generate", "sites:read"],
"expiresAt": null
}
}