Skip to content

API docs · Getting started

Key scopes & limits

Scopes, model allowlist, total and daily limits, disabling and revoking.

An account can have multiple keys. We recommend one key per application or environment so you can set limits and revoke access independently.

Scopes

scopeAllows
tasks:createSubmit video generation tasks; reserves and settles quota
tasks:readRead the status and results of tasks in this account
assets:readList and view assets
assets:writeUpload, import, rename and delete assets

Model allowlist

A key can only call the models selected when it was created, and only models your account is authorized for. Models added to the platform later are not added to existing keys automatically.

Limits

  • Total limit (required): the key's settled plus reserved amount can never exceed it.
  • Daily limit (optional): counted per calendar day in this site's time zone (Asia/Shanghai).
  • RPM and concurrency limits (optional): requests over the limit return 429 rate_limited; see Rate limits.
  • Expiry (optional): after it passes, requests return 401 invalid_api_key.

When a key limit is reached the API returns 402 key_limit_exceeded; when the account runs out of available quota it returns 402 quota_exceeded.

Disabling and revoking

A disabled key can be re-enabled at any time; revoking is permanent. Either way, requests using the key immediately return 401. Past tasks and billing records are kept.

cURL
curl https://cn-api.aitoken.tools/v1/account/quota \
  -H "Authorization: Bearer $AITOKEN_API_KEY"

# {
#   "object": "quota",
#   "currency": "CNY",
#   "available": "496.800000",
#   "reserved": "3.200000",
#   "key": { "id": "key_xxx", "total_remaining": "96.800000", "daily_remaining": null }
# }