# TRAE

透過相容模型 provider 設定，在 TRAE 中使用 Felo API Platform。

當 TRAE 可以設定自訂 OpenAI-compatible 或 Anthropic-compatible 模型 provider 時，請使用本指南。

## 開始之前

你需要一個 Felo API Platform key。同一個 key 可用於模型協議、Agent 使用者端、Search、Web Fetch、PPT、Mindmap、LiveDocs、X Search、YouTube Subtitling、Landing Page 和 SuperAgent API。

```bash
export FELO_API_KEY="YOUR_API_KEY"
```

## 建議設定

| 專案 | 值 |
|------|-------|
| 最適合 | AI IDE 工作流程、程式碼生成、repo 問答和輔助編輯 |
| 協議 | OpenAI-compatible endpoint by default |
| Base URL | `https://openapi.felo.ai/api/v1` |
| 模型範例 | `claude-sonnet-4-6` |
| API key | 你的 `FELO_API_KEY` |

## 設定 TRAE

先設定環境變數：

```bash
export FELO_API_KEY="YOUR_API_KEY"
export OPENAI_API_KEY="$FELO_API_KEY"
export OPENAI_BASE_URL="https://openapi.felo.ai/api/v1"
```

### 使用者端欄位

| 欄位 | 值 |
|-------|-------|
| Provider 型別 | OpenAI-compatible |
| API key | 你的 `FELO_API_KEY` |
| Base URL | `https://openapi.felo.ai/api/v1` |
| Model | `claude-sonnet-4-6` |

如果選擇 Anthropic-compatible provider 模式，請使用 `https://openapi.felo.ai/api` 作為 Base URL。

## 驗證設定

儲存設定後，執行一個小任務：

```bash
Open TRAE, select the Felo provider, and send a short test message.
```

如果工具能夠啟動，並使用所選模型回覆，表示 provider 已設定完成。

## 疑難排解

| 問題 | 檢查專案 |
|-------|---------------|
| 認證失敗 | 確認 key 已正確複製，並已匯出為 `FELO_API_KEY` |
| 工具呼叫了錯誤的 provider | 檢查目前 workspace 或 session 是否已選擇 Felo provider |
| Base URL 錯誤 | OpenAI-compatible 使用者端使用 `https://openapi.felo.ai/api/v1`，Anthropic-compatible 使用者端使用 `https://openapi.felo.ai/api` |
| 找不到模型 | 選擇一個出現在 Felo 模型列表中的模型 |
| 工具忽略本機設定 | 如果使用者端要求使用者層級設定，請把 provider 設定移到使用者層級設定中 |

## 下一步

- [快速開始](https://openapi.felo.ai/zh-TW/docs/getting-started.md)
- [LLM API 參考](https://openapi.felo.ai/zh-TW/docs/guides/protocols.md)
- [Chat API 參考](https://openapi.felo.ai/zh-TW/docs/api-reference/chat.md)
- [SuperAgent API 參考](https://openapi.felo.ai/zh-TW/docs/api-reference/superagent.md)
