# OpenClaw with OfoxAI Setup Guide Source: https://ofox.ai/docs/integrations/openclaw [OpenClaw](https://openclaw.ai) is an open-source local AI assistant that interacts with you through WhatsApp, Telegram, Slack, and other messaging apps. It can perform real actions — managing emails, calendars, flight check-ins, browsing the web, and more. It runs entirely locally, so your data never leaves your device. > **Set up faster with Ofox Desktop.** On an Apple silicon Mac, Desktop can detect this tool, back up its current configuration, and apply an Ofox API key and compatible model. [Open Ofox Desktop](https://ofox.ai/desktop). ## Why Pair with OfoxAI? - **100+ models unified access** — One API Key for Claude, GPT, Gemini, Qwen, Doubao, and all major models - **Flexible agent strategies** — Assign different models to different agents: Sonnet for primary, Opus for reasoning, Haiku for lightweight tasks - **99.9% SLA** — Multi-node redundancy with automatic failover - **Cost control** — Unified billing dashboard with real-time token consumption monitoring As an agentic AI assistant, OpenClaw's per-task token consumption is relatively high (typically 10K-100K+ tokens). We recommend choosing models based on task complexity to avoid unnecessary costs. This guide provides three configuration options for reference. ## Installation ```bash filename="macOS / Linux" curl -sSL https://openclaw.ai/install.sh | bash ``` ```powershell filename="Windows (PowerShell)" & ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) ``` ## Quick Start ### 1. Get an API Key Go to the [OfoxAI Console](https://app.ofox.ai) to create an API Key. ### 2. Run the Setup Wizard OpenClaw provides an interactive wizard. Run the following command to get started: ```bash openclaw onboard ``` In the wizard, select **Custom Provider** and enter the following: | Setting | Value | |---------|-------| | **Provider Type** | `anthropic-messages` | | **Base URL** | `https://api.ofox.ai/anthropic` | | **API Key** | Your OfoxAI API Key | | **Model** | `anthropic/claude-sonnet-5.5` | ### 3. Start and Verify ```bash openclaw start ``` Send a message to OpenClaw to test connectivity. If you receive a normal response, the setup is complete. The wizard automatically generates an `openclaw.json` configuration file. For more fine-grained control, see the full configuration below. ## Full Configuration OpenClaw manages all configuration through `~/.openclaw/openclaw.json` (supports JSON5 format with comments). ### Provider Configuration Providers are defined under `models.providers`. Each provider needs an API protocol type, URL, and key: ```json filename="~/.openclaw/openclaw.json" { "models": { "providers": { "ofoxai-anthropic": { "baseUrl": "https://api.ofox.ai/anthropic", "apiKey": "${OFOXAI_API_KEY}", "api": "anthropic-messages", "models": [] }, "ofoxai-openai": { "baseUrl": "https://api.ofox.ai/v1", "apiKey": "${OFOXAI_API_KEY}", "api": "openai-responses", "models": [] }, "ofoxai-gemini": { "baseUrl": "https://api.ofox.ai/gemini", "apiKey": "${OFOXAI_API_KEY}", "api": "google-generative-ai", "models": [] } } } } ``` `apiKey` supports `${ENV_VAR}` syntax to reference environment variables, avoiding plaintext keys in config files. Three protocols correspond to different model families: Claude uses `ofoxai-anthropic` (`anthropic-messages`), OpenAI uses `ofoxai-openai` (`openai-responses`), Gemini uses `ofoxai-gemini` (`google-generative-ai`). Other models can connect through `ofoxai-openai`. ### Models Configuration Models are defined in the `models` array of their corresponding provider. We provide three configurations based on your needs: **Premium Setup** **All-Claude lineup** — Maximum capability for demanding scenarios. ```json filename="openclaw.json — models.providers" { "models": { "providers": { "ofoxai-anthropic": { "baseUrl": "https://api.ofox.ai/anthropic", "apiKey": "${OFOXAI_API_KEY}", "api": "anthropic-messages", "models": [ { "id": "anthropic/claude-sonnet-5.5", "name": "Claude Sonnet 5.5", "input": ["text", "image", "file"], "contextWindow": 1000000, "maxTokens": 128000 }, { "id": "anthropic/claude-opus-5.5", "name": "Claude Opus 5.5", "reasoning": true, "input": ["text", "image", "file"], "contextWindow": 1000000, "maxTokens": 128000 }, { "id": "anthropic/claude-haiku-5.5", "name": "Claude Haiku 5.5", "input": ["text", "image", "file"], "contextWindow": 1000000, "maxTokens": 128000 } ] } } } } ``` | Model | Role | Use Case | |-------|------|----------| | `anthropic/claude-sonnet-5.5` | Primary | Daily chat, task execution, code generation | | `anthropic/claude-opus-5.5` | Deep reasoning | Complex analysis, long-chain reasoning, research | | `anthropic/claude-haiku-5.5` | Fast response | Simple queries, quick replies, lightweight tasks | **Balanced Setup** **OpenAI Codex combo** — Strong coding capabilities with balanced general performance. ```json filename="openclaw.json — models.providers" { "models": { "providers": { "ofoxai-openai": { "baseUrl": "https://api.ofox.ai/v1", "apiKey": "${OFOXAI_API_KEY}", "api": "openai-responses", "models": [ { "id": "openai/gpt-5.3-codex", "name": "GPT 5.3 Codex", "reasoning": true, "input": ["text", "image", "audio", "file"], "contextWindow": 512000, "maxTokens": 128000 }, { "id": "openai/gpt-5.1-codex-mini", "name": "GPT 5.1 Codex Mini", "input": ["text", "image", "audio", "file"], "contextWindow": 256000, "maxTokens": 65536 } ] } } } } ``` | Model | Role | Use Case | |-------|------|----------| | `openai/gpt-5.3-codex` | Primary + reasoning | Daily chat, complex tasks, code refactoring | | `openai/gpt-5.1-codex-mini` | Fast response | Lightweight tasks, code completion, quick Q&A | OpenAI models connect through the `ofoxai-openai` provider using the `openai-responses` protocol. **Cost-Effective Setup** **Budget-friendly choice** — Low token prices, ideal for high-frequency daily use. ```json filename="openclaw.json — models.providers" { "models": { "providers": { "ofoxai-openai": { "baseUrl": "https://api.ofox.ai/v1", "apiKey": "${OFOXAI_API_KEY}", "api": "openai-responses", "models": [ { "id": "qwen/qwen3.7-plus", "name": "Qwen3.7 Plus", "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 64000 }, { "id": "volcengine/doubao-seed-2.0-code", "name": "Doubao Seed 2.0 Code", "input": ["text", "image"], "contextWindow": 256000, "maxTokens": 128000 } ] } } } } ``` | Model | Role | Use Case | |-------|------|----------| | `qwen/qwen3.7-plus` | Primary + reasoning | Daily chat, general tasks, Chinese-optimized | | `volcengine/doubao-seed-2.0-code` | Code + fast | Code generation, debugging, quick replies | ### Agents Configuration OpenClaw uses `agents.defaults` for global defaults and `agents.list` to define different agents, each of which can override default settings: ```json filename="openclaw.json — agents section" { "agents": { "defaults": { "model": { "primary": "ofoxai-anthropic/anthropic/claude-sonnet-5.5", "fallbacks": ["ofoxai-anthropic/anthropic/claude-haiku-5.5"] }, "models": { "ofoxai-anthropic/anthropic/claude-opus-5.5": { "alias": "opus" }, "ofoxai-anthropic/anthropic/claude-sonnet-5.5": { "alias": "sonnet" }, "ofoxai-anthropic/anthropic/claude-haiku-5.5": { "alias": "haiku" } }, "thinkingDefault": "low", "timeoutSeconds": 600, "maxConcurrent": 3 }, "list": [ { "id": "main", "default": true }, { "id": "research", "model": { "primary": "ofoxai-anthropic/anthropic/claude-opus-5.5" } }, { "id": "quick", "model": { "primary": "ofoxai-anthropic/anthropic/claude-haiku-5.5" } } ] } } ``` | Agent | Model | Purpose | |-------|-------|---------| | **main** | `claude-sonnet-5.5` (inherits defaults) | Default agent for all daily tasks | | **research** | `claude-opus-5.5` | Deep research, complex reasoning, long-form analysis | | **quick** | `claude-haiku-5.5` | Simple Q&A, fast responses, low cost | Model references use the format `provider-name/model-id` (e.g. `ofoxai-anthropic/anthropic/claude-sonnet-5.5`). The `models` field in `defaults` defines model aliases for quick switching in conversations with `/model opus`. Agents in `list` inherit all `defaults` configuration and only need to override fields that differ. ## Full Configuration Example Here's a complete `openclaw.json` combining Provider, Models, and Agents configuration (premium setup): ```json filename="~/.openclaw/openclaw.json" { "models": { "providers": { "ofoxai-anthropic": { "baseUrl": "https://api.ofox.ai/anthropic", "apiKey": "${OFOXAI_API_KEY}", "api": "anthropic-messages", "models": [ { "id": "anthropic/claude-sonnet-5.5", "name": "Claude Sonnet 5.5", "input": ["text", "image", "file"], "contextWindow": 1000000, "maxTokens": 128000 }, { "id": "anthropic/claude-opus-5.5", "name": "Claude Opus 5.5", "reasoning": true, "input": ["text", "image", "file"], "contextWindow": 1000000, "maxTokens": 128000 }, { "id": "anthropic/claude-haiku-5.5", "name": "Claude Haiku 5.5", "input": ["text", "image", "file"], "contextWindow": 1000000, "maxTokens": 128000 } ] }, "ofoxai-gemini": { "baseUrl": "https://api.ofox.ai/gemini", "apiKey": "${OFOXAI_API_KEY}", "api": "google-generative-ai", "models": [ { "id": "models/google/gemini-3.8-flash", "name": "Gemini 3.8 Flash", "reasoning": true, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 64000 }, { "id": "models/google/gemini-3.1-pro-preview", "name": "Gemini 3.1 Pro", "reasoning": true, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 64000 } ] } } }, "agents": { "defaults": { "model": { "primary": "ofoxai-anthropic/anthropic/claude-sonnet-5.5", "fallbacks": ["ofoxai-anthropic/anthropic/claude-haiku-5.5"] }, "models": { "ofoxai-anthropic/anthropic/claude-opus-5.5": { "alias": "opus" }, "ofoxai-anthropic/anthropic/claude-sonnet-5.5": { "alias": "sonnet" }, "ofoxai-anthropic/anthropic/claude-haiku-5.5": { "alias": "haiku" } }, "thinkingDefault": "low", "timeoutSeconds": 600, "maxConcurrent": 3 }, "list": [ { "id": "main", "default": true }, { "id": "research", "model": { "primary": "ofoxai-anthropic/anthropic/claude-opus-5.5" } }, { "id": "quick", "model": { "primary": "ofoxai-anthropic/anthropic/claude-haiku-5.5" } } ] } } ``` ## Use Cases Once configured, send commands to OpenClaw through your messaging app: - **Email management** — "Help me organize today's unread emails by priority" - **Schedule management** — "Schedule a team meeting tomorrow at 3 PM" - **Information retrieval** — "Search for recent articles about AI Agents and summarize the key points" - **Code assistance** — "Help me review this Python code for security issues" - **Workflow automation** — "Send a daily team report to Slack #general channel every morning at 9 AM" ## Troubleshooting **Cannot connect to OfoxAI** Verify the `baseUrl` configuration is correct: - Anthropic protocol: `https://api.ofox.ai/anthropic` - OpenAI-Response protocol: `https://api.ofox.ai/v1` - Gemini protocol: `https://api.ofox.ai/gemini` **Model not found** Verify the model ID format is correct. When defining models in `models.providers`, use the full ID returned by OfoxAI (e.g. `anthropic/claude-sonnet-5.5`). When referencing models in `agents`, add the provider name prefix: `ofoxai-anthropic/anthropic/claude-sonnet-5.5`. **High token consumption** OpenClaw's per-task consumption is relatively high. Recommendations: 1. Use `claude-haiku-5.5` or cost-effective models for daily tasks 2. Only switch to the `research` agent (using `claude-opus-5.5`) for complex tasks 3. Monitor usage in the [OfoxAI Console](https://app.ofox.ai) **How to quickly switch models** Use aliases in conversations: `/model opus`, `/model sonnet`, `/model haiku` (requires configuring aliases in `agents.defaults.models`).