#404 No active credentials for provider: openai-compatible-chat-75df4ece-9661-49c5-93dd-a78807a78e64
1 messages · Page 1 of 1 (latest)
404 No active credentials for provider: openai-compatible-chat-75df4ece-9661-49c5-93dd-a78807a78e64
mình nhận được tin nhắn này, làm sao để sửa bạn
Yep, let’s fix it.
If the error is No active credentials for provider: openai-compatible-chat-..., that usually means OpenClaw is trying to use a custom OpenAI-compatible provider, but that provider has no usable key on the gateway host.
Please paste these first:
openclaw --version
openclaw models status --plain
If you use a remote gateway, run those on the gateway machine, not your laptop.
Most common causes:
- You meant to use regular OpenAI, but the model is set to a custom
openai-compatible-chat-...provider instead ofopenai/... - You are using a custom proxy/provider, but
models.providers.<provider-id>.apiKeyis missing - You used env/ref mode, but the gateway cannot resolve that env var
- It is a local server, but the
baseUrlis wrong for where the gateway is running
Docs:
https://docs.openclaw.ai/help/faq
https://docs.openclaw.ai/concepts/model-providers
Paste those outputs and I’ll tell you the exact next step.
Lỗi này thường có nghĩa là OpenClaw đang dùng một custom OpenAI-compatible provider (openai-compatible-chat-...), nhưng provider đó chưa có credential/API key hợp lệ trên máy chạy gateway.
Bạn kiểm tra trên máy chạy gateway trước nhé:
openclaw --version
openclaw models status --plain
Nếu gateway chạy ở VPS/server thì chạy trên server đó, không phải trên laptop.
Các nguyên nhân hay gặp:
- Bạn định dùng OpenAI thường, nhưng model lại đang trỏ tới
openai-compatible-chat-...thay vìopenai/... - Bạn dùng provider custom/proxy, nhưng thiếu
models.providers.<provider-id>.apiKey - Bạn dùng env/ref mode, nhưng gateway không đọc được biến env đó
- Bạn dùng local server, nhưng
baseUrlkhông phảihttp://127.0.0.1:...hoặchttp://localhost:...trên chính máy gateway
Docs:
https://docs.openclaw.ai/help/faq
https://docs.openclaw.ai/concepts/model-providers
Bạn paste output của 2 lệnh trên đây, mình sẽ chỉ đúng bước sửa tiếp theo.
🦞 OpenClaw 2026.4.11 (769908e)
I'll butter your workflow like a lobster roll: messy, delicious, effective.
9router-openai/Ryan
vẫn chưa chạy đc
Ok, mình thấy manh mối rồi.
2026.4.11 thì ổn. Điểm lạ là bạn paste 9router-openai/Ryan, nhưng lỗi của thread lại là openai-compatible-chat-....
Cái này thường có nghĩa là thread/session hiện tại vẫn đang bị ghim vào provider cũ, dù default model của bạn đã đổi rồi.
Thử ngay trong chính thread này:
/model status
Nếu vẫn hiện provider cũ, chạy tiếp:
/new
rồi nhắn lại thử một câu mới, hoặc dùng:
/model
để chọn lại model 9router-openai/Ryan.
Nếu vẫn chưa được, paste đầy đủ output của 3 lệnh này nhé:
openclaw models status --plain
openclaw config get agents.defaults.model --json
openclaw config get models.providers --json
Nhớ xóa API key/token trước khi paste.
Docs:
https://docs.openclaw.ai/tools/slash-commands
https://docs.openclaw.ai/cli/models
Mình nghi mạnh là lỗi session cũ đang giữ provider cũ thôi.
TypeError: Cannot read properties of undefined (reading 'trim')
À, cái này là lỗi khác rồi, không còn là lỗi credential nữa.
TypeError: Cannot read properties of undefined (reading 'trim') thường là dấu hiệu session cũ bị hỏng / kẹt ở bootstrapping.
Thử theo thứ tự này nhé:
- Trong thread này gửi:
/new
-
Nếu vẫn lỗi, tạo thread/chat mới rồi thử nhắn lại một câu đơn giản.
-
Nếu session mới cũng dính y chang, chạy trên máy gateway:
openclaw status --all
openclaw gateway status
và paste output lên đây.
Nếu cả session mới vẫn hỏng, khả năng cao là session store (sessions.json) của agent đang stale/bad. Bước đó đụng vào state file, nên mình muốn xem openclaw status --all trước rồi chỉ đúng chỗ cần backup/reset, đỡ làm bừa.
Docs:
https://docs.openclaw.ai/gateway/troubleshooting
Mình nghi mạnh là session state bị kẹt, không phải model key nữa.
Version │ 2026.4.14 │
│ OS │ macos 15.5 (arm64) │
│ Node │ 22.22.2 │
│ Config │ ~/.openclaw/openclaw.json │
│ Dashboard │ http://127.0.0.1:18789/ │
│ Tailscale │ off │
│ Channel │ stable (default) │
│ Update │ pkg │
│ Gateway │ local · ws://127.0.0.1:18789 (local loopback) · │
│ │ unreachable │
│ Security │ Run: openclaw security audit --deep │
│ Gateway self │ unknown │
│ Gateway service │ LaunchAgent installed · loaded · running (pid 13365) │
│ Node service │ LaunchAgent not installed │
│ Agents │ 0 total · 0 bootstrapping · 0 active · 0 sessions │
│ Secrets │ none │
└─────────────────┴────────────────────────────────────────────────
Gateway health:
gateway unreachable
Ok, ra đúng nút thắt rồi.
Đây chưa phải lỗi model/auth nữa. Dòng quan trọng là:
Gateway ... unreachableGateway service ... running
Tức là launchd nghĩ service đang chạy, nhưng gateway thực tế không trả lời trên 127.0.0.1:18789.
Làm theo đúng thứ tự này nhé:
openclaw gateway restart
openclaw gateway status
openclaw logs --follow
Ở openclaw gateway status, mình cần đặc biệt 3 dòng này:
Probe targetListeningLast gateway error
Paste output đó lên đây.
Nếu gateway status cho thấy Config (cli) khác Config (service), chạy tiếp:
openclaw gateway install --force
openclaw gateway restart
Rồi kiểm tra lại openclaw gateway status.
Ngoài ra:
Agents: 0Secrets: none
cho thấy config/onboarding của bạn cũng chưa ổn hẳn, nhưng phải làm gateway reachable trước đã, rồi mới xử lý model/provider tiếp.
Docs:
https://docs.openclaw.ai/gateway/troubleshooting
https://docs.openclaw.ai/help/faq
Paste openclaw gateway status tiếp nhé, mình đọc tiếp cho.
Yep, vậy là gateway chưa lên thật rồi.
gateway unreachable mới chỉ là summary, chưa cho biết lỗi gốc. Chạy 3 lệnh này và paste nguyên output nhé:
openclaw config get gateway.mode
openclaw gateway status --deep
openclaw doctor
Check nhanh:
gateway.modenên làlocal
Nếu vẫn chưa rõ, làm thêm bước này:
openclaw logs --follow
rồi ở terminal khác chạy:
openclaw gateway restart
Sau đó copy khoảng 10-20 dòng lỗi đầu tiên từ logs --follow lên đây.
Mình cần cái status --deep hoặc log error đầu tiên mới chẩn đúng được.
🦞 OpenClaw 2026.4.14 (323493f)
If something's on fire, I can't extinguish it—but I can write a beautiful postmortem.
Restarted LaunchAgent: gui/501/ai.openclaw.gateway
Timed out after 60s waiting for gateway port 18789 to become healthy.
Service runtime: status=stopped, state=spawn scheduled
Gateway port 18789 status: free.
Gateway restart timed out after 60s waiting for health checks.
Tip: openclaw gateway status --deep
Tip: openclaw doctor
🦞 OpenClaw 2026.4.14 (323493f)
I'm the reason your shell history looks like a hacker-movie montage.
│
◇
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-04-16.log
Command: /opt/homebrew/opt/node@22/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 15733)
Warm-up: launch agents can take a few seconds. Try again shortly.
RPC probe: failed
RPC target: ws://127.0.0.1:18789
gateway closed (1006):
Gateway port 18789 is not listening (service appears running).
Last gateway error: 2026-04-16T12:54:45.098-04:00 Gateway start blocked: existing config is missing gateway.mode. Treat this as suspicious or clobbered config. Re-run openclaw onboard --mode local or openclaw setup, set gateway.mode=local manually, or pass --allow-unconfigured.
Logs: ~/.openclaw/logs/gateway.log
Errors: ~/.openclaw/logs/gateway.err.log
Gateway not reachable. Is it running and accessible?
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /Users/ryanmac/.openclaw/openclaw.json
Bind: loopback
Ok, giờ rõ hẳn rồi, root cause là:
~/.openclaw/openclaw.json đang bị thiếu gateway.mode
Đó là lý do gateway không lên được. Lỗi credential ban đầu chỉ là hậu quả thôi.
Cách fix nhanh nhất
Chạy:
openclaw config set gateway.mode local
openclaw gateway restart
openclaw gateway status
gateway status sau đó phải hết unreachable.
Nếu bạn muốn repair kiểu “an toàn hơn”
Chạy:
openclaw setup
openclaw gateway restart
Rồi kiểm tra lại:
openclaw gateway status
Mình recommend thử config set gateway.mode local trước, vì đúng ngay lỗi vừa báo.
Docs:
https://docs.openclaw.ai/cli/gateway
https://docs.openclaw.ai/cli/setup
https://docs.openclaw.ai/gateway/troubleshooting
Nếu chạy xong mà vẫn lỗi, paste lại openclaw gateway status nhé, lúc đó mình đọc bước tiếp.
🦞 OpenClaw 2026.4.14 (323493f) — Ah, the fruit tree company! 🍎
│
◇
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-04-16.log
Command: /opt/homebrew/opt/node@22/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 16422)
RPC probe: ok
Listening: 127.0.0.1:18789
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
Nice, vậy là gateway đã khỏe lại rồi 🎉
Dòng quan trọng là:
RPC probe: okListening: 127.0.0.1:18789
Giờ làm tiếp 2 bước:
- Trong thread này gửi:
/new
hoặc mở thread/chat mới
- Thử nhắn lại bot một câu
Vì lỗi cũ có thể nằm ở session cũ hoặc credential của model/provider.
Nếu vẫn còn lỗi No active credentials...
Paste tiếp mấy lệnh này nhé:
openclaw models status --plain
openclaw config get agents.defaults.model --json
openclaw config get models.providers --json
Nhớ che API key/token trước khi paste.
Docs:
https://docs.openclaw.ai/cli/models
Giờ mình nghĩ gateway đã xong, còn lại là phần model/provider config thôi.
vẫn bị TypeError: Cannot read properties of undefined (reading 'trim') khi openclaw onboard --install-daemon telegram setup
À, vậy thì mình nghĩ đây là bug của flow onboarding, không phải Telegram itself.
Quan trọng: theo docs, Telegram không có flow login/setup riêng kiểu đó. Telegram setup đúng là:
- lấy bot token từ BotFather
- cấu hình token vào config hoặc
~/.openclaw/.env - restart gateway
- DM bot rồi approve pairing
Trên macOS, vì bạn đang chạy bằng LaunchAgent, mình khuyên dùng ~/.openclaw/.env chứ đừng chỉ set env trong shell.
Workaround nên làm ngay
- Đừng dùng flow
... telegram setupnữa - Dùng
openclaw setuphoặcopenclaw onboard --install-daemon - Sau đó cấu hình Telegram thủ công:
~/.openclaw/.env
TELEGRAM_BOT_TOKEN=123456:abc...
~/.openclaw/openclaw.json
{
channels: {
telegram: {
enabled: true,
dmPolicy: "pairing"
}
}
}
Rồi restart:
openclaw gateway restart
Sau đó:
openclaw pairing list telegram
openclaw pairing approve telegram <CODE>
Docs:
https://docs.openclaw.ai/channels/telegram
https://docs.openclaw.ai/help/faq
Nếu bạn muốn report bug này, paste luôn exact command + full stack trace rồi mở issue tại:
https://github.com/openclaw/openclaw/issues
Nếu muốn, mình có thể viết cho bạn luôn một snippet openclaw.json hoàn chỉnh cho Telegram DM-only.
remove openclaw
Nếu bạn muốn gỡ hẳn OpenClaw trên máy này, làm như này:
openclaw uninstall --all --yes
npm rm -g openclaw
Lý do có 2 bước:
openclaw uninstall --allgỡ service + state + workspace + app- nhưng CLI vẫn còn, nên cần
npm rm -g openclawnữa
Nhìn từ path của bạn (/opt/homebrew/lib/node_modules/openclaw), bản này trông như được cài global qua npm.
Nếu bạn chỉ muốn xóa sạch dữ liệu/config nhưng giữ CLI, dùng:
openclaw reset --scope full --yes --non-interactive
Nếu muốn backup trước khi gỡ:
openclaw backup create
Docs:
https://docs.openclaw.ai/install/uninstall
https://docs.openclaw.ai/cli/uninstall
ryanmac@Mac ~ % openclaw gateway install
🦞 OpenClaw 2026.4.14 (323493f)
I autocomplete your thoughts—just slower and with more API calls.
Config overwrite: /Users/ryanmac/.openclaw/openclaw.json (sha256 341afc4f1439f17576b1802200cfecef1188a6e50046a8049c64baa38454037a -> dcbe7dcaff2331fa7a22c7f970f503a73ab8a3d4d279cb457878ac77d5727349, backup=/Users/ryanmac/.openclaw/openclaw.json.bak)
No gateway token found. Auto-generated one and saving to config.
Installed LaunchAgent: /Users/ryanmac/Library/LaunchAgents/ai.openclaw.gateway.plist
Logs: /Users/ryanmac/.openclaw/logs/gateway.log
Bạn vừa chạy nhầm lệnh rồi 😅
openclaw gateway install là cài/reinstall gateway service, không phải gỡ.
Nó vừa làm mấy việc này:
- cài lại LaunchAgent
- ghi lại
~/.openclaw/openclaw.json - tạo backup ở
~/.openclaw/openclaw.json.bak - auto-generate gateway token
Nếu mục tiêu của bạn là gỡ OpenClaw, chạy:
openclaw uninstall --all --yes
npm rm -g openclaw
Nếu bạn chỉ muốn gỡ gateway service thôi:
openclaw gateway uninstall
Nói ngắn gọn:
gateway install= cài lạigateway uninstall= gỡ serviceuninstall --all= gỡ gần như toàn bộ OpenClaw
Nếu cần, mình có thể đưa cho bạn đúng 1 command cuối cùng để xóa sạch luôn.
mình remove openclaw rồi giờ mình muốn reset anything để cài lại openclaw
Được, nếu bạn muốn clean slate để cài lại từ đầu, mình sẽ làm vậy:
1. Xóa phần còn sót lại
Xóa hoặc move aside mấy path này:
~/.openclaw~/.openclaw-*(nếu trước đó có dùng profile)~/Library/LaunchAgents/ai.openclaw.gateway.plist
Nếu thích an toàn hơn, đổi tên chúng thành .old trước cũng được.
2. Cài lại OpenClaw
Mình khuyên dùng:
pnpm add -g openclaw@latest
openclaw setup
openclaw gateway install
openclaw gateway start
3. Kiểm tra
openclaw gateway status
Nếu bạn định dùng Telegram nữa, mình khuyên:
- đừng đi qua flow onboard Telegram đang lỗi
- cài xong base trước
- rồi cấu hình Telegram thủ công sau
Docs:
https://docs.openclaw.ai/install/uninstall
https://docs.openclaw.ai/start/setup
Nếu muốn, mình có thể viết luôn cho bạn checklist reinstall sạch trên macOS từng bước, ngắn gọn 1-2 phút làm xong.