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

# List API keys

> Retrieve a paginated list of your organization's API keys

Returns a paginated list of API keys for your organization, sorted newest first.

<Info>
  This endpoint uses the native Lumenfall API path (`/v1/keys`), not the OpenAI-compatible prefix (`/openai/v1`).
</Info>

## Query parameters

<ParamField query="limit" type="integer" default="20">
  Number of results to return per page. Minimum 1, maximum 100.
</ParamField>

<ParamField query="starting_after" type="string">
  Cursor for forward pagination. Returns results after the key with this ID.
  Use the `next_page_url` from a previous response instead of constructing this manually.
</ParamField>

<ParamField query="ending_before" type="string">
  Cursor for backward pagination. Returns results before the key with this ID.
  Cannot be combined with `starting_after`.
</ParamField>

<ParamField query="status" type="string">
  Filter keys by status. One of `active` or `revoked`. When omitted, both active and revoked keys are returned.
</ParamField>

## Response

<ResponseField name="object" type="string">
  Always `list`.
</ResponseField>

<ResponseField name="data" type="array">
  Array of key objects, sorted newest first.

  <Expandable title="Key object">
    <ResponseField name="id" type="string">
      Unique key identifier (e.g., `2m4jLFHhkN1i4VrVHpjJqCOKlPw`).
    </ResponseField>

    <ResponseField name="object" type="string">
      Always `key`.
    </ResponseField>

    <ResponseField name="name" type="string | null">
      Human-readable name for the key, or `null` if unnamed.
    </ResponseField>

    <ResponseField name="last_four" type="string | null">
      Last four characters of the API key for identification.
    </ResponseField>

    <ResponseField name="status" type="string">
      Key status — `active` or `revoked`.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      When the key was created, as an ISO 8601 datetime.
    </ResponseField>

    <ResponseField name="revoked_at" type="string | null">
      When the key was revoked, as an ISO 8601 datetime. `null` for active keys.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="next_page_url" type="string | null">
  URL to fetch the next page of results. `null` when there are no more results.
  Includes all original filters so you can follow it directly.
</ResponseField>

<ResponseField name="previous_page_url" type="string | null">
  URL to fetch the previous page of results. `null` when on the first page.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.lumenfall.ai/v1/keys" \
    -H "Authorization: Bearer $LUMENFALL_API_KEY"
  ```

  ```bash cURL (active only) theme={null}
  curl "https://api.lumenfall.ai/v1/keys?status=active" \
    -H "Authorization: Bearer $LUMENFALL_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.lumenfall.ai/v1/keys",
      headers={"Authorization": "Bearer your-lumenfall-api-key"},
      params={"status": "active"},
  )
  data = response.json()

  for key in data["data"]:
      print(f"{key['name']} ({key['last_four']}) — {key['status']}")
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch("https://api.lumenfall.ai/v1/keys?status=active", {
    headers: { Authorization: "Bearer your-lumenfall-api-key" },
  });
  const data = await response.json();

  for (const key of data.data) {
    console.log(`${key.name} (${key.last_four}) — ${key.status}`);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "object": "list",
    "data": [
      {
        "id": "2m4jLFHhkN1i4VrVHpjJqCOKlPw",
        "object": "key",
        "name": "Production",
        "last_four": "a1b2",
        "status": "active",
        "created_at": "2026-03-10T09:15:00.000Z",
        "revoked_at": null
      },
      {
        "id": "2m4jKEGfmR8h3UqTGnhHpBNkMOx",
        "object": "key",
        "name": "Staging",
        "last_four": "c3d4",
        "status": "revoked",
        "created_at": "2026-02-01T12:00:00.000Z",
        "revoked_at": "2026-03-05T18:30:00.000Z"
      }
    ],
    "next_page_url": null,
    "previous_page_url": null
  }
  ```
</ResponseExample>
