> ## Documentation Index
> Fetch the complete documentation index at: https://wiki.agnes-ai.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw Integration Guide

> OpenClaw Model Configuration Guide

## 1. Overview

This guide explains how to configure a custom model provider in OpenClaw.

After the configuration is complete, OpenClaw can call models through the specified API endpoint and use them for local Agent tasks.

## 2. Prerequisites

<Note>
  Before you start, make sure you have the following:

  1. OpenClaw installed on your device.
  2. A valid API Key.
  3. The model name you want to use.
  4. A network environment that can access the API service normally.
</Note>

<Steps>
  <Step title="Open Terminal or Console">
    Open a terminal or command-line tool on your local device.

    macOS or Linux users can use Terminal.

    Windows users can use Command Prompt, PowerShell, or the terminal inside their development environment.
  </Step>

  <Step title="Open the OpenClaw Configuration Interface">
    Run the following command in the terminal:

    ```bash theme={null}
    openclaw config
    ```

    Press **Enter** to enter the configuration process.
  </Step>

  <Step title="Select Local Configuration">
    In the configuration menu, select:

    ```text theme={null}
    Local
    ```

    Press **Enter**.

    This option means the configuration will be applied to your local OpenClaw environment.
  </Step>

  <Step title="Enter Model Configuration">
    Continue by selecting:

    ```text theme={null}
    Model
    ```

    Press **Enter**.

    This option is used to configure the model service used by OpenClaw.
  </Step>

  <Step title="Select Custom Provider">
    Select:

    ```text theme={null}
    Custom Provider
    ```

    Press **Enter**.

    Choose this option when you want to connect OpenClaw to a custom OpenAI-Compatible API service.
  </Step>

  <Step title="Configure the API Base URL">
    When prompted to enter the API Base URL, input:

    ```text theme={null}
    https://apihub.agnes-ai.com/v1
    ```

    Press **Enter**.

    This address tells OpenClaw to send model requests to the Agnes AI API Gateway.
  </Step>

  <Step title="Enter the API Key">
    When prompted to enter the API Key, input your actual API Key.

    Example:

    ```text theme={null}
    YOUR_API_KEY
    ```

    In most cases, you do not need to manually add the `Bearer` prefix unless OpenClaw explicitly asks you to enter the full Authorization Header.
  </Step>

  <Step title="Enter the Model Name">
    When prompted to enter the model name, input the model ID you want to use.

    Example:

    ```text theme={null}
    agnes-2.0-flash
    ```

    Make sure to enter the full model ID provided by the platform.
  </Step>

  <Step title="Save the Configuration">
    After completing all required fields, confirm and save the configuration.

    Once saved successfully, OpenClaw will use this custom provider for local model calls.
  </Step>
</Steps>

## 12. Configuration Example

<span class="field-kv"><span class="field-key">Provider Type:</span> <code>Custom Provider</code></span>
<span class="field-kv"><span class="field-key">API Base URL:</span> <code>[https://apihub.agnes-ai.com/v1](https://apihub.agnes-ai.com/v1)</code></span>
<span class="field-kv"><span class="field-key">API Key:</span> <code>YOUR\_API\_KEY</code></span>
<span class="field-kv"><span class="field-key">Model:</span> <code>agnes-2.0-flash</code></span>

## 13. Verify the Configuration

After completing the configuration, you can run an OpenClaw task or start a test session.

If the configuration is correct, OpenClaw should be able to send requests to the API service and return model responses normally.

## 14. Troubleshooting

<AccordionGroup>
  <Accordion title="1. API Request Failed">
    Check whether the API Base URL is correct:

    ```text theme={null}
    https://apihub.agnes-ai.com/v1
    ```

    Also confirm that your API Key is valid.
  </Accordion>

  <Accordion title="2. Model Not Found">
    Check whether the model name is entered correctly.

    Model IDs are usually case-sensitive. It is recommended to copy the model name directly from the platform.
  </Accordion>

  <Accordion title="3. Authentication Failed">
    Check whether the API Key has expired, whether the account has sufficient balance, and whether the Key has permission to access the target model.
  </Accordion>

  <Accordion title="4. Network Error">
    Make sure your device can access the API address normally.

    If the request cannot be completed, check your firewall, proxy, or VPN settings.
  </Accordion>
</AccordionGroup>

## 15. Notes

<Warning>
  For OpenAI-Compatible API services, the API Base URL usually ends with `/v1`.

  Correct example:

  ```text theme={null}
  https://apihub.agnes-ai.com/v1
  ```

  It is usually not recommended to enter:

  ```text theme={null}
  https://apihub.agnes-ai.com/v1/chat/completions
  ```

  unless OpenClaw explicitly asks you to enter the full API endpoint.
</Warning>
