> ## 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 キーの一覧

> ユーザーのすべての API キー一覧を取得するエンドポイントです。

## GET /api-keys

認証済みユーザーのすべての API キーを一覧します。セキュリティのため、キー値の全文は返さずプレビューのみです。

### レスポンス

<ResponseField name="apiKeys" type="array">
  API キーオブジェクトの配列。

  <Expandable title="apiKey のプロパティ">
    <ResponseField name="id" type="string">
      API キーの一意な識別子。
    </ResponseField>

    <ResponseField name="name" type="string">
      ユーザーが付けた API キーの名称。
    </ResponseField>

    <ResponseField name="keyPreview" type="string">
      マスクされたキーのプレビュー（例: `llm_1234...abcd`）。
    </ResponseField>

    <ResponseField name="isActive" type="boolean">
      キーが有効で使用可能かどうか。
    </ResponseField>

    <ResponseField name="lastUsedAt" type="string">
      最終利用日時の ISO 8601 タイムスタンプ。
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      作成日時の ISO 8601 タイムスタンプ。
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="number">
  API キーの合計件数。
</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 成功 (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>
