The Technical Stack: How OpenClaw Actually Works
Core Architecture
OpenClaw operates as a local-first gateway — a single control plane that manages sessions, channels, tools, and events. Built on Node.js 22, it runs on macOS, Linux, and Windows (via WSL2).
The platform has four integrated subsystems:
Gateway WS Control Plane — Manages sessions, presence, configuration, cron jobs, webhooks, and hosts both Control UI and Canvas.
Pi Agent Runtime — Operates in RPC mode with tool streaming and block streaming capabilities. This is where agent reasoning happens.
Session Model — Handles direct chats, group isolation, activation modes, queue modes, and reply-back. Each session is isolated with its own context window.
Media Pipeline — Processes images, audio, and video with transcription hooks, size caps, and automated temp file lifecycle management.
Model Routing
OpenClaw supports multi-provider model access with built-in failover:
| Provider | Model | Input/1M tokens | Output/1M tokens | Best For |
|---|---|---|---|---|
| Anthropic | Claude Opus 4.6 | $5.00 | $25.00 | Highest quality |
| Anthropic | Claude Sonnet 4.5 | $3.00 | $15.00 | Production default |
| Anthropic | Claude Haiku 4.5 | $1.00 | $5.00 | High-volume, fast |
| OpenAI | GPT-4o | $2.50 | $10.00 | Alternative provider |
| Local | Ollama + Llama 3.3 8B | $0 | $0 | Zero-cost, private |
The recommended configuration for most users is Claude Sonnet 4.5 — $15-25/month for moderate usage. Using Haiku cuts costs 60-70%. Opus doubles them.
Subscription economics matter: if monthly API costs exceed $20, a Claude Pro subscription is better value. At $100+/month, Max 5x delivers significant savings. At extreme usage, Max 20x at $200/month provides 5-10x cost reduction over equivalent API spending.
Multi-Channel Inbox
This is where OpenClaw's architecture becomes relevant to agent infrastructure design. The platform exposes a unified capability surface across:
Primary: WhatsApp, Telegram, Discord, Slack, Signal, Google Chat, Microsoft Teams, iMessage
Extended: Matrix, Zalo, WebChat
Services: GPT, Spotify, Philips Hue, Obsidian, Twitter, Browser automation, Gmail, GitHub, and 50+ integrations
Each channel is a typed wrapper in Anything.network terms — a versioned capability unit with defined input/output contracts. The agent runtime discovers available channels and composes routes across them.
Security-by-Default
OpenClaw implements DM pairing by default — unknown senders must complete a pairing process before the assistant processes their messages. Public inbound DMs require explicit opt-in. The openclaw doctor command surfaces risky configurations.
This is the correct security model for autonomous agents: deny by default, explicit allow. It maps directly to the governed network concept in Anything.network's capability model.
The $0 Stack
For zero-cost deployment:
- Software: OpenClaw (MIT, $0)
- Hosting: Oracle Cloud Free Tier (1 GB RAM VM, $0)
- AI Model: Ollama + Llama 3.3 8B ($0)
- Channel: Telegram bot ($0)
Trade-off: slower responses (3-8 seconds vs <1 second with cloud APIs) and lower quality. But functional for personal assistants, testing, and budget-constrained deployments.
What To Do Next
Read Part 3: From SDR Tool to Capability Surface for how OpenClaw's patterns map to the Anything.network abstraction layer.