Skip to content

How to Set Up Openclaw With Budget Cloud LLMs: A Step-by-Step Guide (2026)

I wanted to use Openclaw for coding assistance, but I quickly ran into a wall: my machine couldn’t handle running local LLMs, and my Claude subscription tokens were gone in two days. I needed a budget-friendly cloud setup that actually worked.

The Problem

Here’s what happened when I tried to use Openclaw with just a Claude subscription:

Weekly token usage
Day 1: Heavy coding session - 40% weekly tokens used
Day 2: Another productive day - 60% tokens used
Day 3: Error - Weekly limit reached
Result: Stuck for 5 more days with no coding assistance

I couldn’t run local models (no GPU, limited RAM), and the subscription model was burning through tokens faster than expected. I needed an alternative.

The Solution: Multi-Provider Cloud Setup

After researching and experimenting, I found that combining multiple budget cloud providers gives you reliable access at a fraction of the cost. Here’s my current setup:

Provider cost comparison (monthly)
┌─────────────────┬───────────────┬────────────────┐
│ Provider │ Cost │ Best For │
├─────────────────┼───────────────┼────────────────┤
│ MiniMax M2.7 │ $10/1500 calls│ Supervision │
│ Kimi K2.5 │ Pay-per-use │ Complex coding │
│ Gemini Flash │ Free tier │ Simple queries │
│ Claude Haiku │ Pay-per-use │ Reasoning │
│ Grok 4.1 Fast │ Pay-per-use │ Heartbeats │
└─────────────────┴───────────────┴────────────────┘

The key insight: route different tasks to appropriate models instead of using one expensive model for everything.

Step 1: Get API Keys from Each Provider

Let me walk through obtaining credentials for the main providers.

MiniMax (Best Value for Supervision)

MiniMax registration steps
1. Visit platform.minimaxi.com
2. Create developer account
3. Navigate to API Keys section
4. Generate new API key
5. Note your Group ID (required for API calls)

MiniMax M2.7 offers excellent value - about $10/month for 1500 calls with no weekly cap. This makes it ideal for Openclaw’s supervision tasks.

Kimi K2.5 (Balanced Quality)

Kimi/Moonshot registration
1. Go to platform.moonshot.cn
2. Sign up for developer access
3. Create new project
4. Generate API key from dashboard
5. Check rate limits (varies by tier)

Kimi K2.5 handles complex coding well and is specifically good at optimizing Openclaw’s own configuration.

Google AI Studio (Gemini Flash)

Gemini setup
1. Open aistudio.google.com
2. Create new project
3. Enable Gemini API
4. Create credentials (API key)
5. Copy key for configuration

Gemini Flash has a generous free tier perfect for simple queries and heartbeat operations.

Step 2: Configure Openclaw

Openclaw’s configuration typically lives in ~/.openclaw/config.yaml or ~/.config/openclaw/settings.yaml. Here’s my working configuration:

~/.openclaw/config.yaml
providers:
minimax:
api_key: "${MINIMAX_API_KEY}"
group_id: "${MINIMAX_GROUP_ID}"
base_url: "https://api.minimax.chat/v1"
models:
- name: "abab6.5s-chat"
alias: "minimax-m2.7"
kimi:
api_key: "${KIMI_API_KEY}"
base_url: "https://api.moonshot.cn/v1"
models:
- name: "moonshot-v1-128k"
alias: "kimi-k2.5"
gemini:
api_key: "${GEMINI_API_KEY}"
base_url: "https://generativelanguage.googleapis.com/v1beta"
models:
- name: "gemini-2.0-flash"
alias: "gemini-flash"
routing:
default: "kimi-k2.5"
heartbeat: "gemini-flash"
supervision: "minimax-m2.7"
simple_query: "gemini-flash"
complex_coding: "kimi-k2.5"

Important: Never hardcode API keys directly. Use environment variables instead.

Set environment variables in ~/.zshrc or ~/.bashrc
export MINIMAX_API_KEY="your-key-here"
export MINIMAX_GROUP_ID="your-group-id"
export KIMI_API_KEY="your-key-here"
export GEMINI_API_KEY="your-key-here"

Step 3: Set Up Model Routing

This is where the real cost savings happen. Instead of using one model for everything, route requests based on complexity:

Task routing strategy
┌──────────────────┐ ┌─────────────────┐
│ Simple Query │────▶│ Gemini Flash │ (Free/Fast)
│ (quick lookup) │ │ 0.001/call │
└──────────────────┘ └─────────────────┘
┌──────────────────┐ ┌─────────────────┐
│ Heartbeat Check │────▶│ Gemini Flash │ (Free)
│ (health monitor) │ │ or Grok 4.1 │
└──────────────────┘ └─────────────────┘
┌──────────────────┐ ┌─────────────────┐
│ Complex Coding │────▶│ Kimi K2.5 │ (Quality)
│ (debug, refactor)│ │ ~0.002/1k tokens│
└──────────────────┘ └─────────────────┘
┌──────────────────┐ ┌─────────────────┐
│ Supervision │────▶│ MiniMax M2.7 │ ($10/1500 calls)
│ (code review) │ │ No weekly cap │
└──────────────────┘ └─────────────────┘

Here’s how I configured the routing rules:

routing-rules.yaml
routing_rules:
- trigger: "heartbeat"
model: "gemini-flash"
reason: "Fast, free, low stakes"
- trigger: "simple_question"
model: "gemini-flash"
reason: "Quick answers don't need heavy models"
- trigger: "code_generation"
model: "kimi-k2.5"
reason: "Quality matters for generated code"
- trigger: "code_review"
model: "minimax-m2.7"
reason: "Good enough for review, cost effective"
- trigger: "debugging"
model: "kimi-k2.5"
reason: "Complex reasoning required"
- trigger: "refactoring"
model: "kimi-k2.5"
reason: "Needs understanding of codebase"

Step 4: Test Your Configuration

Before relying on this setup, verify each provider works:

test-providers.sh
#!/bin/bash
# Test MiniMax
echo "Testing MiniMax..."
curl -X POST "https://api.minimax.chat/v1/text/chatcompletion_v2" \
-H "Authorization: Bearer $MINIMAX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "abab6.5s-chat", "messages": [{"role": "user", "content": "Hello"}]}'
# Test Kimi
echo "Testing Kimi..."
curl -X POST "https://api.moonshot.cn/v1/chat/completions" \
-H "Authorization: Bearer $KIMI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "moonshot-v1-8k", "messages": [{"role": "user", "content": "Hello"}]}'
# Test Gemini
echo "Testing Gemini..."
curl -X POST "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contents": [{"parts": [{"text": "Hello"}]}]}'

Common Mistakes I Made

Mistake 1: Single Provider Without Fallback

My first attempt used only Kimi. When they had an outage, I was completely stuck.

What happened
Kimi API: 503 Service Unavailable
My setup: No fallback configured
Result: 4 hours of lost productivity

Fix: Always configure at least 2-3 providers.

Mistake 2: Expensive Model for Heartbeats

I initially used Kimi K2.5 for everything, including health checks that happen every 30 seconds.

Cost comparison for 1000 heartbeats
Kimi K2.5: ~$2.00 for heartbeats only
Gemini Flash: $0.00 (free tier covers it)
Savings: 100%

Mistake 3: Ignoring Rate Limits

Each provider has different rate limits:

Provider rate limits
┌─────────────────┬────────────────┬─────────────────┐
│ Provider │ Requests/Min │ Tokens/Day │
├─────────────────┼────────────────┼─────────────────┤
│ MiniMax │ 60 │ 1,000,000 │
│ Kimi │ 30 │ Varies by tier │
│ Gemini Free │ 15 │ 32,000 │
│ Gemini Paid │ 2000 │ 4,000,000 │
└─────────────────┴────────────────┴─────────────────┘

Read the documentation before hitting these limits.

Mistake 4: No Usage Alerts

I burned through my budget because I didn’t set up monitoring.

Add usage monitoring
# Create a simple usage tracker
cat << 'EOF' > ~/.openclaw/usage_monitor.sh
#!/bin/bash
# Log all API calls with timestamps
# Run this via cron every hour
# 0 * * * * ~/.openclaw/usage_monitor.sh
USAGE_FILE="$HOME/.openclaw/daily_usage.log"
DATE=$(date +%Y-%m-%d)
# Check if log exists for today
if [ ! -f "$USAGE_FILE" ]; then
echo "Date,Provider,Model,Tokens,Cost" > "$USAGE_FILE"
fi
# Alert if approaching budget (example: $20/day)
DAILY_SPEND=$(tail -n +2 "$USAGE_FILE" | awk -F',' '{sum+=$5} END {print sum}')
if (( $(echo "$DAILY_SPEND > 15" | bc -l) )); then
echo "WARNING: Daily spend at \$$DAILY_SPEND"
fi
EOF
chmod +x ~/.openclaw/usage_monitor.sh

Cost Savings Breakdown

After implementing this multi-provider setup, my monthly costs dropped significantly:

Monthly cost comparison
┌─────────────────────────┬──────────────┬──────────────┐
│ Approach │ Before │ After │
├─────────────────────────┼──────────────┼──────────────┤
│ Claude subscription │ $20/month │ $0 (dropped) │
│ Simple queries │ $8/month │ $0 (Gemini) │
│ Heartbeats │ $5/month │ $0 (Gemini) │
│ Complex coding │ Included │ $6/month │
│ Supervision │ Included │ $10/month │
├─────────────────────────┼──────────────┼──────────────┤
│ TOTAL │ $20/month │ $16/month │
│ Unused tokens │ 5 days/week │ Unlimited │
│ Availability │ 2 days/week │ 99.9% │
└─────────────────────────┴──────────────┴──────────────┘

The real value isn’t just the 20% cost savings - it’s having reliable access without weekly token limits.

Summary

Setting up Openclaw with budget cloud LLMs requires upfront configuration but pays off in reliability and cost savings. The key principles:

  1. Never rely on a single provider - Always have backups
  2. Route by task complexity - Cheap models for simple tasks
  3. Monitor your usage - Set alerts before hitting limits
  4. Test before you need it - Verify configuration works

The combination of MiniMax M2.7 for supervision, Kimi K2.5 for complex coding, and Gemini Flash for simple queries gives you a robust setup that won’t break the bank.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments