Source: https://ailoot.ai/docs/zh-hant-tw/integrations/goose/
Canonical: https://ailoot.ai/docs/zh-hant-tw/integrations/goose/
Language: zh-hant-tw

[終端機代理](https://ailoot.ai/docs/zh-hant-tw/integrations/#agents) 

# Goose

[Markdown](https://ailoot.ai/docs/zh-hant-tw/integrations/goose/index.md)

終端機代理 · OpenAI Chat、Anthropic Messages

| 格式 | 設定位置 |
| --- | --- |
| OpenAI Chat, Anthropic Messages | goose configure → Custom Providers → Add A Custom Provider，或 ~/.config/goose/custom\_providers/ 中的 JSON (Windows: %APPDATA%\\Block\\goose\\config\\custom\_providers\\)；另一種方式是使用內建 OpenAI 提供者，並設定 OPENAI\_HOST/OPENAI\_BASE\_PATH |

## [](https://ailoot.ai/docs/zh-hant-tw/integrations/goose/#setup)設定

複製設定，並將`sk-...`替換為您的 Ailoot 控制台金鑰。若應用程式支援，最好將金鑰存放在環境變數`AILOOT_API_KEY`中。

執行前，請使用 Ailoot 金鑰呼叫 GET /v1/models。選擇支援方法包含 POST /v1/chat/completions, POST /v1/messages 的確切模型 ID，並填入設定。使用代理程式時，也請確認工具支援及客戶端版本所需的功能。

`~/.config/goose/custom_providers/ailoot.json`

```json
{
  "name": "ailoot",
  "engine": "openai",
  "display_name": "Ailoot",
  "description": "Ailoot API",
  "api_key_env": "AILOOT_API_KEY",
  "base_url": "https://api.ailoot.ai/v1/chat/completions",
  "models": [
    {
      "name": "claude-sonnet-5-5",
      "context_limit": 1000000
    },
    {
      "name": "gpt-6.1-sol",
      "context_limit": 272000
    }
  ],
  "supports_streaming": true,
  "requires_auth": true
}
```

```bash
export AILOOT_API_KEY="sk-..."
goose session start --provider ailoot

# 使用內建 OpenAI 供應商的方式：
export GOOSE_PROVIDER=openai
export OPENAI_HOST=https://api.ailoot.ai
export OPENAI_BASE_PATH=v1/chat/completions
export OPENAI_API_KEY="$AILOOT_API_KEY"
```

模型範例：`claude-sonnet-5-5`。若要使用其他模型，請從此處選取：[目錄](https://ailoot.ai/models/zh-hant-tw/) —請確認模型支援所需格式。

## [](https://ailoot.ai/docs/zh-hant-tw/integrations/goose/#notes)重要須知

自訂提供者的引擎包括 openai、anthropic、ollama。Goose 範例中，engine openai 的 base\_url 使用到 /v1/chat/completions 的完整路徑。內建提供者的 OPENAI\_HOST 是不含路徑的根位址，OPENAI\_BASE\_PATH 則是路徑 (預設為 v1/chat/completions)。Goose 會忽略 config.yaml 中的金鑰，只使用環境變數或系統金鑰圈。儲存庫已移至 aaif-goose/goose。

## [](https://ailoot.ai/docs/zh-hant-tw/integrations/goose/#check)驗證

- custom base\_url 或內建 OPENAI\_HOST 和 OPENAI\_BASE\_PATH，請使用上述範例的對應版本。OpenAI 方法的路徑前綴為`https://api.ailoot.ai/v1` (若應用程式要求完整位址，則使用完整路徑)。
- Anthropic 格式的位址為`https://api.ailoot.ai` — API 根位址。上述範例未展示此格式的完整設定；請查閱用戶端文件，確認欄位所需的路徑。API 路由前綴為`/v1`。
- 提出一個簡短問題。若收到錯誤，請查看代碼與Request ID，並對照此頁面：[錯誤與限制](https://ailoot.ai/docs/zh-hant-tw/errors/)。
- 剛完成設定就遇到 404，幾乎總是位址不正確，可能多加或漏加了`/v1`。
- 402 表示餘額不足以涵蓋保留金額。代理需要保留的金額比聊天更多：[原因](https://ailoot.ai/docs/zh-hant-tw/billing/reserve/)。

應用程式說明文件：[https://github.com/aaif-goose/goose/blob/main/documentation/docs/getting-started/providers.md](https://github.com/aaif-goose/goose/blob/main/documentation/docs/getting-started/providers.md)

還有疑問嗎？請提供 Request ID與問題描述，我們會協助釐清。[聯絡支援](mailto:support@ailoot.ai)

## Ailoot · 公司及其專案組合





Ailoot以累積的營運經驗、廣大的客戶群、穩定的服務及持續的KPI管理為基礎。





公司及其專案組合：數百萬客戶，每月銷售額達數十億。





Ailoot將這些營運經驗用於API存取，讓客戶的產品、代理、應用程式及自動化流程使用AI功能。
