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.
Overview
Retrieve all API tokens created by the current user, with pagination support.
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.
Authentication
Authenticate using the user’s access token with the following headers:
Authorization: Bearer {access_token}
New-Api-User: {user_id}
Request Parameters
Page number. The backend accepts older styles too, but 1 is the recommended starting page
Items per page, maximum 100
{
"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.4\",\"claude-sonnet-4-6\"]",
"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
import requests
headers = {
"Authorization": "Bearer your_access_token",
"New-Api-User": "1",
"User-Agent": "Mozilla/5.0"
}
response = requests.get(
"https://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']}")