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 | bashVerify the installation:
openclaw --versionRun in PowerShell:
iex (irm https://install.openclaw.dev/windows)Verify the installation:
openclaw --versionStep 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-daemonEdit the Configuration File
OpenClaw's configuration file is located at ~/.openclaw/openclaw.json. Open and edit it:
mkdir -p ~/.openclaw
vim ~/.openclaw/openclaw.jsonPaste or Modify the following content:
{
"models": {
"mode": "merge",
"providers": {
"custom-proxy": {
"baseUrl": "https://www.tokenopen.ai/v1",
"apiKey": "replace-with-your-api-key",
"api": "openai-completions",
"auth": "api-key",
"models": [
{
"id": "replace-with-model-id",
"name": "replace-with-model-name",
"contextWindow": 128000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "custom-proxy/replace-with-model-id|name"
}
}
}
}Reference options:
| Parameter | Example value | Notes |
|---|---|---|
models[].id | gpt-5.5 or claude-sonnet-4-6 | Set the actual model ID to call, matching a model identifier supported by TOKENOPEN |
agents.defaults.model.primary | custom-proxy/gpt-5.5 or custom-proxy/claude-sonnet-4-6 | Set this to the primary model ID or Name you want to use |
Press Esc, then type :wq! to save and quit.
mkdir -p ~/.openclaw
vim ~/.openclaw/openclaw.jsonPaste or Modify the following content:
{
"models": {
"mode": "merge",
"providers": {
"custom-proxy": {
"baseUrl": "https://www.tokenopen.ai/v1",
"apiKey": "replace-with-your-api-key",
"api": "openai-completions",
"auth": "api-key",
"models": [
{
"id": "replace-with-model-id",
"name": "replace-with-model-name",
"contextWindow": 128000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "custom-proxy/replace-with-model-id|name"
}
}
}
}Reference options:
| Parameter | Example value | Notes |
|---|---|---|
models[].id | gpt-5.5 or claude-sonnet-4-6 | Set the actual model ID to call, matching a model identifier supported by TOKENOPEN |
agents.defaults.model.primary | custom-proxy/gpt-5.5 or custom-proxy/claude-sonnet-4-6 | Set this to the primary model ID or Name you want to use |
Press Esc, then type :wq! to save and quit. Or open in TextEdit:
open -e ~/.openclaw/openclaw.jsonRun in PowerShell to create the config file automatically:
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.openclaw" | Out-Null
@'
{
"models": {
"mode": "merge",
"providers": {
"custom-proxy": {
"baseUrl": "https://www.tokenopen.ai/v1",
"apiKey": "replace-with-your-api-key",
"api": "openai-completions",
"auth": "api-key",
"models": [
{
"id": "replace-with-model-id",
"name": "replace-with-model-name",
"contextWindow": 128000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "custom-proxy/replace-with-model-id|name"
}
}
}
}
'@ | Set-Content -Path "$env:USERPROFILE\.openclaw\openclaw.json" -Encoding UTF8Reference options:
| Parameter | Example value | Notes |
|---|---|---|
models[].id | gpt-5.5 or claude-sonnet-4-6 | Set the actual model ID to call, matching a model identifier supported by TOKENOPEN |
agents.defaults.model.primary | custom-proxy/gpt-5.5 or custom-proxy/claude-sonnet-4-6 | Set this to the primary model ID or Name you want to use |
Or open the config file manually in Notepad:
notepad "$env:USERPROFILE\.openclaw\openclaw.json"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 chatCommon Commands
| Command | Description |
|---|---|
openclaw chat | Start a conversation |
openclaw chat --session <session-id> | Start a new session |
openclaw dashboard | Open the web management UI |
openclaw models default set [model] | Set the default model |
openclaw --help | View all available commands |
Supported models on TOKENOPEN (examples):
| Model ID | Description |
|---|---|
gpt-5.5 | GPT-5.5, latest flagship model |
gpt-5.4-mini | GPT-5.4 Mini, low-latency lightweight model |
claude-sonnet-4-6 | Claude Sonnet 4.6, balanced model |
For the full model list and pricing, visit the Model Marketplace.
Last updated on