Claude Code fails silently when ANTHROPIC_API_KEY is set in cloud environments

✍️ OpenClawRadar📅 Published: May 1, 2026🔗 Source
Claude Code fails silently when ANTHROPIC_API_KEY is set in cloud environments
Ad

Claude Code (CC) has a known issue: if you set the ANTHROPIC_API_KEY environment variable in a cloud environment, Claude Code will fail to execute any commands. The variable overrides CLI billing and routes all calls through the Anthropic API, leading to unexpected charges and a dead tool. This was reported on Hacker News with a reference to the GitHub issue #54497.

Ad

Key details from the discussion

  • Environment variable triggers failure: Setting ANTHROPIC_API_KEY in cloud environments (e.g., CI/CD, containers) causes Claude Code to stop working. The tool attempts to use the API key for billing, effectively disabling its free tier or local billing mechanism.
  • Extra usage charges: One user reported seeing a lot of "Extra usage" in their Anthropic billing — likely because every Claude Code call was being proxied through the API key, incurring per-request costs.
  • Misguided documentation: Another commenter noted that Anthropic's own documentation previously (and incorrectly) advised adding ANTHROPIC_API_KEY for Claude Code Web usage. This led to accidental charges. Anthropic later updated the docs but refused to refund the incurred costs.
  • Workaround: Do not set ANTHROPIC_API_KEY in cloud environments where Claude Code runs. Use alternative authentication methods (e.g., CLI‑based credentials or separate billing tokens) if needed.

Who this affects

Developers using Claude Code in CI/CD pipelines, containerized environments, or any cloud‑based infrastructure where environment variables are injected globally.

📖 Read the full source: HN AI Agents

Ad

👀 See Also

iknowkungfu Skill Analyzes OpenClaw Usage to Recommend Missing Skills
Tools

iknowkungfu Skill Analyzes OpenClaw Usage to Recommend Missing Skills

iknowkungfu is a new OpenClaw skill that scans your agent's workspace, memory files, and conversation logs to identify what skills you're missing based on your actual usage patterns. It provides specific recommendations with trust scores and reasons tied to your workflow.

OpenClawRadar
Exasol Releases MCP Server for Database Context in AI Agent Workflows
Tools

Exasol Releases MCP Server for Database Context in AI Agent Workflows

Exasol has released an MCP Server that enables databases to provide context to AI agents about available data, business rules, and safe interaction methods. The server is read-only by default, supports high-concurrency workflows, and can be deployed on-prem, in cloud, or hybrid environments.

OpenClawRadar
MOOSE-Star: A 7B Model and 108K-Paper Dataset for Scientific Hypothesis Discovery – ICML 2026
Tools

MOOSE-Star: A 7B Model and 108K-Paper Dataset for Scientific Hypothesis Discovery – ICML 2026

MiroMind releases MOOSE-Star on Hugging Face: a 7B model (DeepSeek-R1-Distill-Qwen-7B fine-tune) for scientific hypothesis discovery, alongside the 108K-paper TOMATO-Star dataset. Benchmark shows MS-7B achieves 54.34% inspiration retrieval accuracy, beating GPT-5.4 and approaching Gemini-3 Pro.

OpenClawRadar
Calmkeep: An External Continuity Layer to Counter LLM Drift in Extended Sessions
Tools

Calmkeep: An External Continuity Layer to Counter LLM Drift in Extended Sessions

Calmkeep is an external continuity layer designed to counteract LLM drift in extended sessions, showing 85% integrity vs 60% for standard Claude in a 25-turn backend build test and 100% vs 50% in a legal session.

OpenClawRadar