Skip to main content
Connecting OpenClaw to BetterToken requires manually editing the config file to add BetterToken as a custom Anthropic-compatible provider.

Prerequisites

Install OpenClaw

curl -fsSL https://openclaw.bot/install.sh | bash

Setup

1

Clear conflicting environment variables

unset ANTHROPIC_AUTH_TOKEN
unset ANTHROPIC_BASE_URL
2

Edit the OpenClaw config file

Open ~/.openclaw/openclaw.json and add BetterToken as a custom provider:
{
  "model": {
    "provider": "anthropic",
    "baseURL": "https://www.bettertoken.com/v1",
    "apiKey": "YOUR_API_KEY",
    "model": "claude-sonnet-4-5"
  }
}
Replace YOUR_API_KEY with your BetterToken API Key.
If the config file already has other entries, only update the model field — do not remove other settings.
3

Restart the OpenClaw gateway

openclaw gateway start
4

Verify

Launch the OpenClaw TUI and send a message to confirm everything is working:
openclaw tui

Switch models

BetterToken supports the full Claude model lineup. Edit the model field in the config to switch:
ModelUse case
claude-sonnet-4-5Balanced — recommended
claude-opus-4-5Most capable — complex tasks
claude-haiku-4-5Fastest — lightweight tasks
After changing the model, re-run openclaw gateway start to apply.