- Sau ba tháng flip-flop, Anthropic staff xác nhận OpenClaw-style Claude Code CLI usage là sanctioned.
- Bridge claude-cli đã GA — bạn có thể chạy Opus 4.7, Sonnet 4.6 qua gateway OpenClaw bằng subscription flat-rate, reuse local session, không cần API key.
- Đây là config đầy đủ, trade-off so với API key, và timeline policy để hiểu rủi ro.
TL;DR
Ngày 22/04/2026, Anthropic staff (Thariq Shihipar — Claude Code team, và Boris Cherny — Claude Code PM) public confirm: chạy OpenClaw inside một phiên claude -p chính thức là compliant với ToS. OpenClaw phát hành bundled backend claude-cli. Bridge cho phép reuse local login của Claude Code CLI → gateway route toàn bộ agent fleet qua subscription Pro ($20) / Max 5x ($100) / Max 20x ($200), không tiêu API credit. Vẫn bị cấm: nhét OAuth token vào harness tự viết (server-side block + Extra Usage billing từ 04/04/2026).
What's new
Chuỗi sự kiện cực căng trong Q1 2026 đã hạ nhiệt. OpenClaw viết trong docs mới: "Anthropic staff told us OpenClaw-style Claude CLI usage is allowed again, so OpenClaw treats Claude CLI reuse and claude -p usage as sanctioned for this integration unless Anthropic publishes a new policy."
PR Anthropic gửi The New Stack: "Nothing changes around how customers have been using their account and Anthropic will not be canceling accounts. The update was a clarification of existing language in our docs to make it consistent across pages."
Có hai path phân biệt rõ:
- Allowed: chạy agent bên trong session
claudeCLI chính thức (claude -p), reuse login hiện tại. OpenClaw spawn binaryclaudelocal, không extract token. - NOT allowed: tự cầm OAuth token
sk-ant-oat-*gọi API endpoint bằng harness khác. Đường này bị block server-side và charge Extra Usage (pay-as-you-go API rate) từ 04/04.
Cách wire bridge vào OpenClaw
4 bước, thao tác hoàn toàn local:
- Login CLI:
claude auth login - Lấy binary path:
which claude - Paste vào
openclaw.json→agents.defaults.cliBackends:
"cliBackends": {
"claude-cli": {
"command": "<output của which claude>",
"args": ["-p", "--output-format", "json"],
"input": "arg",
"output": "json",
"serialize": true,
"sessionArg": "--session-id",
"sessionMode": "existing"
}
},
"model": { "primary": "claude-cli/claude-opus-4-6" },
"models": {
"claude-cli/claude-opus-4-6": {},
"claude-cli/claude-opus-4-7": {},
"claude-cli/claude-sonnet-4-6": {}
}- Restart gateway. OpenClaw tự persist session ID per backend, follow-up turn reuse cùng CLI session để context liên tục.
Cosmetic warning startup model warmup failed for claude-cli/claude-opus-4-6: Error: Unknown model là harmless — warmup probe dùng fully-qualified name nhưng runtime alias routing vẫn chạy ngon.
Technical facts đáng nhớ
- Models mapped qua prefix
claude-cli/: Opus 4.7, Opus 4.6, Sonnet 4.6. - Mỗi CLI process ~200–400 MB RAM. Recommended:
maxConcurrent: 10–20,timeoutSeconds: 600+,serialize: falsenếu cần parallel cron + conversation. - Skills pipeline: OpenClaw inject skills catalog vào appended system prompt và pass temporary plugin qua
--plugin-dirđể native skill resolver của Claude Code thấy filtered set. - JSONL streaming hỗ trợ qua
jsonlDialect: "claude-stream-json". Images pass quaimageArg. - OpenClaw drop stored session khi backend auth state thay đổi (relogin, token rotation, profile change).
CLI bridge vs. API key trực tiếp
| Tiêu chí | claude-cli bridge | anthropic/ API key |
|---|---|---|
| Billing | Flat sub Pro / Max 5x / Max 20x | Per-token (Extra Usage) |
| Prompt caching | Không honor (legacy OAuth) | 5 min / 1 hour, ~90% discount |
| 1M context beta | Rejected với OAuth legacy | Supported qua context1m |
| Tool calls | Không inject trực tiếp, cần bundleMcp | Full tool-use API |
| Overhead | CLI spawn, ~200–400 MB / process | Direct HTTP, tối thiểu |
| Phù hợp | Personal automation, homelab, prototype | Production, always-on gateway, business |
Chính Anthropic staff nói: "if you're building a business on top of the Agent SDK, you should use an API key instead." Và OpenClaw docs đồng tình: "Anthropic API keys remain the clearest production path for always-on gateway hosts and explicit server-side billing control."
Use cases thực tế
Target chính là indie hacker, homelab owner, solo automation junkie muốn max-out Pro/Max subscription:
- Agent morning-briefing, CI watcher bắn Telegram, meeting-note summarizer, flight-delay checker — tất cả qua OpenClaw channel (WhatsApp, Telegram, Discord, iMessage).
- Homelab self-heal:
claude -pfire khi Grafana alert, không chạy cron mù để không đốt quota. - Advanced (qua plugin
openclaw-claude-codecủa Enderfga): Ultrareview launch fleet 5–20 bug-hunter agents review codebase parallel theo góc security/perf/logic/types; Ultraplan dedicated Opus session 30 phút ra implementation plan; Multi-Agent Council worktree-isolated agents vote consensus trước khi apply code.
Cho team đang làm sản phẩm thật: Anthropic push bạn dùng Claude Code trực tiếp (repo-aware, IDE native, managed security) hoặc Team/Enterprise seats. OpenClaw đóng vai trò ambient ops layer bên cạnh, không thay thế.
Limitations & pricing reality
- Rate limits: user Pro report hit cap sau 4–6 message dài. Cooldown scope theo model — Opus cool thì Sonnet vẫn chạy.
/usagelà người bạn mới. - Không có prompt caching trên path OAuth legacy → mất 90% cache discount so với API key.
- Policy reversal risk rất thật. Giao tiếp qua tweet thay vì blog post chính thức làm cộng đồng mất niềm tin: "tomorrow, it won't be allowed any more and accounts will be closed without prior notice."
- Security posture self-hosted: CVE-2026-25253 (CVSS 8.8, WebSocket RCE, fix v2026.1.29); ClawHub supply-chain attack Feb 2026 — 341 skill chứa Atomic Stealer. Bind gateway
127.0.0.1, setALLOW_ORIGIN, chạyopenclaw security audit --deeptrước khi install bất kỳ skill nào. - Cost range thực tế 2026: $7–25/mo (Kimi K2.5 / MiniMax trên VPS rẻ), $60–120 (Sonnet API + managed host), $150–300+ (Opus API always-on), $59/mo (OpenClaw Cloud BYOK + API phí).
What's next
Timeline đáng để track: Jan 2026 server-side enforcement bắt đầu → Feb ToS update + backlash → Apr 4 hard block OAuth token direct → mid-Apr sanctioned claude -p path. Dự đoán: Anthropic sẽ formalize policy trên blog thay vì tweet; 1M context GA cho subscription auth; khả năng có tier "Ultra" $500+. Nhiều user đang hedge sang Codex, Gemini, MiniMax, Kimi K2.5 để giữ budget dự đoán được.
Muốn thử ngay hôm nay? Path an toàn nhất: dùng claude-cli bridge cho experiment và homelab, giữ API key cho bất kỳ flow nào always-on hoặc commercial. Đừng build business lên OAuth token — cửa đó vẫn đóng chặt.
Nguồn: OpenClaw CLI Backends docs, OpenClaw Anthropic provider docs, The New Stack, Hacker News discussion, Migration gist, @ziwenxu_ walkthrough.
