Skip to content

Token Management API

Any APIprovides a complete token management API for programmatic management of API keys.

Create Token

bash
curl -X POST https://anyapi.pro/api/token/ \
  -H "Authorization: Bearer YOUR_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-token",
    "remain_quota": 1000000,
    "expired_time": -1,
    "unlimited_quota": false
  }'

Query Tokens

bash
curl https://anyapi.pro/api/token/ \
  -H "Authorization: Bearer YOUR_ADMIN_KEY"

Update Token

bash
curl -X PUT https://anyapi.pro/api/token/ \
  -H "Authorization: Bearer YOUR_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": 1,
    "name": "my-updated-token",
    "remain_quota": 2000000
  }'

Delete Token

bash
curl -X DELETE https://anyapi.pro/api/token/1 \
  -H "Authorization: Bearer YOUR_ADMIN_KEY"

Response Format

All API responses follow a unified format:

json
{
  "success": true,
  "message": "",
  "data": { ... }
}

Quota Unit

In Any API, quota is measured in token count (not USD). The conversion:

  • 1 USD ≈ 500,000 quota (default ratio, configurable in the admin dashboard)

API PLAT