> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llmgenerator.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API-Schlüssel aktualisieren

> Dieser Endpunkt aktualisiert die Metadaten eines API-Schlüssels.

## PUT /api-keys/{keyId}

Mit diesem Endpunkt können Sie Name und Beschreibung eines vorhandenen API-Schlüssels ändern.

### Pfadparameter

<ParamField path="keyId" type="string" required>
  Kennung des zu aktualisierenden API-Schlüssels.
</ParamField>

### Anfragetext

<ParamField body="name" type="string">
  Neuer Name für den API-Schlüssel (1–100 Zeichen).
</ParamField>

<ParamField body="description" type="string">
  Neue Beschreibung für den API-Schlüssel (max. 500 Zeichen).
</ParamField>

<ParamField body="permissions" type="array">
  Neue Berechtigungsliste für den API-Schlüssel.
</ParamField>

### Antwort

<ResponseField name="success" type="boolean">
  Ob die Aktualisierung erfolgreich war.
</ResponseField>

<ResponseField name="message" type="string">
  Statusmeldung.
</ResponseField>

<ResponseField name="apiKey" type="object">
  Aktualisierte Details des API-Schlüssels.

  <Expandable title="Eigenschaften von apiKey">
    <ResponseField name="id" type="string">
      Eindeutige Kennung des API-Schlüssels.
    </ResponseField>

    <ResponseField name="name" type="string">
      Aktualisierter Name.
    </ResponseField>

    <ResponseField name="description" type="string">
      Aktualisierte Beschreibung.
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      ISO-8601-Zeitstempel der Aktualisierung.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  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"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        name: 'Updated Production Key'
      })
    }
  );
  ```
</RequestExample>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "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"
    }
  }
  ```

  ```json Not Found (404) theme={null}
  {
    "message": "API key not found"
  }
  ```
</ResponseExample>
