OPENCLAW 指南

在 OpenClaw 中使用 RunAPI。

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

複製提示詞 · 一組 RunAPI 金鑰 · model catalog 連結
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 "https://runapi.ai/v1".
- Use api "openai-completions".
- Register provider-local model id "gpt-5.2" with display name "RunAPI GPT 5.2".
- Set the default model to "runapi/gpt-5.2" while keeping existing providers available.
- After editing config, run `openclaw models status` and confirm `runapi/gpt-5.2` appears.
- If RUNAPI_API_KEY is missing, ask me to set it before starting OpenClaw.
{
  agents: {
    defaults: {
      model: { primary: "runapi/gpt-5.2" },
      models: {
        "runapi/gpt-5.2": { alias: "RunAPI GPT 5.2" },
      },
    },
  },
  models: {
    mode: "merge",
    providers: {
      runapi: {
        baseUrl: "https://runapi.ai/v1",
        apiKey: "${RUNAPI_API_KEY}",
        api: "openai-completions",
        models: [
          {
            id: "gpt-5.2",
            name: "RunAPI GPT 5.2",
            reasoning: false,
            input: ["text"],
            contextWindow: 128000,
            maxTokens: 8192,
          },
        ],
      },
    },
  },
}
export RUNAPI_API_KEY="runapi_xxx"
openclaw models status
openclaw models set runapi/gpt-5.2
openclaw
Copy prompt first /v1
SETUP

用提示詞在 OpenClaw 安裝 RunAPI

1

貼上設定提示詞

將第一個分頁中的提示詞複製到 OpenClaw。它會告訴 OpenClaw 讀取 RUNAPI_API_KEY、加入 runapi 供應商,並保留既有供應商可用。

Copy prompt
2

檢視產生的設定

OpenClaw 應該將 gpt-5.2 加入為供應商內部的模型 ID,然後透過帶有供應商前綴的參照 runapi/gpt-5.2 來選取它。

runapi/gpt-5.2
3

驗證選取結果

執行 openclaw models status,切換到 RunAPI 模型,並開始 OpenClaw 工作階段。如果模型沒有出現,請確認 allowlist 包含 runapi/gpt-5.2。

openclaw models status
REFERENCE

設定欄位

欄位 用途
baseUrl https://runapi.ai/v1 將 OpenClaw 指向 RunAPI 的 OpenAI 相容 API 端點。
apiKey ${RUNAPI_API_KEY} 從環境變數讀取 RunAPI API 金鑰。
api openai-completions 使用 OpenAI 相容 endpoint 所預期的 Chat Completions adapter。
agents.defaults.model.primary runapi/gpt-5.2 將 RunAPI 模型設為新 OpenClaw 工作階段的預設模型。
FAQ

OpenClaw 設定常見問題

在 OpenClaw 中只用一組 RunAPI 金鑰。

瀏覽模型目錄、選擇模型 ID,然後將它加入你的 OpenClaw 供應商設定。