Skip to main content
OpenClaw can use HaiToken through an OpenAI-compatible provider in openclaw.json. The stable path is to register HaiToken under models.providers, then point the default agent model to that provider.

Protocol Note

OpenClaw’s custom provider integration uses the openai-completions API type, so it only supports the OpenAI Chat Completions protocol; it does not support the Anthropic Messages protocol. This guide therefore only covers the OpenAI mode, with the Base URL fixed to https://api.haitoken.ai/v1.

What you need

  • A HaiToken API key
  • At least one available model ID, such as gpt-5.4
  • HaiToken OpenAI-compatible base URL: https://api.haitoken.ai/v1
If you see ~, environment variables, or user-directory placeholders in OpenClaw examples, read them as “your current user home directory.” On Windows this is usually %USERPROFILE%, on macOS usually /Users/<your-name>, and on Linux usually /home/<your-name>.

Setup Steps

Step 1: Edit openclaw.json

Add a HaiToken provider under models.providers. Example:

Step 2: Set the environment variable

Windows PowerShell:
macOS / Linux:

Step 3: Reload OpenClaw

After saving the file, first check whether OpenClaw picks up the change automatically. If the new model does not appear, restart the gateway or reopen OpenClaw and test again.

Step 4: Pick the HaiToken-backed model

Use the primary model or one of the aliases you configured and send a simple prompt.

Notes

Do not write OpenClaw setup as an install or onboarding guide here. The key part is the provider configuration and model mapping.
Model discovery through GET /v1/models can help when debugging, but you should not describe it as a guaranteed mandatory step for every OpenClaw flow.

Verification

  1. Open OpenClaw.
  2. Select the HaiToken-backed model or alias.
  3. Send a simple prompt.
  4. If the response returns normally, the integration is working.

FAQ

Next