cURL
curl --request GET \ --url https://api.example.com/api/token/
分页获取当前用户的 API 令牌列表
Authorization: Bearer {access_token} New-Api-User: {user_id}
{ "success": true, "message": "", "data": [ { "id": 1, "user_id": 1, "key": "sk-xxxxxxxxxxxxxxxx", "status": 1, "name": "我的令牌", "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": "" } ] }
id
key
status
name
expired_time
remain_quota
unlimited_quota
used_quota
models
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]}... 额度: {token['remain_quota']}")