---
title: 在 Grok Build 使用 RunAPI — 自訂模型設定指南 | RunAPI
description: 使用 xAI 文件所述的自訂模型欄位、環境變量 API 金鑰及 RunAPI 模型指南，在 Grok Build 設定 RunAPI。
url: https://runapi.ai/zh-HK/grok-build.md
canonical: https://runapi.ai/zh-HK/grok-build
locale: zh-HK
site: RunAPI
image: https://runapi.ai/assets/opengraph-bfaaa0f0.png
alternates:
  en: https://runapi.ai/grok-build
  zh-CN: https://runapi.ai/zh-CN/grok-build
  es: https://runapi.ai/es/grok-build
  ja: https://runapi.ai/ja/grok-build
  de: https://runapi.ai/de/grok-build
  fr: https://runapi.ai/fr/grok-build
  pt-BR: https://runapi.ai/pt-BR/grok-build
  ko: https://runapi.ai/ko/grok-build
  it: https://runapi.ai/it/grok-build
  nl: https://runapi.ai/nl/grok-build
  pl: https://runapi.ai/pl/grok-build
  tr: https://runapi.ai/tr/grok-build
  zh-TW: https://runapi.ai/zh-TW/grok-build
  zh-HK: https://runapi.ai/zh-HK/grok-build
  ar: https://runapi.ai/ar/grok-build
  x-default: https://runapi.ai/grok-build
---

> HTML version: https://runapi.ai/zh-HK/grok-build
> Site index for agents: https://runapi.ai/llms.txt


# 在 Grok Build 使用 RunAPI。

Grok Build 支援透過 base_url 和 env_key 設定自訂模型。將文件所述的 TOML 結構指向 RunAPI，把金鑰保存在 RUNAPI_API_KEY，並選擇目錄中的模型指南。

- [取得 API 金鑰](https://runapi.ai/zh-HK/login)
- [瀏覽模型](https://runapi.ai/zh-HK/models.md)

> 本頁將官方設定事實與執行證據分開。本次工作沒有發出付費上游請求，也沒有進行真實 Grok Build 工作階段，因此範例不代表推理成功。

## config.toml

```toml
[model.runapi]
model = "gpt-5.5"
name = "RunAPI GPT 5.5"
base_url = "https://runapi.ai/v1"
env_key = "RUNAPI_API_KEY"

[models]
default = "runapi"
```

## 指令

```bash
export RUNAPI_API_KEY="runapi_xxx"
grok --version
grok
```

## 設定文件所述的自訂模型結構

1. **在環境中設定 API 金鑰** — 在啟動 Grok Build 的同一環境匯出 RUNAPI_API_KEY。不要把有效金鑰放進 config.toml 或原始碼。 `export RUNAPI_API_KEY="runapi_xxx"`
2. **加入 RunAPI 模型項目** — 使用 xAI 文件所述的 model、name、base_url 和 env_key 欄位，讓 default 指向命名的模型項目。 `[model.runapi]`
3. **工作階段前在本機檢查** — 檢查已安裝的 CLI 版本，並在本機檢視產生的設定。本機檢查不能證明 RunAPI 請求或模型回應成功。 `grok --version`

## 為 Grok Build 選擇 RunAPI 模型

指南清單來自 RunAPI 目錄。每份指南顯示目前的模型 ID 和公開 endpoint，不代表每個目錄變體都已在 Grok Build 中完成實際測試。

- [GPT](https://runapi.ai/zh-HK/grok-build-gpt.md) — 文字 · OpenAI

## Grok Bot 是由 Cursor 託管的獨立產品。

xAI 將 Grok Bot 說明為連接 Cursor 的產品，Bot 在持久的雲端電腦上執行。公開文件沒有提供 Grok Build 所述的自訂 base_url 或模型選擇器設定，因此本頁不承諾 Grok Bot 會經由 RunAPI 路由。

[閱讀官方 Grok Bot 文件](https://docs.x.ai/grok-bot/overview)

## 設定欄位

| 欄位 | 值 | 用途 |
| --- | --- | --- |
| `model.runapi.model` | `gpt-5.5` | 選取自訂項目使用的 RunAPI 目錄模型。 |
| `model.runapi.base_url` | `https://runapi.ai/v1` | 將文件所述的 OpenAI 相容 base URL 指向 RunAPI。 |
| `model.runapi.env_key` | `RUNAPI_API_KEY` | 從環境讀取憑證，不把憑證硬編碼。 |
| `models.default` | `runapi` | 將命名的自訂模型項目設為預設值。 |

## Grok Build 設定問題

### 本頁是否聲稱 Grok Build 已完成 RunAPI 推理？

不是。TOML 結構遵循 xAI 公開的 Grok Build 文件；真實 RunAPI 請求需要另行授權的執行檢查。本次工作沒有發出付費請求。
### RunAPI 金鑰應該保存在哪裡？

將 RUNAPI_API_KEY 設定在啟動 Grok Build 的環境中。env_key 欄位告訴本機設定要讀取哪個變數。
### Grok Bot 可以把這個設定當作自己的模型選擇器嗎？

沒有這樣的聲稱。xAI 的 Grok Bot 文件描述由 Cursor 管理的模型，沒有說明由客戶控制的 base_url 或模型選擇器。

## 官方來源

- [Grok Build official documentation](https://docs.x.ai/build/overview)
- [xAI API models](https://docs.x.ai/developers/models)

建立 RunAPI 帳戶或登入，查看目前模型目錄，並將執行驗證與這份公開設定參考分開。


---

## More from RunAPI

- [Home](https://runapi.ai/zh-HK/.md)
### 產品
- [模型目錄](https://runapi.ai/zh-HK/models.md)
- [收費](https://runapi.ai/zh-HK/pricing.md)
- [服務商](https://runapi.ai/zh-HK/models#all-models)
### 開發者
- [文件](https://runapi.ai/zh-HK/docs/guides)
- [SDK](https://runapi.ai/zh-HK/sdk.md)
- [CLI](https://runapi.ai/zh-HK/cli.md)
- [MCP Server](https://runapi.ai/zh-HK/mcp.md)
- [x402](https://runapi.ai/zh-HK/x402.md)
### 指南
- [Claude Code 與 Cursor](https://runapi.ai/zh-HK/claude-code-vs-cursor.md)
- [Cursor API 設定](https://runapi.ai/zh-HK/cursor-api-setup.md)
- [RunAPI 與 OpenRouter](https://runapi.ai/zh-HK/openrouter-alternative.md)
### 公司
- [企業版](https://runapi.ai/zh-HK/contact.md)
- [聯絡](https://runapi.ai/zh-HK/contact.md)
### 法律
- [條款](https://runapi.ai/zh-HK/terms.md)
- [私隱](https://runapi.ai/zh-HK/privacy.md)
- [Site index for agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-HK",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-HK",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/zh-HK/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-HK",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-HK",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/zh-HKicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-HK",
    "@type": "SoftwareApplication",
    "name": "RunAPI",
    "applicationCategory": "DeveloperApplication",
    "description": "使用 xAI 文件所述的自訂模型欄位、環境變量 API 金鑰及 RunAPI 模型指南，在 Grok Build 設定 RunAPI。",
    "url": "https://runapi.ai/zh-HK/grok-build"
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-HK",
    "@type": "FAQPage",
    "mainEntity": [
      {
        "@type": "Question",
        "name": "本頁是否聲稱 Grok Build 已完成 RunAPI 推理？",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "不是。TOML 結構遵循 xAI 公開的 Grok Build 文件；真實 RunAPI 請求需要另行授權的執行檢查。本次工作沒有發出付費請求。"
        }
      },
      {
        "@type": "Question",
        "name": "RunAPI 金鑰應該保存在哪裡？",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "將 RUNAPI_API_KEY 設定在啟動 Grok Build 的環境中。env_key 欄位告訴本機設定要讀取哪個變數。"
        }
      },
      {
        "@type": "Question",
        "name": "Grok Bot 可以把這個設定當作自己的模型選擇器嗎？",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "沒有這樣的聲稱。xAI 的 Grok Bot 文件描述由 Cursor 管理的模型，沒有說明由客戶控制的 base_url 或模型選擇器。"
        }
      }
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-HK",
    "@type": "HowTo",
    "step": [
      {
        "@type": "HowToStep",
        "position": 1,
        "name": "在環境中設定 API 金鑰",
        "text": "在啟動 Grok Build 的同一環境匯出 RUNAPI_API_KEY。不要把有效金鑰放進 config.toml 或原始碼。"
      },
      {
        "@type": "HowToStep",
        "position": 2,
        "name": "加入 RunAPI 模型項目",
        "text": "使用 xAI 文件所述的 model、name、base_url 和 env_key 欄位，讓 default 指向命名的模型項目。"
      },
      {
        "@type": "HowToStep",
        "position": 3,
        "name": "工作階段前在本機檢查",
        "text": "檢查已安裝的 CLI 版本，並在本機檢視產生的設定。本機檢查不能證明 RunAPI 請求或模型回應成功。"
      }
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-HK",
    "@type": "BreadcrumbList",
    "itemListElement": [
      {
        "@type": "ListItem",
        "position": 1,
        "name": "主頁",
        "item": "https://runapi.ai/zh-HK"
      },
      {
        "@type": "ListItem",
        "position": 2,
        "name": "RunAPI",
        "item": "https://runapi.ai/zh-HK/grok-build"
      }
    ]
  }
]
```
