Skip to main content

PUT /api-keys/:keyId

This endpoint allows you to update the name, description, and permissions 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.
description
string
The new description for the API key.
permissions
array
The new list of permissions for the API key.

Response

metadata
object
The updated metadata for the API key.
updated
array
A list of the fields that were updated.
curl -X PUT https://api.llmgenerator.com/api/v1/api-keys/key_xxxxxxxxxxxxx \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "name": "Updated Production Key",
        "description": "A new description"
      }'
{
  "metadata": {
    "name": "Updated Production Key",
    "description": "A new description",
    "permissions": ["generate"]
  },
  "updated": ["name", "description"]
}