cd /news/developer-tools/openclaw-migrating-from-anthropic-ap… · home topics developer-tools article
[ARTICLE · art-30268] src=gist.github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

OpenClaw: migrating from anthropic/ API backend to claude-cli/ (Claude Code CLI) to use Max/Pro subscription instead of API credits

OpenClaw developers migrated from the Anthropic API backend to the Claude Code CLI backend to use their Max/Pro subscription instead of API credits. The change routes requests through the local Claude CLI binary, which authenticates via subscription, avoiding extra usage billing. Configuration updates include adding a claude-cli backend definition, mapping model aliases, and updating cron jobs to use claude-cli models.

read2 min views1 publishedJun 16, 2026

Anthropic changed billing so third-party API apps draw from "extra usage" credits, not plan limits. If you're on a Max/Pro subscription, using the anthropic/

provider hits API billing instead of your subscription. The claude-cli/

backend routes through the Claude Code CLI binary, which authenticates via your subscription — no API credits needed.

claude --version        # should be 2.x+
claude auth status      # should show authMethod: claude.ai, subscriptionType: max/pro

Under agents.defaults.cliBackends

, add:

"claude-cli": {
  "command": "/path/to/claude",
  "args": ["-p", "--output-format", "stream-json", "--verbose", "--permission-mode", "bypassPermissions"],
  "resumeArgs": ["-p", "--output-format", "stream-json", "--verbose", "--permission-mode", "bypassPermissions", "--resume", "{sessionId}"],
  "output": "jsonl",
  "input": "arg",
  "modelArg": "--model",
  "modelAliases": {
    "opus": "opus",
    "claude-opus-4-6": "opus",
    "sonnet": "sonnet",
    "claude-sonnet-4-6": "sonnet",
    "haiku": "haiku",
    "claude-haiku-3-5": "haiku"
  },
  "sessionArg": "--session-id",
  "sessionMode": "always",
  "sessionIdFields": ["session_id", "sessionId", "conversation_id", "conversationId"],
  "systemPromptArg": "--append-system-prompt",
  "systemPromptMode": "append",
  "systemPromptWhen": "first",
  "clearEnv": ["ANTHROPIC_API_KEY"],
  "serialize": false
}

Find your claude binary path with which claude

.

Under agents.defaults.models

:

"claude-cli/claude-opus-4-6": { "alias": "opus" },
"claude-cli/claude-sonnet-4-6": { "alias": "sonnet" },
"claude-cli/claude-haiku-4-5": { "alias": "haiku" }
"agents.defaults.model": {
  "primary": "claude-cli/claude-opus-4-6",
  "fallbacks": ["openai-codex/gpt-5.4"]
}

Change all cron jobs that use anthropic/claude-*

models to claude-cli/claude-*

:

grep -n "anthropic/" ~/.openclaw/cron/jobs.json

sed -i 's|"anthropic/claude-opus-4-6"|"claude-cli/claude-opus-4-6"|g' ~/.openclaw/cron/jobs.json
sed -i 's|"anthropic/claude-sonnet-4-6"|"claude-cli/claude-sonnet-4-6"|g' ~/.openclaw/cron/jobs.json
systemctl --user restart openclaw-gateway
journalctl --user -u openclaw-gateway -n 20

journalctl --user -u openclaw-gateway | grep "cli exec"

grep "anthropic/" ~/.openclaw/openclaw.json
Setting Recommended Why
serialize
false
Allows parallel sessions (crons + conversations)
maxConcurrent
10-20 Each CLI process is ~200-400MB; scale to your RAM
timeoutSeconds (crons)
600+ CLI startup adds overhead vs direct API

Gateway startup logs startup model warmup failed for claude-cli/claude-opus-4-6: Error: Unknown model

. This is harmless — the warmup probe uses the fully-qualified name but runtime routing via aliases works fine.

You can leave anthropic/

entries in the models catalog — they're just idle definitions. Just make sure nothing references them as a primary model or in cron job payloads.

── more in #developer-tools 4 stories · sorted by recency
── more on @anthropic 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/openclaw-migrating-f…] indexed:0 read:2min 2026-06-16 ·