Pricing
Understand OpenClaw token usage, AI model costs, and how to optimize spending.
Overview
OpenClaw itself is free and open source (MIT license). However, using cloud AI models incurs costs from their respective providers.
Cost Structure
| Component | Cost |
|---|---|
| OpenClaw Gateway | Free (self-hosted) |
| Ollama (local models) | Free (runs on your hardware) |
| OpenAI API | Pay per token (see openai.com/pricing) |
| Anthropic API | Pay per token (see anthropic.com/pricing) |
| Google AI API | Free tier + pay per token |
| Moonshot API | Pay per token (see platform.moonshot.cn) |
Token Usage
AI models charge based on tokens (roughly 4 characters = 1 token):
| Model | Input Price (per 1M tokens) | Output Price (per 1M tokens) |
|---|---|---|
| GPT-4o | $2.50 | $10.00 |
| GPT-4o-mini | $0.15 | $0.60 |
| Claude Sonnet 4 | $3.00 | $15.00 |
| Claude Haiku | $0.25 | $1.25 |
| Gemini 2.5 Flash | $0.15 | $0.60 |
| Ollama (local) | Free | Free |
Prices are approximate and subject to change. Check provider websites for current pricing.
Cost Optimization Tips
- Use local models — Ollama runs models on your hardware for free
- Choose smaller models — GPT-4o-mini and Claude Haiku are much cheaper
- Set token limits — Configure
maxTokensto cap response length - Use session expiry — Shorter sessions reduce context token costs
Configuration
Set token limits per agent:
{
"agents": {
"default": {
"maxTokens": 2048,
"maxContextTokens": 8192
}
}
}Next Steps
- AI Model Integrations — Compare providers
- Ollama Integration — Free local models
- Security — Security best practices