border.bot
Esc
  • Loading…
↑ ↓ to move↵ to openEsc to close
Docs menu

Credit balance

GET https://api.border.bot/v1/credits

Requires an access token from an API client (Authorization: Bearer <access_token>).

Current balance, lifetime totals and the 20 most recent ledger entries (purchases, usage, refunds).

API client scope: account.

Responses#

  • 200: Balance and recent ledger. (CreditsResponse)
  • 401: Missing, invalid or expired access token, or a revoked or expired API client (unauthorized). (Error)
  • 403: The API client doesn’t have the account scope (forbidden, details.reason: "missing_scope"). (Error)
  • 429: Rate limited (rate_limited). Retry after Retry-After seconds; RateLimit says which limit was hit (r=0, t seconds until its window ends) and RateLimit-Policy its quota. (Error)
  • 500: Unexpected error (internal). (Error)

Example request#

curl -X GET https://api.border.bot/v1/credits \
  -H "Authorization: Bearer $BORDERBOT_TOKEN"

Example response (200)#

JSON
{
  "data": {
    "balance": 0,
    "lifetimePurchased": 0,
    "lifetimeGranted": 0,
    "lifetimeUsed": 0,
    "lowBalanceThreshold": 0,
    "recentLedger": [
      {
        "id": "string",
        "delta": 0,
        "balanceAfter": 0,
        "kind": "purchase",
        "action": "string",
        "usageId": "string",
        "note": "string",
        "actor": "string",
        "createdAt": "2026-10-20T09:30:00.000Z"
      }
    ]
  }
}