---
title: &quot;在 OpenClaw 中使用 RunAPI — OpenAI 相容設定指南&quot;
url: &quot;https://runapi.ai/zh-TW/openclaw.md&quot;
canonical: &quot;https://runapi.ai/zh-TW/openclaw&quot;
locale: &quot;zh-TW&quot;
---

# RunAPI in OpenClaw

RunAPI 可作為 OpenClaw 的 OpenAI 相容 endpoint。把提示詞貼到 OpenClaw，讓它自動新增 provider；只有在你想確認實際欄位時，再開啟 config 分頁查看。

## Install prompt

Copy this prompt into OpenClaw:

```text
Configure this OpenClaw workspace to use RunAPI.

Requirements:
- Read the API key from RUNAPI_API_KEY. Do not hardcode the key.
- Add a model provider named runapi.
- Use baseUrl &quot;https://runapi.ai/v1&quot;.
- Use api &quot;openai-completions&quot;.
- Register provider-local model id &quot;gpt-5.5&quot; with display name &quot;RunAPI GPT 5.5&quot;.
- Set the default model to &quot;runapi/gpt-5.5&quot; while keeping existing providers available.
- After editing config, run `openclaw models status` and confirm `runapi/gpt-5.5` appears.
- If RUNAPI_API_KEY is missing, ask me to set it before starting OpenClaw.
```

## Configuration

```json5
{
  agents: {
    defaults: {
      model: { primary: "runapi/gpt-5.5" },
      models: {
        "runapi/gpt-5.5": { alias: "RunAPI GPT 5.5" },
      },
    },
  },
  models: {
    mode: "merge",
    providers: {
      runapi: {
        baseUrl: "https://runapi.ai/v1",
        apiKey: "${RUNAPI_API_KEY}",
        api: "openai-completions",
        models: [
          {
            id: "gpt-5.5",
            name: "RunAPI GPT 5.5",
            reasoning: false,
            input: ["text"],
            contextWindow: 128000,
            maxTokens: 8192,
          },
        ],
      },
    },
  },
}
```

## Steps

1. **貼上設定提示詞** — 將第一個分頁中的提示詞複製到 OpenClaw。它會告訴 OpenClaw 讀取 RUNAPI_API_KEY、加入 runapi 供應商，並保留既有供應商可用。
2. **檢視產生的設定** — OpenClaw 應該將 gpt-5.2 加入為供應商內部的模型 ID，然後透過帶有供應商前綴的參照 runapi/gpt-5.2 來選取它。
3. **驗證選取結果** — 執行 openclaw models status，切換到 RunAPI 模型，並開始 OpenClaw 工作階段。如果模型沒有出現，請確認 allowlist 包含 runapi/gpt-5.2。

## FAQ

### OpenClaw 可以把 RunAPI 當作自訂模型供應商嗎？

可以。OpenClaw 透過 models.providers 支援自訂的 OpenAI 相容供應商。請將 RunAPI 設定為 /v1 base URL，將 api 設為 openai-completions，並在 agents.defaults.model.primary 選擇帶有供應商前綴的模型參照。

### 模型 ID 在 models.providers 裡需要包含供應商前綴嗎？

不用。在 models.providers.runapi.models 內，請使用供應商內部的 ID，例如 gpt-5.2。當你要在 OpenClaw 預設值或指令中選擇模型時，使用帶有供應商前綴的參照 runapi/gpt-5.2。

### 我應該把 RunAPI API 金鑰存在哪裡？

請將金鑰存到 RUNAPI_API_KEY，並從 OpenClaw 設定中讀取。這樣可避免憑證進入版本控制，也能讓同一份設定在本機 shell、伺服器和自動化流程中通用。

### 我可以保留現有的 OpenClaw 模型作為備援嗎？

可以。將 models.mode 保持為 merge，並新增 RunAPI 作為其中一個供應商。你既有的供應商仍然可用，而且當你需要復原行為時，也可以在 agents.defaults.model.fallbacks 中加入備援。


## Links

- [Model catalog](https://runapi.ai/zh-TW/models)
- [CLI](https://runapi.ai/zh-TW/cli)
- [MCP Server](https://runapi.ai/zh-TW/mcp)
- [Pricing](https://runapi.ai/zh-TW/pricing)
- [API docs](https://runapi.ai/zh-TW/docs)
- [Hermes Agent setup](https://runapi.ai/zh-TW/hermes-agent)
