# OpenClaw 設定指南

> 用 openclaw.json 把 OpenClaw 接到 LLMoxy 的 Anthropic Messages 介面。

網址：[https://openclaw.ai](https://openclaw.ai)

原始碼：[GitHub openclaw/openclaw](https://github.com/openclaw/openclaw) · 國內鏡像：[Gitee OpenClaw-CN](https://gitee.com/OpenClaw-CN/openclaw-cn)

OpenClaw（由 Clawdbot 改名而來）使用本機的 `openclaw.json` 設定模型。外掛或 SDK 安裝失敗時，請把套件名稱改為 OpenClaw 再試。

開始前請準備一把 [LLMoxy 權杖](https://tw.llmoxy.com/docs/get-started/get-token)，建議使用 **auto** 分組。

## 安裝

```bash
npm i -g openclaw
```

設定檔位置：

| 系統 | 路徑 |
| --- | --- |
| Windows | `%USERPROFILE%\.openclaw\openclaw.json` |
| macOS / Linux | `~/.openclaw/openclaw.json` |

也可以直接下載完整範本，替換金鑰後覆蓋上述檔案：

- [Windows 版 openclaw.json](https://tw.llmoxy.com/docs-assets/migrated/tutorial-openclaw/file-01.json)
- [macOS 版 openclaw.json](https://tw.llmoxy.com/docs-assets/migrated/tutorial-openclaw/file-02.json)

## 接入 LLMoxy

把下面兩段合併進現有的 `openclaw.json`。Anthropic 相容位址 **不帶** `/v1`。

```json
{
  "models": {
    "providers": {
      "claude": {
        "baseUrl": "https://llmoxy.com",
        "apiKey": "您的LLMoxy API Key",
        "api": "anthropic-messages",
        "models": [
          {
            "id": "claude-opus-5-5",
            "name": "claude-opus-5-5",
            "reasoning": false,
            "input": ["text"],
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "contextWindow": 200000,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": { "primary": "claude/claude-opus-5-5" },
      "models": {
        "claude/claude-opus-5-5": { "alias": "claude-opus-5-5" }
      }
    }
  }
}
```

在介面中選擇「自訂伺服器 / 自訂模型」時，填入相同的值：

| 欄位 | 值 |
| --- | --- |
| `baseUrl` / API 端點 | `https://llmoxy.com` |
| `api` | `anthropic-messages` |
| `apiKey` | LLMoxy 權杖 |
| 模型 ID | `claude-opus-5-5` |

![自訂模型](https://tw.llmoxy.com/docs-assets/migrated/tutorial-openclaw/image-01.png)

## 啟動

```bash
openclaw gateway
```

瀏覽器開啟 `http://localhost:18789`。

## 常見問題

**安裝失敗、找不到套件**
儲存庫已改過名。安裝和外掛請使用 `openclaw`，不要再使用 `clawdbot`。

**走 OpenAI 相容而不是 Anthropic**
把 `api` 改為 `openai-completions`，`baseUrl` 改為 `https://llmoxy.com/v1`。

本文是 https://tw.llmoxy.com/docs/code-tutorials/openclaw 的 markdown 版本。
