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

ComponentCost
OpenClaw GatewayFree (self-hosted)
Ollama (local models)Free (runs on your hardware)
OpenAI APIPay per token (see openai.com/pricing)
Anthropic APIPay per token (see anthropic.com/pricing)
Google AI APIFree tier + pay per token
Moonshot APIPay per token (see platform.moonshot.cn)

Token Usage

AI models charge based on tokens (roughly 4 characters = 1 token):

ModelInput 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)FreeFree

Prices are approximate and subject to change. Check provider websites for current pricing.

Cost Optimization Tips

  1. Use local models — Ollama runs models on your hardware for free
  2. Choose smaller models — GPT-4o-mini and Claude Haiku are much cheaper
  3. Set token limits — Configure maxTokens to cap response length
  4. Use session expiry — Shorter sessions reduce context token costs

Configuration

Set token limits per agent:

{
  "agents": {
    "default": {
      "maxTokens": 2048,
      "maxContextTokens": 8192
    }
  }
}

Next Steps