API keys are managed from the dashboard or via the management API.
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/keys | List keys (prefix, label, spend, last used) |
| POST | /v1/keys | Create a key, returns plaintext once |
| PATCH | /v1/keys/:id | Rename or set a monthly spend cap |
| DELETE | /v1/keys/:id | Revoke immediately |
curl -X POST https://api.bestokens.cn/v1/keys \
-H "Authorization: Bearer $BESTOKENS_SESSION" \
-H "Content-Type: application/json" \
-d '{"label":"production","monthly_cap_usd":200}'
Revocation takes effect within one second at the edge cache. In-flight streams are allowed to finish so you are not charged for output you never received.
La documentation technique est maintenue en anglais.