RaabtaHQ
Get the AI budget

Get the AI budget

GET/api/v1/ai/budget

scope ai:usage

This month’s AI spend against the account’s cap. state walks ok → warn at 90% → grace at 100%, where a 10% allowance keeps things running → blocked at 110%, where the AI stops and starting a run returns 402. The cap is set by the platform, not over this API.

Request
curl "https://your-crm.example.com/api/v1/ai/budget" \
  -H "Authorization: Bearer $RAABTA_API_KEY"
Response · 200 OK
{
  "data": {
    "budget_usd": 100,
    "spent_usd": 42.18,
    "pct": 0.4218,
    "state": "ok",
    "blocked": false
  }
}

Response

Wrapped in { data: … }
NameTypeDescription
budget_usdrequired
number | nullMonthly cap in USD; null is unlimited
spent_usdrequired
numberBilled spend this calendar month
pctrequired
numberSpend divided by budget, or 0 when unlimited
staterequired
string (enum)ok below 90 percent, warn at 90, grace at 100 with a 10 percent allowance, blocked at 110 where AI stopsokwarngraceblocked
blockedrequired
booleanWhen true, starting a run returns 402

Errors

StatusCodeWhen
401unauthorizedNo usable API key: the Authorization header is missing or malformed, or the key is unknown, revoked or expired. The three are deliberately indistinguishable.
403forbiddenThe key is valid but lacks the scope this endpoint requires, or the request came from an address outside the key’s IP allowlist. The message says which.
403account_suspendedThe account this key belongs to is suspended. Rotating the key will not help; contact support.
429rate_limitedThe per-key budget, or the per-IP budget for failed authentication, is exhausted. Honour `Retry-After` before retrying.
500internalSomething failed on our side. Safe to retry with the same Idempotency-Key; quote `request_id` if it persists.