> ## 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.

# List API Keys

> This endpoint retrieves a list of all API keys for the user.

## GET /api-keys

This endpoint returns a list of all API keys associated with the authenticated user's account. For security, the full API key value is never returned - only a preview.

### Response

<ResponseField name="apiKeys" type="array">
  An array of API key objects.

  <Expandable title="apiKey properties">
    <ResponseField name="id" type="string">
      The unique identifier for the API key.
    </ResponseField>

    <ResponseField name="name" type="string">
      The user-defined name for the API key.
    </ResponseField>

    <ResponseField name="keyPreview" type="string">
      A masked preview of the key (e.g., `llm_1234...abcd`).
    </ResponseField>

    <ResponseField name="isActive" type="boolean">
      Whether the key is active and can be used.
    </ResponseField>

    <ResponseField name="lastUsedAt" type="string">
      ISO 8601 timestamp of when the key was last used.
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO 8601 timestamp of key creation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="number">
  Total number of API keys.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.llmgenerator.com/api/v1/api-keys \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.llmgenerator.com/api/v1/api-keys',
    {
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    }
  );

  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "apiKeys": [
      {
        "id": "llm_1706123456_abc123def456",
        "name": "Production Key",
        "keyPreview": "llm_1706...f456",
        "isActive": true,
        "lastUsedAt": "2026-01-20T15:30:00.000Z",
        "createdAt": "2026-01-01T10:00:00.000Z"
      },
      {
        "id": "llm_1706234567_xyz789abc012",
        "name": "Development Key",
        "keyPreview": "llm_1706...c012",
        "isActive": true,
        "lastUsedAt": null,
        "createdAt": "2026-01-15T09:00:00.000Z"
      }
    ],
    "total": 2
  }
  ```
</ResponseExample>
