Fix Claude API 400 "Your credit balance is too low"
When the Claude API or Claude Code fails with "credit balance is too low", tell an empty balance from an API key overriding your subscription, then fix it.
Your credit balance is too low to access the Anthropic API. Please go to Plans & Billing to upgrade or purchase credits.Called directly, the API returns this text as an HTTP 400 invalid_request_error. Claude Code shortens it to Credit balance is too low. There are two causes. The prepaid credits of your Console organization are really used up, or Claude Code is sending requests with an API key from your environment when you meant to use your subscription. If you have a subscription, rule out the second one first.
[1] Find where the text came from. In an API response body it looks like this, trimmed from the log in issue anthropics/claude-code#867:
Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Your credit balance is too low to access the Anthropic API. Please go to Plans & Billing to upgrade or purchase credits."}}In code, branch first on the SDK's typed exception and the status code, as the official docs advise. Format errors and spend-limit errors arrive as the same 400 invalid_request_error (table in step 6), so inside a 400 the only way to tell them apart is the start of message. That wording can change, so do not rely on string matching alone.
[2] In Claude Code with a Pro, Max, Team, or Enterprise plan, run /status and look at the API key row. The official error reference says an approved ANTHROPIC_API_KEY in the environment sends requests through that key instead of your subscription. If a key shows up, go to step 3. If you have no subscription and only pay for the API, jump to step 5.
[3] Remove the key and restart. Unsetting it in the current shell is not enough: if your shell profile (~/.bashrc, ~/.zshrc, and so on) has an export ANTHROPIC_API_KEY=... line, delete that line too, or the key comes back in the next terminal.
$ unset ANTHROPIC_API_KEY$ claudeIf you have never signed in with your subscription, run /login inside Claude Code.
[4] Check the other causes reported in the issue comments. These are user reports with the same symptom, not official guidance.
- If startup shows
Detected a custom API key in your environment/Do you want to use this API key?, choose No. One user had a key from an old workspace taking priority over the new one. - A
"forceLoginMethod": "console"entry in the project's.claude/settings.local.jsonpins billing to an API key. Delete it if you meant to use your subscription. - Run
claude /logout, thenclaude, and sign in again. Make sure it is the same account you added credits to. Several users said this fixed it. Another comment in the same issue says logging in and out did not help, and no official fix is posted there.
[5] If your organization pays through the API, the balance may really be empty. Check it at platform.claude.com/settings/billing and add credits. The official docs suggest turning on auto-reload on that page so the balance refills before it reaches zero, and setting per-workspace spend caps so one project cannot drain the organization's balance. If the same error appears right after topping up, check that the key belongs to the organization and workspace you funded.
[6] Tell it apart from the other limit errors. Rows two and three come from the official rate-limit docs; row one is based on the issue logs.
| Message starts with | Status | Meaning |
|---|---|---|
Your credit balance is too low … | 400 (per issue logs) | Prepaid credit balance is empty |
You have reached your specified API usage limits | 400 invalid_request_error | A spend limit you set; for a workspace limit it reads specified workspace API usage limits |
You have reached your API usage limits: your organization has crossed its monthly API usage threshold … | 429 rate_limit_error, enforced_spend_limit_reached | Your tier's monthly spend cap; no retry-after, fails until the resume time in the message |
The second row clears when you raise or remove your limit. The third has nothing to do with credits. The documented caps are $500 on Start, $1,000 on Build, and $200,000 on Scale, and access resumes at 00:00 UTC on the first day of the next month. The docs also note that spend limits on the Claude Code workspace can arrive as a 429 with a retry-after header instead of a 400. For ordinary rate-limit 429s, see Claude Code 429: rate limit or outage?.
[7] Do not rely on automatic retries. The docs say the official SDK retries transient failures such as connection errors, rate limits, and 5xx errors. An empty balance does not fix itself, so stop sending requests and raise an alert until credits are added.