# Claude CLI works directly, but OpenClaw returns an API billing error

**URL:** <https://community.openclaw.ai/t/claude-cli-works-directly-but-openclaw-returns-an-api-billing-error/87>\
**Category:** Troubleshooting\
**Tags:** anthropic, authentication, claude-cli, models, routing\
**Created:** [September 14, 2026, 10:31pm UTC](https://community.openclaw.ai/t/claude-cli-works-directly-but-openclaw-returns-an-api-billing-error/87 "2026-09-14T22:31:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArchivedMember](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@ArchivedMember](https://community.openclaw.ai/u/ArchivedMember)\
**Post date:** [September 14, 2026, 10:31pm UTC](https://community.openclaw.ai/t/claude-cli-works-directly-but-openclaw-returns-an-api-billing-error/87/1 "2026-09-14T22:31:18Z")

</div>

> **Adapted community discussion:** Paraphrased and condensed from an anonymized public OpenClaw Discord support conversation from September 2026. Technical guidance was reviewed for OpenClaw 2026.9.3.

I normally use Claude CLI credentials with OpenClaw, but today OpenClaw reports an API billing or insufficient-balance error. My Claude subscription login appears valid.

---

<div class="post-metadata">

**Author:** ![OpenClawSupport](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@OpenClawSupport](https://community.openclaw.ai/u/OpenClawSupport)\
**Post date:** [September 14, 2026, 10:31pm UTC](https://community.openclaw.ai/t/claude-cli-works-directly-but-openclaw-returns-an-api-billing-error/87/2 "2026-09-14T22:31:18Z")

</div>

First distinguish a Claude subscription route from a direct Anthropic API-key route. Check for an `ANTHROPIC_API_KEY` environment override, confirm the Claude CLI login, and record the exact error and CLI version. Do not post credentials or organization details.

---

<div class="post-metadata">

**Author:** ![ArchivedMember](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@ArchivedMember](https://community.openclaw.ai/u/ArchivedMember)\
**Post date:** [September 14, 2026, 10:31pm UTC](https://community.openclaw.ai/t/claude-cli-works-directly-but-openclaw-returns-an-api-billing-error/87/3 "2026-09-14T22:31:18Z")

</div>

Enabling paid overflow makes OpenClaw work, even though the visible utilization meter is not full. Claude Code itself works on the same model without overflow. The failure only happens through OpenClaw.

---

<div class="post-metadata">

**Author:** ![OpenClawSupport](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@OpenClawSupport](https://community.openclaw.ai/u/OpenClawSupport)\
**Post date:** [September 14, 2026, 10:31pm UTC](https://community.openclaw.ai/t/claude-cli-works-directly-but-openclaw-returns-an-api-billing-error/87/4 "2026-09-14T22:31:18Z")

</div>

That changes the diagnosis, but the model prefix alone does not prove which billing path OpenClaw is using. On OpenClaw 2026.9.3, `anthropic/...` is the canonical model reference for both direct Anthropic API execution and models delegated to Claude CLI through an `agentRuntime` mapping. Legacy `claude-cli/...` references still work for compatibility. Update OpenClaw, then inspect the configured model, runtime mapping, and auth state without probing:

```bash
openclaw --version
openclaw models status
openclaw config get agents.defaults.model --json
openclaw config get agents.defaults.models --json

```

---

<div class="post-metadata">

**Author:** ![ArchivedMember](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@ArchivedMember](https://community.openclaw.ai/u/ArchivedMember)\
**Post date:** [September 14, 2026, 10:31pm UTC](https://community.openclaw.ai/t/claude-cli-works-directly-but-openclaw-returns-an-api-billing-error/87/5 "2026-09-14T22:31:18Z")

</div>

The default is a `claude-cli` model and native CLI auth is listed, but the status also shows direct Anthropic fallbacks and older stored credentials.

---

<div class="post-metadata">

**Author:** ![OpenClawSupport](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@OpenClawSupport](https://community.openclaw.ai/u/OpenClawSupport)\
**Post date:** [September 14, 2026, 10:31pm UTC](https://community.openclaw.ai/t/claude-cli-works-directly-but-openclaw-returns-an-api-billing-error/87/6 "2026-09-14T22:31:18Z")

</div>

Temporarily clear only the fallbacks that the configuration confirms use direct API-key execution. Start a fresh session pinned to an Anthropic model whose `agentRuntime.id` is `claude-cli`, then capture one sanitized live error. The important distinction is an actual 401 from the CLI subprocess versus a 429 or extra-usage response. Do not top up a direct API credential until the active runtime and auth path are proven.

---

<div class="post-metadata">

**Author:** ![ArchivedMember](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@ArchivedMember](https://community.openclaw.ai/u/ArchivedMember)\
**Post date:** [September 14, 2026, 10:31pm UTC](https://community.openclaw.ai/t/claude-cli-works-directly-but-openclaw-returns-an-api-billing-error/87/7 "2026-09-14T22:31:18Z")

</div>

A direct noninteractive `claude -p` call succeeds under the same account, but OpenClaw logs show `provider=claude-cli` returning HTTP 401. I cleared the stale OpenClaw profiles and restarted, yet OpenClaw still reports the API error.

---

<div class="post-metadata">

**Author:** ![OpenClawSupport](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@OpenClawSupport](https://community.openclaw.ai/u/OpenClawSupport)\
**Post date:** [September 14, 2026, 10:31pm UTC](https://community.openclaw.ai/t/claude-cli-works-directly-but-openclaw-returns-an-api-billing-error/87/8 "2026-09-14T22:31:18Z")

</div>

The remaining possibilities are a different Gateway process or configuration, or an OpenClaw CLI-backend credential-handoff bug. Confirm the active Gateway version and config path with `openclaw status --all`, then compare one isolated local run:

```bash
openclaw agent --local --agent main --message "ping"

```

If direct `claude -p` succeeds while the isolated OpenClaw CLI backend still returns 401, preserve the sanitized version, route, and error lines for an OpenClaw issue.
