Online right now
How to connect Claude Max to OpenClaw - setup guide

How to Connect Claude Max to OpenClaw (And Stop Paying Per Token)

February 18, 20267 min read

If you're running OpenClaw on an Anthropic API key right now, you're paying per token for every single request your AI agent makes, and that adds up fast when you're running automations 24/7 inside GoHighLevel.

Claude Max changes the math entirely. For a flat $100 per month, you get 5x the usage of Claude Pro with no per-token charges. This guide walks you through exactly how to switch, step by step, using the actual commands and prompts that work.

Hat tip to Andrew Warner at thenextnewthing.ai for the original prompt guide this post is based on.


What You Need Before You Start

Three things:

1. VS Code — Download it free at code.visualstudio.com. You'll use Claude Code inside VS Code to run the config prompts in Steps 2 and 4.

2. An active Claude Max subscription — Claude Max starts at $100/month. The free plan and Claude Pro will not work reliably for this. You need Max.

3. OpenClaw already installed and running — If you're starting from scratch, check the OpenClaw GitHub for installation instructions. These steps assume you have the gateway running with an Anthropic API key.


Step 0: Get VS Code

If you don't have it yet, download VS Code here and install the Claude Code extension. You'll need it for Steps 2 and 4.


Step 1: Get Your Token

Open Terminal and run:

claude setup-token

Copy the token it outputs. You'll need it in the next step.


Step 2: Nuke Your Existing Auth

Open VS Code and paste this into Claude Code exactly as written:

I need to completely remove my Anthropic API key auth and switch to Claude Max OAuth. Do these steps IN ORDER — no shortcuts:

Step 1: NUKE all existing Anthropic auth (delete, not edit):
- Delete the file ~/.openclaw/auth-profiles.json entirely (rm it)
- Remove ANY line containing ANTHROPIC_API_KEY from ~/.openclaw/.env
- If ~/.openclaw/openclaw.json has an "env" section with ANTHROPIC_API_KEY, remove that entire env section
- Show me proof each one is gone

Step 2: Verify config basics:
- Config file must be ~/.openclaw/openclaw.json (NOT config.json)
- gateway.mode must be "local"
- Show me the auth section of openclaw.json — it should be empty or missing now

Step 3: Add Claude Max OAuth clean:
- Run: openclaw models auth add
- Select: anthropic
- Select: setup-token (claude)
- When it asks for the token, I'll paste it

Step 4: Verify the new auth:
- Show me ~/.openclaw/auth-profiles.json — it should have exactly ONE anthropic profile with type "token"
- Show me the auth section of openclaw.json
- Run: openclaw models status

Do NOT restart the gateway yet. Show me the results of each step.

Follow along as Claude Code works through each step. When it asks for your token, paste the one from Step 1.


Step 3: Authenticate

Open Terminal and run:

openclaw models auth add

Select Anthropic, then setup-token (claude), and paste your token when prompted.


Step 4: Restart the Gateway and Verify

Open VS Code and paste this into Claude Code:

Now restart my OpenClaw gateway and verify the Claude Max connection works:

- Try: openclaw gateway restart
- If that doesn't work: launchctl kickstart -k gui/$(id -u)/com.openclaw.gateway
- Wait 15 seconds for the gateway to start
- Check if it's running: curl -I http://localhost:18789
- Run: openclaw models status
- Run: openclaw channels status --probe
- Check for errors: show me the last 20 lines of /tmp/openclaw/openclaw.err.log

Tell me if the gateway is running, auth is on Claude Max, and Telegram is connected.

You want to see the gateway running, Claude Max as the active auth, and your channels online.


Step 5: Make Opus 4.6 Your Default (Optional)

On Claude Max, you have access to Opus 4.6 at no extra cost. For agency work (reporting, document analysis, content generation), it's significantly more capable than Sonnet and you're already paying the flat rate.

Paste this into VS Code:

I want my OpenClaw gateway to use Claude Opus 4.6 as its default model.

Please edit ~/.openclaw/openclaw.json:

Add this under "models.providers.anthropic":
- baseUrl: "https://api.anthropic.com" (IMPORTANT: do NOT include /v1)
- api: "anthropic-messages"
- models array with an entry for claude-opus-4-6:
  - id: "claude-opus-4-6"
  - name: "Claude Opus 4.6"
  - api: "anthropic-messages"
  - reasoning: true
  - input: ["text", "image"]
  - cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 }
  - contextWindow: 200000
  - maxTokens: 128000

Also set agents.defaults.model.primary to "anthropic/claude-opus-4-6"

CRITICAL: Make sure baseUrl does NOT have /v1 at the end.

After editing, restart the gateway:
- openclaw gateway restart

Show me the models section and confirm the restart worked.

What This Unlocks for Your Agency

Switching to Claude Max isn't just a billing change. It changes how you build.

With per-token API billing, you keep prompts short, limit agent runs, and avoid expensive models. Every automation has an implicit cost attached. That constraint shapes your architecture.

With a flat subscription, that constraint disappears. You run longer context windows, use more capable models, and let your agents do more thorough work without watching the meter. For GoHighLevel agency owners building automation systems, this is a meaningful operational shift.

The agencies getting the most out of OpenClaw right now are the ones treating their AI setup like infrastructure: reliable, always-on, and not metered by the token. Claude Max is how you get there.

If you're building automated client delivery systems, AI-assisted follow-up, or high-ticket sales processes inside GHL, the High Ticket OS gives you the pre-built template system to layer on top of this setup.


FAQ

What is Claude Max and how is it different from the API?

Claude Max is Anthropic's $100/month subscription plan. Usage is measured against monthly limits rather than billed per token. The Anthropic API is a separate developer billing system where you pay per million tokens with no monthly cap. For high-volume OpenClaw use, the flat subscription is almost always cheaper once you cross a few hundred thousand tokens per month.

How much does Claude Max cost compared to the API?

Claude Max is $100/month flat. Claude Opus via the API costs $15 per million output tokens. An active agency setup generating 10 million output tokens per month costs $150 in API fees. Claude Max breaks even quickly and saves significantly at higher volumes.

Do I need Claude Max or will Claude Pro work?

You need Claude Max. Claude Pro ($20/month) hits rate limits quickly under automation load. Claude Max at $100/month provides 5x the usage of Pro and is the tier designed for heavy, continuous use.

What is claude setup-token?

It's a command from the Claude Code CLI that generates a long-lived authentication token tied to your Claude subscription. Instead of using Anthropic's metered API, this token authenticates requests through your Claude Max subscription so OpenClaw draws from your monthly allowance instead of a pay-per-token balance.

Will this work on Windows?

Yes, with WSL. The claude setup-token command requires an interactive terminal. On Windows, run it inside WSL (Windows Subsystem for Linux), not PowerShell or Command Prompt. The OpenClaw config file paths use Unix-style paths, so WSL is the recommended environment on Windows.

Do I lose any features by switching from API key to Claude Max?

Not for standard OpenClaw use. All the same Claude models are accessible. The only edge case is if you use programmatic API features that require Anthropic Console API keys (like batch processing endpoints). For chat, automation, and agent tasks, you won't notice any difference.

What model should I set as default?

anthropic/claude-opus-4-6 for most agency use cases. It's the most capable model available and on a flat subscription you're not penalized for using it. If you need faster responses for specific tasks, you can configure Sonnet for those routes separately.


Ready to automate your high-ticket coaching or consulting business with AI? Grab the High Ticket OS and have your entire system running inside GoHighLevel today.

OpenClawClaude MaxAI automationGoHighLevelClaude subscriptionOpenClaw setupAI agency toolsClaude OAuthAPI cost savings
Nathan Field helps online coaches, consultants, and course creators build, launch and scale their online businesses with optimised sales funnels & systems.

Nathan Field

Nathan Field helps online coaches, consultants, and course creators build, launch and scale their online businesses with optimised sales funnels & systems.

Back to Blog
Havstock Funnel Quiz

Not Getting the Sales You Want? This Quiz Shows You Why.

GoHighLevel Extended 30-day Free Trial + Live Setup Bootcamp

GoHighLevel Extended 30-day Free Trial + Setup Bootcamp.

GoHighLevel Extended 30-day Free Trial + Live Setup Bootcamp

Unlock Every Funnel Your Business Will Ever Need.

Newsletter

Get proven insights on building, launching, and scaling your online products from Havstock.

Havstock®

Helping businesses scale with proven funnels.

Copyright © Havstock FZ-LLC 2026