Skip to content

OpenClaw

Multi-platform AI coding agent with Terminal TUI, Web Dashboard, and Telegram Bot support.

Official Websitehttps://openclaw.ai

Overview

OpenClaw is a feature-rich AI coding agent that supports terminal TUI interaction, Web Dashboard management, and Telegram Bot remote access. It's ideal for developers who need to run AI coding assistants in server environments.

Key Features

  • Terminal TUI — Command-line interactive interface, ideal for SSH environments
  • Web Dashboard — Browser-based visual management panel
  • Telegram Bot — Remote conversations via Telegram
  • Multi-Model Support — Claude, GPT, Gemini, and more
  • Gateway — Built-in gateway service with reverse proxy support
  • Skill Extensions — Install extensions via the Dashboard

Supported Environments

This guide is for Linux cloud servers and macOS systems.

403 "Your request was blocked"?

When using 3xCoder, you must add headers to your provider configuration, otherwise requests will be blocked with a 403 error:

json
"headers": {
  "User-Agent": "claude-cli/2.0.76 (external, cli)",
  "Authorization": "Bearer sk-xxxx"
}
  • Authorization must match your apiKey value, in Bearer sk-... format
  • User-Agent must be kept in the example format — do not omit or change it
  • After editing, run openclaw gateway restart to apply changes

Installation

Step 1: Run the Install Script

On your server SSH or macOS terminal, run:

bash
curl -fsSL https://openclaw.ai/install.sh | bash

Wait for installation to complete.

Step 2: Initialize Configuration

During installation, you will be prompted with the following options:

PromptSelectionNotes
Startup modeQuickStartQuick start mode
Provider setupSkip for nowWe'll configure manually later
AdapteranthropicSelect Anthropic adapter
Modelopus-4.5Or choose the model you need
Social adapterYour choicee.g., Telegram (optional)
Skill installSkipCan install later via Dashboard
Hook selectionSelect AllUse Space to select all, then Enter
Open modeSkipSkip for now
Shell completionyesInstall command-line auto-completion

Provider & Model Configuration

Step 1: Edit Configuration File

Open the OpenClaw configuration file:

bash
vim ~/.openclaw/openclaw.json

Use the configuration example below as a reference.

Step 2: Set Your API Key

In the models.providers section, replace apiKey and headers.Authorization with your API key from the 3xCoder Dashboard.

Step 3: Restart the Gateway

bash
openclaw gateway restart

Step 4: Verify

Run the TUI to test your model connection:

bash
openclaw tui

If it works, type /quit to exit.

Web Dashboard

Get the Dashboard URL

Run the dashboard command in the console to get the URL, then open it in your browser.

Server Users

If running OpenClaw on a remote server, you need to:

  1. Set up a reverse proxy — Use Nginx or similar to proxy the OpenClaw service with SSL
  2. Update the config — Add to ~/.openclaw/openclaw.json under gateway:
json
"controlUi": {
  "allowInsecureAuth": true
}
  1. Restartopenclaw gateway restart

Access the Dashboard URL with your token to enter the admin panel.

Telegram Bot (Optional)

If you selected the Telegram adapter during installation:

  1. Message your bot — Find the bot you created via @BotFather in Telegram and start a conversation
  2. Get the Pairing Code — The first message will return a pairing code
  3. Authorize — Run:
bash
openclaw pairing approve telegram YOUR_PAIRING_CODE

After pairing, you can chat with OpenClaw via Telegram.

Full Configuration Example

Below is a complete openclaw.json reference for 3xCoder (~/.openclaw/openclaw.json):

TIP

Replace sk-xxxx and xxxxx with your actual API key and bot token.

json
{
  "messages": {
    "ackReactionScope": "group-mentions"
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "3xcoder-claude/claude-opus-4-5-20251101"
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      },
      "compaction": {
        "mode": "safeguard"
      },
      "workspace": "/root/.openclaw/workspace"
    }
  },
  "models": {
    "providers": {
      "3xcoder-claude": {
        "baseUrl": "https://api.3xcoder.com/v1",
        "apiKey": "sk-xxxx",
        "api": "openai-completions",
        "headers": {
          "User-Agent": "claude-cli/2.0.76 (external, cli)",
          "Authorization": "Bearer sk-xxxx"
        },
        "models": [
          {
            "id": "claude-opus-4-5-20251101",
            "name": "claude-opus-4-5-20251101",
            "contextWindow": 200000,
            "maxTokens": 32000,
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            }
          }
        ]
      },
      "3xcoder-codex": {
        "baseUrl": "https://api.3xcoder.com/v1",
        "apiKey": "sk-xxxx",
        "api": "openai-completions",
        "headers": {
          "User-Agent": "codex_cli_rs/0.77.0 (Windows 10.0.26100; x86_64) WindowsTerminal",
          "Authorization": "Bearer sk-xxxx"
        },
        "models": [
          {
            "id": "gpt-5.2-codex",
            "name": "gpt-5.2-codex",
            "contextWindow": 200000,
            "maxTokens": 32000,
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            }
          }
        ]
      }
    }
  },
  "gateway": {
    "mode": "local",
    "auth": {
      "mode": "token",
      "token": "xxxx"
    },
    "port": 18789,
    "bind": "loopback",
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    }
  },
  "auth": {
    "profiles": {}
  },
  "plugins": {
    "entries": {
      "telegram": {
        "enabled": true
      }
    }
  },
  "channels": {
    "telegram": {
      "enabled": true,
      "botToken": "xxxxx"
    }
  },
  "logging": {
    "level": "trace",
    "consoleLevel": "debug",
    "consoleStyle": "pretty"
  },
  "commands": {
    "restart": true
  },
  "skills": {
    "install": {
      "nodeManager": "npm"
    }
  }
}

Key Fields

FieldDescription
agents.defaults.model.primaryDefault model, format: provider/model-id
agents.defaults.maxConcurrentMax concurrent main agents
agents.defaults.subagents.maxConcurrentMax concurrent sub-agents
agents.defaults.compaction.modeContext compression mode (safeguard = safe mode)
agents.defaults.workspaceWorkspace directory path
models.providers.*.baseUrlAPI base URL — use https://api.3xcoder.com/v1
models.providers.*.apiKeyYour 3xCoder API key
models.providers.*.apiProtocol, always openai-completions
models.providers.*.headersMust include User-Agent and Authorization
gateway.portGateway listen port (default 18789)
gateway.bindBind mode — loopback for local access only
channels.telegram.botTokenTelegram Bot token from @BotFather
logging.levelLog level — use trace for debugging

Notes

  • Authorization in headers must match apiKey, format: Bearer sk-xxxx
  • User-Agent must match the example format for requests to be accepted
  • Windows paths use \\ double backslash; Linux/macOS use / (e.g., /root/.openclaw/workspace)
  • Set all cost values to 0 — billing is handled by 3xCoder, not locally

Troubleshooting

Install script fails

  • Verify your network can reach openclaw.ai
  • Ensure curl and bash are installed
  • If on a restricted network, configure a proxy

403 "Your request was blocked"

Missing or incorrect headers. Add the headers field to your provider config:

json
"headers": {
  "User-Agent": "claude-cli/2.0.76 (external, cli)",
  "Authorization": "Bearer sk-xxxx"
}

Then run openclaw gateway restart.

Gateway restart — model still unavailable

  • Verify the API key is entered correctly
  • Confirm your key's group supports the selected model
  • Check OpenClaw logs for detailed errors

More Help

See Troubleshooting or FAQ.

Model errors

  • Verify your API key and base URL in config.json
  • Test the connection: curl https://api.3xcoder.com/v1/models -H "Authorization: Bearer sk-your-key"
  • Ensure the model names match what's available in your 3xCoder account

Docker issues

  • Ensure port mapping is correct: -p 3000:3000
  • Mount the config file correctly: -v /path/to/config.json:/app/config.json
  • Check Docker logs: docker logs <container-id>

3xCoder — Unified AI API Endpoint