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

# List API Keys

> Retrieve all active API keys for a user.

## Request

<Note>
  This endpoint returns active keys only and does not require a Bearer token.
</Note>

### Query Parameters

<ParamField query="user_id" type="string" required>
  The user ID to list keys for.
</ParamField>

## Response

<ResponseField name="user_id" type="string">
  The user ID.
</ResponseField>

<ResponseField name="api_keys" type="array">
  Array of API key objects.

  <Expandable title="Key fields">
    <ResponseField name="id" type="string">
      The API key ID.
    </ResponseField>

    <ResponseField name="status" type="string">
      Key status (`"active"` or `"inactive"`).
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of when the key was created.
    </ResponseField>

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

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

## Example

<CodeGroup>
  ```python Python SDK theme={null}
  from entityml import EntityMLClient

  client = EntityMLClient()
  keys = client.api_keys.list(user_id="YOUR_USER_ID")
  print(keys)
  ```

  ```bash CLI theme={null}
  entityml api-keys list --user-id YOUR_USER_ID
  ```

  ```bash Raw HTTP (cURL) theme={null}
  curl "https://api.entityml.com/api/v1/keys?user_id=YOUR_USER_ID"
  ```
</CodeGroup>

### Example response

```json theme={null}
{
  "user_id": "user-uuid",
  "api_keys": [
    {
      "id": "key-uuid",
      "status": "active",
      "created_at": "2025-01-15T10:30:00Z",
      "last_used_at": "2025-01-15T11:45:00Z"
    }
  ],
  "total": 1
}
```
