A tools/llm run is refused, though the key works and the credits are there
Symptoms
A tool in tools/llm/ stops with one of these messages, and nothing is spent:
Credit balance is too low, fromheadless.pyorskillcheck.py, whileask.pyworks with the same key.Claude Code 2.1.190 does not support this model; version 2.1.280 or newer is required.This API key is not scoped to a workspace, so this request must include the anthropic-workspace-id header.Set GAMEFRAME_ANTHROPIC_API_KEY for GAMEFRAME_LLM_PROVIDER=anthropic.
Cause
Each message has its own cause (observed on 2026-10-24).
- The credits pay for API-key use. They do not pay for Claude Code started from the desktop app. A run started from inside a Claude Code session inherited that session's
CLAUDE*variables, such asCLAUDE_CODE_ENTRYPOINT, and counted as part of the session. - The installed
claudewas older than the model. - The key belonged to the organization and to no workspace.
- The key was not in the environment or in the
.envof the current folder, the project or GameFrame.
Evidence
A request through the SDK with the same key and max_tokens up to 64000 succeeded, while claude -p --bare failed. With the CLAUDE* variables left out, the same claude -p call succeeded for $0.004.
What to do
Pull GameFrame: since 2026-10-24, client.py leaves the CLAUDE* variables out of every run it starts. Then fix whichever message remains.
- An old
claude: runclaude update, or setGAMEFRAME_CLAUDEto a newerclaude. - No workspace: create the key in a workspace, or put
GAMEFRAME_ANTHROPIC_WORKSPACE_ID=...in.env. - No key: put
GAMEFRAME_ANTHROPIC_API_KEY=...in the project's.env, then select the service withGAMEFRAME_LLM_PROVIDER=anthropicfor the task. - Check the setup with
./gameframe run tools/llm/client.py.
Tried
- A larger or smaller
max_tokens: no change; the balance was never the cause.