-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
[Bug]: Intermittent "API provider billing error" shown to user — swallows actual response #13935
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingstaleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Description
Intermittent error message surfaces in Telegram chat that reads:
⚠️ API provider returned a billing error — your API key has run out of credits or has an insufficient balance. Check your provider's billing dashboard and top up or switch to a different API key.
The error is misleading — no API billing limits have actually been reached. More critically, when this error appears, the agent's actual response is sometimes not delivered, requiring the user to re-send their message to get a reply.
Environment
- OpenClaw version: 2026.2.9 (33c75cb)
- Channel: Telegram
- Auth: Claude Max 20x (OAuth token)
- Other APIs: Grok (xAI) for web search, Gemini for memory embeddings
- Context at time of error: 100% (200k/200k)
Reproduction
- Occurs intermittently during active conversation
- No specific trigger identified — happens on normal text responses (no tool calls)
- Not correlated with web_search, memory_search, or any specific tool
- More frequent during long/heavy sessions near context limit
What we've ruled out
- Anthropic weekly allowance — confirmed ~90% remaining
- Grok/xAI credits — confirmed $23+ balance remaining
- Gemini API — billed through Google Workspace, no limits hit
Key issues
- Error message is misleading — says "billing" but no billing limit is actually reached
- Swallows the agent's response — user sees error instead of the actual reply, has to re-ping
- Not logged anywhere — checked
journalctl -u openclaw, session transcripts, and~/.openclaw/logs/— no trace of the error - Intermittent — not every message, making it hard to diagnose
Expected behavior
- If a transient API error occurs, retry before surfacing to user
- If surfaced, don't swallow the actual response
- Log the underlying error (HTTP status code, provider, endpoint) for diagnosis
Suspected cause
Possibly transient Anthropic rate limiting (per-minute, not weekly allowance) being caught and displayed as a billing error. May be related to high context usage (100%) triggering compaction-related API calls.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingstaleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.