Skip to main content

PUT /api-keys/

This endpoint allows you to update the name and description of an existing API key.

Path Parameters

keyId
string
required
The ID of the API key to update.

Request Body

name
string
The new name for the API key (1-100 characters).
description
string
The new description for the API key (max 500 characters).
permissions
array
The new list of permissions for the API key.

Response

success
boolean
Whether the update was successful.
message
string
A status message.
apiKey
object
The updated API key details.
curl -X PUT https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Production Key",
    "description": "Updated description"
  }'
{
  "success": true,
  "message": "API key updated successfully",
  "apiKey": {
    "id": "llm_1706123456_abc123def456",
    "name": "Updated Production Key",
    "description": "Updated description",
    "permissions": [],
    "updatedAt": "2026-01-27T10:00:00.000Z"
  }
}