On any machine where you're logged into Claude Max:
claude setup-tokenCopy the sk-ant-oat01-... token it gives you.
Add it to the gateway's systemd unit:
mkdir -p ~/.config/systemd/user/openclaw-gateway.service.d/
cat > ~/.config/systemd/user/openclaw-gateway.service.d/anthropic.conf << 'EOF'
[Service]
Environment=ANTHROPIC_OAUTH_TOKEN=sk-ant-oat01-YOUR_TOKEN_HERE
EOFsystemctl --user daemon-reload
systemctl --user restart openclaw-gateway.serviceThat's it. All agents on the gateway will use this token.
If multiple agents each cache their own copy of the token (in auth-profiles.json), Anthropic's token rotation can cause one agent's refresh to invalidate everyone else's copy. A single shared env var avoids this entirely.
If you have an Anthropic API account (separate billing from Max):
Environment=ANTHROPIC_API_KEY=sk-ant-api03-YOUR_KEY_HEREAPI keys don't rotate, but they bill per-token instead of using your Max subscription.