#404 No active credentials for provider: openai-compatible-chat-75df4ece-9661-49c5-93dd-a78807a78e64

1 messages · Page 1 of 1 (latest)

low violetBOT
zinc troutBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

low violetBOT
sage pine
#

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

marble oarBOT
#

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 of openai/...
  • You are using a custom proxy/provider, but models.providers.<provider-id>.apiKey is missing
  • You used env/ref mode, but the gateway cannot resolve that env var
#

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 baseUrl không phải http://127.0.0.1:... hoặc http://localhost:... trên chính máy gateway
sage pine
#

🦞 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

marble oarBOT
#

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.

sage pine
#

TypeError: Cannot read properties of undefined (reading 'trim')

marble oarBOT
#

À, 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é:

  1. Trong thread này gửi:
/new
  1. 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.

  2. 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.

sage pine
#

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

marble oarBOT
#

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 ... unreachable
  • Gateway 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 target
  • Listening
  • Last 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:

#

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.mode nê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.

sage pine
#

🦞 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

marble oarBOT
#

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:

sage pine
#

🦞 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

marble oarBOT
#

Nice, vậy là gateway đã khỏe lại rồi 🎉

Dòng quan trọng là:

  • RPC probe: ok
  • Listening: 127.0.0.1:18789

Giờ làm tiếp 2 bước:

  1. Trong thread này gửi:
/new

hoặc mở thread/chat mới

  1. 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.

sage pine
#

vẫn bị TypeError: Cannot read properties of undefined (reading 'trim') khi openclaw onboard --install-daemon telegram setup

marble oarBOT
#

À, 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à:

  1. lấy bot token từ BotFather
  2. cấu hình token vào config hoặc ~/.openclaw/.env
  3. restart gateway
  4. 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 setup nữa
  • Dùng openclaw setup hoặc openclaw 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:

#

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.

sage pine
#

remove openclaw

marble oarBOT
#

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 --all gỡ service + state + workspace + app
  • nhưng CLI vẫn còn, nên cần npm rm -g openclaw nữ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:

sage pine
#

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

marble oarBOT
#

Bạn vừa chạy nhầm lệnh rồi 😅

openclaw gateway installcà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ại
  • gateway uninstall = gỡ service
  • uninstall --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.

sage pine
#

mình remove openclaw rồi giờ mình muốn reset anything để cài lại openclaw

marble oarBOT
#

Đượ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: