Account Balance and Usage

This set of APIs provides both the platform’s custom wrapper and an OpenAI-compatible structure.

API Key Usage

GET /api/usage/token/
curl https://octopusx.ai/api/usage/token/ \
  -H "Authorization: Bearer YOUR_API_KEY"
Successful response:
{
  "code": true,
  "message": "ok",
  "data": {
    "object": "token_usage",
    "name": "default-token",
    "total_granted": 1000000,
    "total_used": 250000,
    "total_available": 750000,
    "unlimited_quota": false,
    "model_limits": {
      "gpt-4o": 10000
    },
    "model_limits_enabled": true,
    "expires_at": 1767225600
  }
}

OpenAI-Compatible Subscription Information

The following two paths are equivalent:
  • GET /dashboard/billing/subscription
  • GET /v1/dashboard/billing/subscription
Response example:
{
  "object": "billing_subscription",
  "has_payment_method": true,
  "soft_limit_usd": 100.0,
  "hard_limit_usd": 100.0,
  "system_hard_limit_usd": 100.0,
  "access_until": 1767225600
}

OpenAI-Compatible Usage

The following two paths are equivalent:
  • GET /dashboard/billing/usage
  • GET /v1/dashboard/billing/usage
Response example:
{
  "object": "list",
  "total_usage": 2500
}
The final display unit of soft_limit_usd, hard_limit_usd, and total_usage is affected by the site’s quota display configuration, and may not always be USD.

Common Errors

Missing Authorization for /api/usage/token/

{
  "success": false,
  "message": "No Authorization header"
}

Invalid Bearer format for /api/usage/token/

{
  "success": false,
  "message": "Invalid Bearer token"
}

OpenAI-compatible balance API error

{
  "error": {
    "message": "query quota failed",
    "type": "upstream_error",
    "param": "",
    "code": null
  }
}