Get the AI budget
GET/api/v1/ai/budget
scope
ai:usageThis 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: … }| Name | Type | Description |
|---|---|---|
budget_usdrequired | number | null | Monthly cap in USD; null is unlimited |
spent_usdrequired | number | Billed spend this calendar month |
pctrequired | number | Spend 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 | boolean | When true, starting a run returns 402 |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No usable API key: the Authorization header is missing or malformed, or the key is unknown, revoked or expired. The three are deliberately indistinguishable. |
| 403 | forbidden | The 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. |
| 403 | account_suspended | The account this key belongs to is suspended. Rotating the key will not help; contact support. |
| 429 | rate_limited | The per-key budget, or the per-IP budget for failed authentication, is exhausted. Honour `Retry-After` before retrying. |
| 500 | internal | Something failed on our side. Safe to retry with the same Idempotency-Key; quote `request_id` if it persists. |