#401 Missing Authentication header

1 messages Β· Page 1 of 1 (latest)

sleek magnetBOT
#

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

shut monolithBOT
#

That specific OpenRouter error usually means the Gateway is calling OpenRouter without an API key header.

Quick fix checklist:

  1. First, confirm version:
openclaw --version
  1. Confirm auth/model state:
openclaw models status
  1. Make sure your model ref is OpenRouter-style (with provider prefix), e.g.:
#
openrouter/anthropic/claude-sonnet-4-6
  1. Make sure the key is visible to the Gateway process (not just your shell).
    If you run as a service, put it in:
~/.openclaw/.env

with:

OPENROUTER_API_KEY=sk-or-...
  1. Restart and test:
#
openclaw gateway restart
openclaw models status

If you want to reconfigure in one shot, this is the official setup command:

openclaw onboard --auth-choice apiKey --token-provider openrouter --token "$OPENROUTER_API_KEY"

Docs:

If you paste openclaw models status (redact secrets), I can pinpoint exactly what’s missing.

spiral gull
#

Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : openrouter/anthropic/claude-haiku-4.5
Fallbacks (0) : -
Image model : -
Image fallbacks (0): -
Aliases (1) : OpenRouter -> openrouter/auto
Configured models (2): openrouter/auto, openrouter/anthropic/claude-haiku-4.5

Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : off
Providers w/ OAuth/tokens (0): -

  • openrouter effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | openrouter:default=<token>

OAuth/token status

  • none