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

# List Tokens

> Get a paginated list of API tokens for the current user

> Дата обновления: 2026-06-23

## Overview

Retrieve all API tokens created by the current user, with pagination support.

<Note>
  The `/api/token/*` endpoints are mainly for Crazyrouter dashboard automation around API key management. They require a user `access token` plus the `New-Api-User` header, and are not the normal interface for `sk-xxx` model calls.
</Note>

## Authentication

Authenticate using the user's access token with the following headers:

```text theme={null}
Authorization: Bearer {access_token}
New-Api-User: {user_id}
```

## Request Parameters

<ParamField query="p" type="integer" default="1">
  Page number. The backend accepts older styles too, but `1` is the recommended starting page
</ParamField>

<ParamField query="size" type="integer" default="10">
  Items per page, maximum 100
</ParamField>

## Response Format

```json theme={null}
{
  "success": true,
  "message": "",
  "data": {
    "page": 1,
    "page_size": 10,
    "total": 1,
    "items": [
      {
        "id": 1,
        "user_id": 1,
        "key": "sk-xxxxxxxxxxxxxxxx",
        "status": 1,
        "name": "My Token",
        "created_time": 1706000000,
        "accessed_time": 1706100000,
        "expired_time": -1,
        "remain_quota": 500000,
        "unlimited_quota": false,
        "model_limits_enabled": true,
        "model_limits": "[\"gpt-5.5\",\"claude-opus-4-8\"]",
        "allow_ips": "203.0.113.10",
        "used_quota": 12345,
        "group": "default"
      }
    ]
  }
}
```

## Field Descriptions

| Field                  | Type   | Description                                    |
| ---------------------- | ------ | ---------------------------------------------- |
| `id`                   | int    | Token ID                                       |
| `key`                  | string | API key in `sk-xxx` format                     |
| `status`               | int    | Status: 1=enabled, 2=disabled                  |
| `name`                 | string | Token name                                     |
| `expired_time`         | int    | Expiration timestamp, `-1` means never expires |
| `remain_quota`         | int    | Remaining quota                                |
| `unlimited_quota`      | bool   | Whether quota is unlimited                     |
| `used_quota`           | int    | Used quota                                     |
| `model_limits_enabled` | bool   | Whether the model whitelist is enabled         |
| `model_limits`         | string | Model restriction config string                |
| `allow_ips`            | string | IP whitelist string                            |
| `group`                | string | Group                                          |

## Code Examples

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {
      "Authorization": "Bearer your_access_token",
      "New-Api-User": "1",
      "User-Agent": "Mozilla/5.0"
  }

  response = requests.get(
      "https://api.crazyrouter.com/api/token/?p=1&size=100",
      headers=headers
  )

  page = response.json()["data"]
  for token in page["items"]:
      print(f"[{token['name']}] {token['key'][:10]}... Quota: {token['remain_quota']}")
  ```

  ```bash cURL theme={null}
  curl "https://api.crazyrouter.com/api/token/?p=1&size=100" \
    -H "Authorization: Bearer your_access_token" \
    -H "New-Api-User: 1"
  ```
</CodeGroup>
