# OpenClaw Subscription Setup — March 29, 2026

## What Happened
Switched from Anthropic API key billing to Claude Max subscription ($200/month).
Bot broke with "Unknown model: openai/claude-opus-4" — old model string didn't match new setup.

## The Fix (Step by Step)

### 1. Fix the model string
Config file: `~/.openclaw/openclaw.json`
```bash
sed -i '' 's|openai/claude-opus-4|anthropic/claude-opus-4-6|g' ~/.openclaw/openclaw.json
```

### 2. If you need to re-onboard from scratch
```bash
openclaw onboard --install-daemon
```
Settings used:
- Setup mode: **Manual**
- Gateway: **Local**
- Provider: **Anthropic**
- Auth method: **Anthropic token** (paste setup-token)
- Generate setup token: `claude setup-token` (in separate terminal)
- Default model: **anthropic/claude-opus-4-6**
- Gateway port: **18789**
- Gateway bind: **Loopback (127.0.0.1)**
- Gateway auth: **Token**
- Tailscale exposure: **Funnel**
- Reset Tailscale on exit: **No**
- Telegram bot token from **@BotFather**
- DM access policy: **pairing** (default)
- Search provider: **Brave Search**
- Skills: skipped
- Hooks: skipped
- Gateway runtime: **Node**

### 3. Fix authentication (if token is short-lived)
Generate a long-lived token:
```bash
claude setup-token
```
Replace in auth-profiles:
```bash
sed -i '' 's|OLD_TOKEN|NEW_LONG_LIVED_TOKEN|' ~/.openclaw/agents/main/agent/auth-profiles.json
```

### 4. Start gateway + re-pair Telegram
```bash
openclaw gateway start
# Bot sends pairing code, then:
openclaw pairing approve telegram <CODE>
```

## Key File Locations
| What | Where |
|------|-------|
| Anthropic auth token | `~/.openclaw/agents/main/agent/auth-profiles.json` |
| Model config | `~/.openclaw/openclaw.json` |
| Main config | `~/.openclaw/openclaw.json` |

## Important Notes
- Long-lived OAuth token is **valid for 1 year**
- To switch between API key and subscription: update provider mode + token/key in those files
- **API key is kept as backup** in case subscription has issues — don't delete it
- ⚠️ During `openclaw reset`, choose **"Config only"** — NOT "Config + credentials + sessions" (that wipes everything)

## Billing
- **Subscription plan:** $200/month (Claude Max)
- **Invoice should arrive at:** rob.lobster.claw@gmail.com (Rob's email)
- **TODO:** Compare monthly API key spend vs $200 flat to confirm savings
- **API key remains active as backup** — just don't want to bounce back and forth without knowing costs
