Skip to main content

Overview

OpenClaw is an open-source AI agent Gateway that bridges chat apps to AI coding agents. It supports multiple AI model providers and API formats, enabling you to connect tools like Claude Code, Cursor, and other AI coding agents through a unified gateway. This guide covers the manual installation process, giving you full control over the configuration.
For a faster setup, check out the OpenClaw Auto Install guide instead.

Prerequisites

FoxAPI API Key

An active FoxAPI API key.

Node.js

Node.js >= 22.12.0 installed on your system.

npm

npm (comes with Node.js).

Git

Git installed on your system.

Installation

1

Install OpenClaw

Install OpenClaw globally via npm:
npm install -g openclaw@latest
2

Verify Installation

Confirm that OpenClaw is installed correctly:
openclaw --version
3

Run Onboarding

Run the onboarding command to initialize OpenClaw and install the background daemon:
openclaw onboard --install-daemon
This creates the configuration directory and default config files.
4

Configure Model Providers

Edit the main configuration file to add FoxAPI as a model provider.
~/.openclaw/openclaw.json
In the models.providers section, add the following three provider blocks for different API formats:
{
  "models": {
    "providers": {
      "foxapi-anthropic": {
        "api": "anthropic-messages",
        "baseUrl": "https://api.foxapi.cc",
        "apiKey": "sk-your-foxapi-api-key",
        "models": [
          { "id": "claude-opus-4-6", "name": "Claude Opus 4.6" },
          { "id": "claude-sonnet-4-20250514", "name": "Claude Sonnet 4" }
        ]
      },
      "foxapi-google": {
        "api": "google-generative-ai",
        "baseUrl": "https://api.foxapi.cc/v1beta",
        "apiKey": "sk-your-foxapi-api-key",
        "models": [
          { "id": "gemini-2.5-pro", "name": "Gemini 2.5 Pro" },
          { "id": "gemini-2.5-flash", "name": "Gemini 2.5 Flash" }
        ]
      },
      "foxapi-openai": {
        "api": "openai-completions",
        "baseUrl": "https://api.foxapi.cc/v1",
        "apiKey": "sk-your-foxapi-api-key",
        "models": [
          { "id": "gpt-4o", "name": "GPT-4o" },
          { "id": "deepseek-chat", "name": "DeepSeek V3" }
        ]
      }
    }
  }
}
Replace sk-your-foxapi-api-key with your actual FoxAPI API key in all three provider blocks.
5

Configure Default Agent Model

Edit the agent models configuration file to set the default model:
~/.openclaw/agents/main/agent/models.json
Set the primary model in the agents field:
{
  "model": {
    "primary": "foxapi-anthropic/claude-opus-4-6"
  }
}
The format is <provider-name>/<model-id>.

Verify the Connection

  1. Switch to a model to confirm it is available:
    openclaw model switch foxapi-anthropic/claude-opus-4-6
    
  2. Start a conversation with the agent to test the connection.
  3. If you receive a response, the FoxAPI integration is working correctly.

Switching Models

You can switch the active model at any time using:
openclaw model switch <provider>/<model-id>
Examples:
# Switch to Claude Sonnet 4
openclaw model switch foxapi-anthropic/claude-sonnet-4-20250514

# Switch to Gemini 2.5 Pro
openclaw model switch foxapi-google/gemini-2.5-pro

# Switch to GPT-4o
openclaw model switch foxapi-openai/gpt-4o

Troubleshooting

  • Ensure Node.js >= 22.12.0 is installed: node --version
  • Reinstall OpenClaw: npm install -g openclaw@latest
  • Check that npm global bin directory is in your PATH.
  • Verify the apiKey and baseUrl values in openclaw.json.
  • Make sure you are using the correct base URL for each API format:
    • Anthropic: https://api.foxapi.cc
    • Google: https://api.foxapi.cc/v1beta
    • OpenAI: https://api.foxapi.cc/v1
  • Test the API key with a curl command:
    curl https://api.foxapi.cc/v1/models \
      -H "Authorization: Bearer sk-your-foxapi-api-key"
    
  • Confirm the provider name and model ID match exactly what is defined in openclaw.json.
  • The format must be <provider>/<model-id>, e.g. foxapi-anthropic/claude-opus-4-6.
  • Re-run the onboarding command: openclaw onboard --install-daemon
  • Check system logs for daemon errors.