curl --request PUT \
--url https://api.example.com/api/token/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 123,
"name": "<string>",
"remain_quota": 123,
"unlimited_quota": true,
"expired_time": 123,
"models": [
"<string>"
],
"status": 123,
"subnet": "<string>"
}
'更新已有令牌的配置
curl --request PUT \
--url https://api.example.com/api/token/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 123,
"name": "<string>",
"remain_quota": 123,
"unlimited_quota": true,
"expired_time": 123,
"models": [
"<string>"
],
"status": 123,
"subnet": "<string>"
}
'{
"success": true,
"message": "令牌更新成功"
}
import requests
headers = {
"Authorization": "Bearer your_access_token",
"New-Api-User": "1",
"Content-Type": "application/json",
"User-Agent": "Mozilla/5.0"
}
# 修改令牌额度和模型权限
response = requests.put(
"https://crazyrouter.com/api/token/",
headers=headers,
json={
"id": 10,
"name": "生产环境-已更新",
"remain_quota": 200000,
"models": ["gpt-4o", "claude-sonnet-4-20250514", "gemini-2.5-flash"]
}
)
print(response.json())