How to Connect Claude AI to Your OpenClaw Instance
Product: OpenClaw VM and OpenClaw Basic VM
Category: Getting Started
Difficulty: Intermediate
What is This?
Your OpenClaw Product 2 instance is a CLI-based AI agent that needs to connect to an AI model to work. This guide walks you through connecting it to Claude, one of the most powerful AI models available, made by Anthropic.
Once connected, your OpenClaw assistant will be able to:
- Answer questions instantly
- Draft emails and documents
- Help with research and analysis
- Automate tasks and workflows
What You Will Need
- Your OpenClaw VM IP address and root password (sent in your welcome email)
- An SSH client (Terminal on Mac/Linux, PuTTY or Windows Terminal on Windows)
- A credit card to create your Anthropic account
- About 10 minutes
Part 1 — Get Your Claude API Key
Step 1 — Create Your Anthropic Account
- Open your browser and go to https://console.anthropic.com
- Click Sign Up
- Enter your email address and create a password
- Check your email and click the verification link
- You will land on the Anthropic Console dashboard
Step 2 — Add Credits
Claude API is pay-as-you-go. $5 is enough for thousands of messages.
- On the dashboard click "Add funds"
- Select $5 to start
- Enter your billing address and card details
- Click "Buy credits"
???? Tip: At typical usage, $5 worth of credits lasts several months for a single user.
Step 3 — Create Your API Key
- Click "Get API key" (top right of dashboard)
- Click "Create Key"
- Give it a name — for example:
my-openclaw - Click Create
- Copy the key — it looks like:
sk-ant-api03-xxxxxxxxxxxx
⚠️ Important: Save your API key somewhere safe (password manager). You will not be able to see it again after closing this window.
Part 2 — Connect Claude to Your OpenClaw Instance
Step 4 — SSH Into Your VM
Open your terminal and connect to your OpenClaw VM:
ssh root@[your-vm-ip]
Enter your root password when prompted.
(Both IP and password were sent in your welcome email)
Step 5 — Navigate to OpenClaw Directory
cd /opt/openclaw
Step 6 — Apply Your API Key
Copy the command below, replace YOUR_KEY_HERE with your actual API key, then run it:
docker compose run --rm --no-deps --entrypoint node openclaw-gateway \
dist/index.js config patch --stdin << 'EOF'
{
"models": {
"providers": {
"anthropic": {
"apiKey": "YOUR_KEY_HERE",
"baseUrl": "https://api.anthropic.com",
"models": [
{
"id": "claude-haiku-4-5-20251001",
"name": "Claude Haiku",
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "anthropic/claude-haiku-4-5-20251001"
}
}
}
}
EOF
Step 7 — Set Gateway Mode
docker compose run --rm --no-deps --entrypoint node openclaw-gateway \
dist/index.js config set gateway.mode local
Step 8 — Restart OpenClaw
docker compose restart openclaw-gateway
Wait a few seconds, then verify it started correctly:
docker compose logs --tail=20 openclaw-gateway
You should see at the end:
[gateway] ready
[heartbeat] started
Part 3 — Test Your Setup
Step 9 — Launch the OpenClaw CLI
docker compose exec openclaw-gateway node dist/index.js chat
You should see:
local ready | idle
agent main | session main | anthropic/claude-haiku-4-5-20251001 | tokens ?/200k
Step 10 — Send a Test Message
Type the following and press Enter:
What is the capital of France?
You should get an instant response: The capital of France is Paris.
If it works — you are all set! ????
To exit the CLI press Ctrl+C
Choosing the Right Claude Model
| Model | Speed | Quality | Best for |
|---|---|---|---|
| Claude Haiku | ⚡ Fastest | ⭐⭐⭐⭐ | Everyday tasks, quick answers |
| Claude Sonnet | ⚡ Fast | ⭐⭐⭐⭐⭐ | Complex tasks, long documents |
We recommend starting with Claude Haiku — it handles most tasks perfectly and costs less.
To switch to Sonnet, replace claude-haiku-4-5-20251001 with claude-sonnet-4-5-20251001 in Step 6.
How Much Will It Cost?
| Usage | Estimated monthly cost |
|---|---|
| Light use (few messages/day) | ~$1–2/month |
| Regular use (20–30 messages/day) | ~$3–5/month |
| Heavy use (100+ messages/day) | ~$10–20/month |
Monitor your usage at console.anthropic.com at any time.
Frequently Asked Questions
Can I use a different AI provider?
Yes — OpenClaw also supports OpenAI (ChatGPT) and local AI models. Contact our support team for help.
Is my data private?
Your conversations are processed by Anthropic's servers. For fully private AI that never leaves your infrastructure, ask us about our Local LLM add-on.
What if I run out of credits?
Your OpenClaw will stop responding until you add more credits at console.anthropic.com. We recommend enabling auto-reload in your Anthropic billing settings.
I lost my API key — what do I do?
Go to console.anthropic.com → API Keys → delete the old key → create a new one → repeat Steps 6 and 7.
Something is not working — who do I contact?
Open a support ticket at cloudacropolis.lt and our team will help you.
Need Help?
???? support@cloudacropolis.lt
???? https://cloudacropolis.lt
CloudAcropolis — European Cloud Infrastructure, Lithuania
