> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aihubmax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw Manual Installation

> Manually install and configure OpenClaw with AihubMax

## Overview

[OpenClaw](https://github.com/open-claw/open-claw) 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.

<Info>
  For a faster setup, check out the [OpenClaw Auto Install](/en/integration-guide/openclaw-auto) guide instead.
</Info>

## Prerequisites

<CardGroup cols={2}>
  <Card title="AihubMax API Key" icon="key">
    An active AihubMax API key.
  </Card>

  <Card title="Node.js" icon="node-js">
    Node.js >= 22.12.0 installed on your system.
  </Card>

  <Card title="npm" icon="npm">
    npm (comes with Node.js).
  </Card>

  <Card title="Git" icon="git">
    Git installed on your system.
  </Card>
</CardGroup>

## Installation

<Steps>
  <Step title="Install OpenClaw">
    Install OpenClaw globally via npm:

    ```bash theme={null}
    npm install -g openclaw@latest
    ```
  </Step>

  <Step title="Verify Installation">
    Confirm that OpenClaw is installed correctly:

    ```bash theme={null}
    openclaw --version
    ```
  </Step>

  <Step title="Run Onboarding">
    Run the onboarding command to initialize OpenClaw and install the background daemon:

    ```bash theme={null}
    openclaw onboard --install-daemon
    ```

    This creates the configuration directory and default config files.
  </Step>

  <Step title="Configure Model Providers">
    Edit the main configuration file to add AihubMax as a model provider.

    <Tabs>
      <Tab title="macOS / Linux">
        ```bash theme={null}
        ~/.openclaw/openclaw.json
        ```
      </Tab>

      <Tab title="Windows">
        ```bash theme={null}
        %USERPROFILE%\.openclaw\openclaw.json
        ```
      </Tab>
    </Tabs>

    In the `models.providers` section, add the following three provider blocks for different API formats:

    ```json theme={null}
    {
      "models": {
        "providers": {
          "foxapi-anthropic": {
            "api": "anthropic-messages",
            "baseUrl": "https://api.aihubmax.com",
            "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.aihubmax.com/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.aihubmax.com/v1",
            "apiKey": "sk-your-foxapi-api-key",
            "models": [
              { "id": "gpt-4o", "name": "GPT-4o" },
              { "id": "deepseek-chat", "name": "DeepSeek V3" }
            ]
          }
        }
      }
    }
    ```

    <Warning>
      Replace `sk-your-foxapi-api-key` with your actual AihubMax API key in all three provider blocks.
    </Warning>
  </Step>

  <Step title="Configure Default Agent Model">
    Edit the agent models configuration file to set the default model:

    <Tabs>
      <Tab title="macOS / Linux">
        ```bash theme={null}
        ~/.openclaw/agents/main/agent/models.json
        ```
      </Tab>

      <Tab title="Windows">
        ```bash theme={null}
        %USERPROFILE%\.openclaw\agents\main\agent\models.json
        ```
      </Tab>
    </Tabs>

    Set the primary model in the `agents` field:

    ```json theme={null}
    {
      "model": {
        "primary": "foxapi-anthropic/claude-opus-4-6"
      }
    }
    ```

    The format is `<provider-name>/<model-id>`.
  </Step>
</Steps>

## Verify the Connection

1. Switch to a model to confirm it is available:
   ```bash theme={null}
   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 AihubMax integration is working correctly.

## Switching Models

You can switch the active model at any time using:

```bash theme={null}
openclaw model switch <provider>/<model-id>
```

Examples:

```bash theme={null}
# 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

<AccordionGroup>
  <Accordion title="openclaw command not found">
    * 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`.
  </Accordion>

  <Accordion title="Cannot connect to AI models">
    * 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.aihubmax.com`
      * Google: `https://api.aihubmax.com/v1beta`
      * OpenAI: `https://api.aihubmax.com/v1`
    * Test the API key with a curl command:
      ```bash theme={null}
      curl https://api.aihubmax.com/v1/models \
        -H "Authorization: Bearer sk-your-foxapi-api-key"
      ```
  </Accordion>

  <Accordion title="Model switch fails">
    * 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`.
  </Accordion>

  <Accordion title="Daemon not running">
    * Re-run the onboarding command: `openclaw onboard --install-daemon`
    * Check system logs for daemon errors.
  </Accordion>
</AccordionGroup>
