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

# List API Keys

> List all active API keys for the authenticated user

## Overview

Returns all active API keys for the authenticated user. The plaintext key value is never returned after creation -- only the `key_prefix` (first 8 characters) is shown for identification.

**Auth:** Requires JWT token (`Authorization: Bearer <token>`).

## Response

Returns an array of API key objects.

<ResponseField name="id" type="string">
  API key UUID
</ResponseField>

<ResponseField name="key_prefix" type="string">
  First 8 characters of the key (for identification)
</ResponseField>

<ResponseField name="name" type="string">
  Display name for the key
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 creation timestamp
</ResponseField>

<ResponseField name="last_used" type="string">
  ISO 8601 timestamp of last usage (null if never used)
</ResponseField>

<ResponseField name="permissions" type="object">
  Resource permissions. `null` means unrestricted access.

  <Expandable title="Permissions object">
    <ResponseField name="allowed_services" type="array">
      Service UUIDs this key can access (null = all)
    </ResponseField>

    <ResponseField name="allowed_tools" type="array">
      Tool UUIDs this key can access (null = all)
    </ResponseField>

    <ResponseField name="max_spend_per_call_cents" type="integer">
      Maximum cost per single tool call in cents (null = no limit)
    </ResponseField>

    <ResponseField name="max_spend_per_day_cents" type="integer">
      Maximum daily spend for this key in cents (null = no limit)
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

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

  ```python Python SDK theme={null}
  from danube import DanubeClient

  client = DanubeClient(api_key="dk_...")
  keys = client.api_keys.list()
  for key in keys:
      print(f"{key.name} ({key.key_prefix}...)")
  ```

  ```typescript TypeScript SDK theme={null}
  import { DanubeClient } from '@danubeai/sdk';

  const client = new DanubeClient({ apiKey: 'dk_...' });
  const keys = await client.apiKeys.list();
  keys.forEach(key => console.log(`${key.name} (${key.keyPrefix}...)`));
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  [
    {
      "id": "abc123",
      "key_prefix": "dk_abc12",
      "name": "Production Key",
      "created_at": "2026-01-15T10:00:00Z",
      "last_used": "2026-02-20T14:30:00Z",
      "permissions": null
    },
    {
      "id": "def456",
      "key_prefix": "dk_def45",
      "name": "Restricted Key",
      "created_at": "2026-02-01T10:00:00Z",
      "last_used": null,
      "permissions": {
        "allowed_services": ["service_uuid_1"],
        "allowed_tools": null,
        "max_spend_per_call_cents": null,
        "max_spend_per_day_cents": null
      }
    }
  ]
  ```
</ResponseExample>
