OpenRouter

"openrouter api 401 user not found"

OpenRouter returns 401 'User not found' when the request arrives with the wrong key. In tools like Hermes this is usually key drift, a stale key from a previous provider, not a revoked key. Remove stale keys from ~/.hermes/.env, confirm your config points to OpenRouter with the matching key, and verify it with curl before regenerating.

Likely cause

OpenRouter returns 401 'User not found' when the request arrives with the wrong key. In tools like Hermes this is usually key drift - a stale key from a previous provider - rather than a revoked key.

The fix

  1. 1 Check ~/.hermes/.env (or your tool's key store) and remove stale keys from other providers.
  2. 2 Confirm the active config points to OpenRouter with the matching key.
  3. 3 Verify the key directly with curl; regenerate it in the OpenRouter dashboard only if curl also fails, then retry.
curl -H "Authorization: Bearer $OPENROUTER_API_KEY" https://openrouter.ai/api/v1/models
Full guideHermes 401 "User Not Found": Auth Fixes

Hit a different error?

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

Open the decoder

Frequently asked questions

My OpenRouter key works in curl but Hermes returns 401. Why?

This is the documented key-drift case (issue #14637). Hermes is sending a stale key from a previous provider config, not your OpenRouter key. Clear old keys from ~/.hermes/.env and confirm the active provider matches.

Should I regenerate my OpenRouter key?

Only if curl with that key also fails. If curl succeeds, the key is valid and the problem is in how your tool resolves credentials, not the key itself.

How do I confirm config and key match?

Check that the provider in your config is OpenRouter and that the OPENROUTER_API_KEY in your key store is the one being sent. A mismatch between provider, model format, and key is the usual cause of 401.

Stop firefighting agent errors

Decoding errors one at a time is the manual version of what BetterClaw automates. Run your OpenClaw agents hosted with managed models, retries and config validation built in.

$19/month per agent · BYOK · 7-day money-back guarantee