← All applications · Connect apps section on /docs
Anthropicconfigure claude
Claude Code
Also known as: Claude CLI · claude
Tác tử lập trình Anthropic trên terminal (và extension IDE). Đây là app phổ biến nhất với Vietrouter.
Base URL to paste
Paste exactly one of two formats — wrong URL yields 404 (not 401).
https://vietrouter.com.vnPrerequisites
- Đã cài lệnh `claude` (Claude Code)
- API key sk-mtm-…
- Nếu từng login Anthropic: chạy `/logout` trong Claude Code trước
Recommended model: claude-fable-5
Quick way — command / config
npm install -g API CLI@latest
api-cli configure claude -k 'sk-mtm-...' -m claude-fable-5
api-cli doctorWhere to place file / fill Settings
Filemacos
~/.claude/settings.json
Tạo/sửa file JSON như tab settings.json. Backup trước khi sửa tay. Ưu tiên `api-cli configure claude` (có backup timestamp).
Filelinux
~/.claude/settings.json
Giống macOS. Kiểm tra: `cat ~/.claude/settings.json | head`.
Filewindows
%USERPROFILE%\.claude\settings.json
PowerShell: `notepad $env:USERPROFILE\.claude\settings.json`. Dùng ANTHROPIC_AUTH_TOKEN (không phải ANTHROPIC_API_KEY).
Fileany
.claude/settings.local.json (trong repo)
Chỉ áp dụng một dự án. Đưa vào .gitignore nếu chứa key.
Verify connection
- `claude` mở được; gửi “ping”.
- `echo $ANTHROPIC_BASE_URL` (Unix) phải là https://vietrouter.com.vn
- Dashboard → Sử dụng có request mới.
Troubleshooting
| Symptom | Reason | How to handle |
|---|---|---|
| Cứ đòi đăng nhập Anthropic | Còn session OAuth cũ. | Trong Claude Code chạy `/logout`, đặt lại ANTHROPIC_AUTH_TOKEN, mở terminal mới. |
| 404 | BASE_URL có thừa /v1. | Phải là https://vietrouter.com.vn (không /v1). |
| 401 | Dùng nhầm ANTHROPIC_API_KEY hoặc key sai. | Dùng ANTHROPIC_AUTH_TOKEN=sk-mtm-… |
Notes
- Khuyến nghị một key riêng cho máy Claude Code.
- API CLI merge env an toàn hơn sửa tay cả file.