curl --request GET \
--url https://api.example.com/api/token/searchSearch tokens by keyword
curl --request GET \
--url https://api.example.com/api/token/search{
"success": true,
"message": "",
"data": [
{
"id": 5,
"name": "Production",
"key": "sk-xxxxxxxx",
"status": 1,
"remain_quota": 50000,
"used_quota": 8000,
"created_time": 1706000000
}
]
}
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/search?keyword=production",
headers=headers
)
tokens = response.json()["data"]
for token in tokens:
print(f"[{token['id']}] {token['name']} - Remaining quota: {token['remain_quota']}")