メインコンテンツへスキップ
PUT
Update Token
更新日: 2026-07-20

Overview

Modify the name, quota, expiration time, model permissions, and other settings of an existing token.
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. Use https://crazyrouter.com as the base URL; https://api.crazyrouter.com is reserved for model APIs and returns 404 api_only_endpoint for management paths.

Authentication

Use user-side authentication with these headers:

Request Parameters

id
integer
必須
Token ID
name
string
Token name
remain_quota
integer
Remaining quota
unlimited_quota
boolean
Whether quota is unlimited
expired_time
integer
Expiration timestamp, -1 means never expires
model_limits_enabled
boolean
Whether to enable the model whitelist
model_limits
string
Model restriction config string, for example ["gpt-5.5","claude-opus-4-8"]
status
integer
Status: 1=enabled, 2=disabled
allow_ips
string
IP whitelist string
group
string
Group

Response Format

The current endpoint returns the updated token object:

Code Examples

Updating a token does not regenerate the API key. If you need a new key, delete the token and create a new one.