TOKENOPENTOKENOPEN
User GuideAPI ReferenceHelp & Support
AI Apps

Using TOKENOPEN API with OpenClaw

Use OpenClaw with TOKENOPEN API to run an open-source coding AI agent locally

OpenClaw is an open-source AI coding agent. It can autonomously read files, write code, execute commands, and complete complex development tasks. By configuring TOKENOPEN API, you can use all models available on the platform.

OpenClaw requires Node.js 22+. Please ensure Node.js is installed before proceeding.


Step 1: Install OpenClaw

Use the official install script:

curl -fsSL https://install.openclaw.dev | bash

Verify the installation:

openclaw --version

Run in PowerShell:

iex (irm https://install.openclaw.dev/windows)

Verify the installation:

openclaw --version

Step 2: Configure TOKENOPEN API

Get an API Key

Log in to the TOKENOPEN Console, navigate to the API Keys page, and create or copy a key.

(Optional) Install System Daemon

If you want OpenClaw to run persistently as a background service, run:

openclaw onboard --install-daemon

Edit the Configuration File

OpenClaw's configuration file is located at ~/.openclaw/openclaw.json. Open and edit it:

mkdir -p ~/.openclaw
vim ~/.openclaw/openclaw.json

Paste the following content:

{
  "models": {
    "mode": "merge",
    "providers": {
      "my-proxy": {
        "baseUrl": "replace-based-on-the-table-below",
        "apiKey": "replace-with-your-api-key",
        "api": "replace-based-on-the-table-below",
        "authHeader": true,
        "models": [
          {
            "id": "replace-with-model-id",
            "name": "replace-with-model-name",
            "contextWindow": 128000,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "replace-based-on-the-table-below"
      }
    }
  }
}

Reference options:

ParameterExample valueNotes
models[].idgpt-5.5 or claude-sonnet-4-6Set the actual model ID to call, matching a model identifier supported by TOKENOPEN
baseUrlhttps://www.tokenopen.ai/v1 or https://www.tokenopen.aiThe former is for openai-completions; the latter is for anthropic and should not include /v1
apiopenai-completions or anthropicChoose the value that matches the API type you use
agents.defaults.model.primarygpt-5.5 or claude-sonnet-4-6Set this to the primary model ID you want to use

Press Esc, then type :wq! to save and quit.

mkdir -p ~/.openclaw
vim ~/.openclaw/openclaw.json

Paste the following content:

{
  "models": {
    "mode": "merge",
    "providers": {
      "my-proxy": {
        "baseUrl": "replace-based-on-the-table-below",
        "apiKey": "replace-with-your-api-key",
        "api": "replace-based-on-the-table-below",
        "authHeader": true,
        "models": [
          {
            "id": "replace-with-model-id",
            "name": "replace-with-model-name",
            "contextWindow": 128000,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "replace-based-on-the-table-below"
      }
    }
  }
}

Reference options:

ParameterExample valueNotes
models[].idgpt-5.5 or claude-sonnet-4-6Set the actual model ID to call, matching a model identifier supported by TOKENOPEN
baseUrlhttps://www.tokenopen.ai/v1 or https://www.tokenopen.aiThe former is for openai-completions; the latter is for anthropic and should not include /v1
apiopenai-completions or anthropicChoose the value that matches the API type you use
agents.defaults.model.primarygpt-5.5 or claude-sonnet-4-6Set this to the primary model ID you want to use

Press Esc, then type :wq! to save and quit. Or open in TextEdit:

open -e ~/.openclaw/openclaw.json

Run in PowerShell to create the config file automatically:

New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.openclaw" | Out-Null

@'
{
  "models": {
    "mode": "merge",
    "providers": {
      "my-proxy": {
        "baseUrl": "replace-based-on-the-table-below",
        "apiKey": "replace-with-your-api-key",
        "api": "replace-based-on-the-table-below",
        "authHeader": true,
        "models": [
          {
            "id": "replace-with-model-id",
            "name": "replace-with-model-name",
            "contextWindow": 128000,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "replace-based-on-the-table-below"
      }
    }
  }
}
'@ | Set-Content -Path "$env:USERPROFILE\.openclaw\openclaw.json" -Encoding UTF8

Reference options:

ParameterExample valueNotes
models[].idgpt-5.5 or claude-sonnet-4-6Set the actual model ID to call, matching a model identifier supported by TOKENOPEN
baseUrlhttps://www.tokenopen.ai/v1 or https://www.tokenopen.aiThe former is for openai-completions; the latter is for anthropic and should not include /v1
apiopenai-completions or anthropicChoose the value that matches the API type you use
agents.defaults.model.primarygpt-5.5 or claude-sonnet-4-6Set this to the primary model ID you want to use

Or open the config file manually in Notepad:

notepad "$env:USERPROFILE\.openclaw\openclaw.json"

Set apiKey to the key obtained from the TOKENOPEN Console. You can adjust baseUrl, api, and agents.defaults.model.primary based on the table above. You can also add multiple model objects in the models array if needed.


Step 3: Use OpenClaw

Start a Chat

Once configured, start a conversation directly from the command line:

openclaw chat

Common Commands

CommandDescription
openclaw chatStart a conversation
openclaw chat --session <session-id>Start a new session
openclaw dashboardOpen the web management UI
openclaw models default set [model]Set the default model
openclaw --helpView all available commands

Supported models on TOKENOPEN (examples):

Model IDDescription
gpt-5.5GPT-5.5, latest flagship model
gpt-5.4-miniGPT-5.4 Mini, low-latency lightweight model
claude-sonnet-4-6Claude Sonnet 4.6, balanced model
deepseek-r1DeepSeek R1, strong reasoning model

For the full model list and pricing, visit the Model Marketplace.

Last updated on