DrıftstackAPI errors

API error type

AI credits exhausted

HTTP 402 https://errors.driftstack.dev/ai-credits-exhausted

What it means

An AI turn could not run on your account’s AI credits, so nothing ran. The body’s reason says why: balance — the credits your plan includes are used up (available_credits and required_credits say how far short, and resets_at, when present, is when your next credits arrive), or, with a code, your paid plan has stopped: plan_ended — it has ended; payment_failed — your last renewal payment didn’t go through and the card is still being retried, and once the last retry fails your plan has ended (plan_ended); workspace_payment_failed or workspace_plan_ended — the same, for a teammate in someone else’s workspace. With a code, no AI runs on the account, your own key included, and there is no resets_at; debt — AI is paused on the account until it is settled (debt_reason says why); or task_too_large — this one request is larger than credits can run.

How to fix it

For balance with no code: wait until resets_at, choose a plan with more credits in the dashboard, or run the turn on your own Anthropic key (send x-byok-anthropic-api-key, or save a key in the dashboard’s Settings). With code: "plan_ended": choose a plan in the dashboard (for a crypto-paid term, renew_url, when present, pays for a new term). With code: "payment_failed": pay your open invoice (pay_url, when present, links to it) or update your card in the dashboard’s Billing page (or, once the last retry has failed, choose a plan). With a workspace_ code: ask the workspace owner. Waiting or adding your own key does not help with any code. For task_too_large: shorten the request or start a new chat. For debt: contact [email protected].

Where it appears

In the type field of the RFC 9457 application/problem+json error body, alongside title, status, detail, and an instance correlation id.

Related