OPENCLAW 指南

在 OpenClaw 使用 RunAPI。

RunAPI 可作為 OpenClaw 的 OpenAI 相容 endpoint 使用。將提示複製到 OpenClaw,讓它自動加入 provider;只有當你想檢查實際欄位時,才需要開啟 config 分頁。

複製提示 · 一個 RunAPI key · 模型目錄連結
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

以提示安裝 RunAPI 到 OpenClaw

1

貼上設定提示

將第一個分頁的提示複製到 OpenClaw。它會指示 OpenClaw 讀取 RUNAPI_API_KEY、加入 runapi provider,並保留現有 provider 可用。

Copy prompt
2

檢查產生的設定

OpenClaw 應會加入 gpt-5.2 作為 provider-local model ID,然後透過帶 provider 前綴的參考 runapi/gpt-5.2 選取它。

runapi/gpt-5.2
3

驗證選取結果

執行 openclaw models status,切換至 RunAPI 模型,並開始 OpenClaw session。如果模型未顯示,請確認 allowlist 包含 runapi/gpt-5.2。

openclaw models status
REFERENCE

設定欄位

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

OpenClaw 設定常見問題

在 OpenClaw 內只用一組 RunAPI key。

瀏覽 model catalog,選擇 model ID,然後加入你的 OpenClaw provider config。