Hermes

Hermes "Provider authentication failed. Check the configured credentials; raw provider details are in the gateway logs."

Last checked

The error

⚠️ Provider authentication failed. Check the configured credentials; raw provider details are in the gateway logs.

Chat reply from the Hermes gateway (Telegram, Discord, Slack and other bots) on v0.21.3 and earlier. From v0.21.4 the same failure reads: "⚠️ Sign-in to the AI model service failed. Use /login to sign in again, or ask whoever runs this bot to run hermes doctor on the host." API-backed chat UIs show "⚠️ Provider authentication failed: <reason>", for example "No credentials found for provider 'nous'".

Hermes asked your model provider for a reply and the provider refused the credentials, so the gateway hid the raw error and wrote it to the gateway log instead. Usually the key for the active provider in ~/.hermes/.env is missing, wrong, or stale, or an OAuth login (Codex, Nous Portal) has expired. Read the last auth line in gateway.log, fix that one credential, then restart the gateway with hermes gateway restart.

Why it happens

The gateway matches the provider's error against an auth pattern (401, invalid API key, "provider authentication failed") and replaces it with this fixed chat message. The real reason is only in the log.

  1. The key for the active provider is missing, wrong, or left over from a previous provider in ~/.hermes/.env, or the provider named in config.yaml does not match the key you set.
  2. An OAuth subscription login has expired. Codex logins that went stale used to stay broken until you re-authenticated (issue #6651, closed); Hermes now keeps Codex auth in its own auth.json, so a fresh login through hermes auth add openai-codex clears it.
  3. On v0.21.3 and earlier a quota 429 could be labelled as an auth failure because the auth pattern was checked first (issue #89401). Fixed in v0.21.4 by PR #115799: quota errors now say they are quota errors and give the reset time.
  4. The primary provider was unreachable while Hermes refreshed its credentials, and that network failure surfaced as this auth message without consulting fallback_providers (issue #120608, still open).
  5. The key is exported in your shell profile but the gateway runs as a background service and never sees it. Hermes reads ~/.hermes/.env, and that file wins over stale shell exports.

The fix

  1. 1 Find the real error. Run hermes logs gateway --level WARNING --since 1h, or grep -iE '401|403|429|quota|credential|auth' ~/.hermes/logs/gateway.log.
  2. 2 If the log shows 401, 403 or an invalid key: open ~/.hermes/.env, correct the key for the provider set in config.yaml, and delete leftover keys from providers you no longer use.
  3. 3 If the log names an OAuth provider (openai-codex, nous, xai-oauth): log in again with hermes auth add <provider>, then check hermes auth list.
  4. 4 If the log shows 429 or quota on v0.21.3 or earlier, your key is fine. Wait for the quota window and run hermes update to get the v0.21.4 fix.
  5. 5 Restart the gateway so it rereads .env: hermes gateway restart. Hermes does not hot-reload credentials.
  6. 6 Run hermes doctor to confirm the provider check passes.
hermes logs gateway --level WARNING --since 1h

Where the gateway log lives

Linux, macOS and WSL2: ~/.hermes/logs/gateway.log. On macOS, when the gateway runs under launchd, stderr goes to gateway.error.log in the same folder.

Native Windows: %LOCALAPPDATA%\hermes\logs\gateway.log. Read it with type or Get-Content -Tail 50.

Docker: the official image uses /opt/data as the Hermes home, so the log is /opt/data/logs/gateway.log inside the container, or under your mounted data volume.

If you set HERMES_HOME, the log is in $HERMES_HOME/logs. hermes logs list prints every log file with its size.

Still failing?

  • Test the key outside Hermes with a direct curl to the provider; if that also fails, the key or account is the problem, not Hermes.
  • Check for a named profile: each profile has its own .env, so the key you edited may belong to a different profile than the gateway is running.
  • If the log shows a timeout or connection refused right before the auth line, treat it as an unreachable provider (issue #120608) and check the provider's status page.

Related errors

Full guideHermes Agent Auth Handler Error Authenticating: 5 Real Causes and Step-by-Step FixesEvery error, one pageHermes Agent Not Working? Couldn't Start, Backend Exited and Every Other Fix (v0.21.5)

Hit a different error?

Paste any agent error and get the cause and fix in seconds.

Open the decoder

Frequently asked questions

Will fallback_providers catch an auth failure?

Usually yes. The old bug where an AuthError at credential resolution skipped the fallback model (issue #7230) is closed, and the docs now list 401 and 403 as triggers that switch to a fallback immediately. The open gap is issue #120608: if the primary is unreachable during credential refresh, the fallback chain is skipped.

hermes doctor says my Gemini key is invalid but chat works. Is that this error?

No. Older doctor builds probed Gemini with an OpenAI-style Bearer header and got a 401 for a valid key (issues #21481, #23354, #26623). That was a doctor false positive, fixed from build v2026.5.28. Update and re-run doctor.

Why does my chat message look different from this one?

v0.21.4 rewrote the gateway's canned replies. The same auth failure now says "Sign-in to the AI model service failed" and points you at /login and hermes doctor. The cause and the fix are the same.

Stop firefighting agent errors

Decoding errors one at a time is the manual version of what BetterClaw automates. Run your agents on a no-code AI agent platform with managed models, retries and config validation built in.

Free plan available · Pro $49/mo · BYOK · 7-day money-back guarantee