Skip to main content
GET
/
api
/
token
List Tokens
curl --request GET \
  --url https://api.example.com/api/token/

Overview

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

Authentication

Authenticate using the user’s Access Token with the following headers:
Authorization: Bearer {access_token}
New-Api-User: {user_id}

Request Parameters

p
integer
default:"0"
Page number, starting from 0
size
integer
default:"10"
Items per page, maximum 100

Response Format

{
  "success": true,
  "message": "",
  "data": [
    {
      "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,
      "used_quota": 12345,
      "models": ["gpt-4o", "claude-sonnet-4-20250514"],
      "subnet": ""
    }
  ]
}

Field Descriptions

FieldTypeDescription
idintToken ID
keystringAPI Key (sk-xxx format)
statusintStatus: 1=enabled, 2=disabled
namestringToken name
expired_timeintExpiration timestamp, -1 means never expires
remain_quotaintRemaining quota
unlimited_quotaboolWhether quota is unlimited
used_quotaintUsed quota
modelsstring[]Allowed model list, empty means all models

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=0&size=100",
    headers=headers
)

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