3 步驟,5 分鐘串接完成
⚡01建立 Agent
POST /api/v1/agents💬02建立對話
POST /api/v1/agents/{agentId}/channels🤖03發送訊息
POST /api/v1/agents/{agentId}/chat認證
HTTP Header
Authorization: Bearer <YOUR_API_KEY>- 所有請求走 HTTPS
- 每個環境分配獨立 API Key
- 勿將 Key 寫入前端原始碼
API 規格
Agent
Chat
知識庫
POST
/api/v1/agents建立 Agent
建立新 Agent 並回傳 agentId,供後續綁定知識庫與發送對話。
| 參數 | 型別 | 說明 |
|---|---|---|
agentDisplayName | string必填 | Agent 名稱(最多 255 字元) |
agentDescription | string選填 | Agent 用途說明 |
agentToneStyle | string選填 | 語氣:PROFESSIONAL 或 CASUAL |
agentAnswerStrategy | string選填 | 策略:BALANCED / PRECISE / CREATIVE |
agentExecutionMode | string選填 | 模式:CONVERSATION 或 REPORT |
ownerId | string選填 | 租戶擁有者 ID(多租戶) |
回應
{
"agentId": 101,
"agentDisplayName": "Customer Support",
"agentStatus": "ACTIVE",
"agentCreateDate": "2026-04-01T09:00:00Z"
}錯誤碼
400Bad Request請求格式錯誤或缺少必填欄位
401UnauthorizedAPI Key 無效或缺少授權
404Not Found資源不存在或已刪除
422Unprocessable欄位值不在允許範圍
429Rate Limited請求頻率過高
500Server Error系統暫時異常,請稍後重試
官方 SDK(7 種語言)
每個語言皆提供獨立官方 GitHub Repo,客戶可直接 clone 後依 README 啟動,將人工介入降到最低。
npm install @egroupai/ai-sandbox-sdk-typescript前往 GitHub Repopip install ai-sandbox-sdk-python前往 GitHub RepoMaven: com.egroupai:ai-sandbox-sdk-java前往 GitHub RepoNuGet: EGroupAI.AiSandbox.Sdk前往 GitHub Repogo get github.com/eGroupAI/ai-sandbox-sdk-go前往 GitHub Repocomposer require egroupai/ai-sandbox-sdk-php前往 GitHub Repogem install ai-sandbox-sdk-ruby前往 GitHub Repo上線只需換 Host
Demo 和正式環境路徑完全相同,只需切換 host 與 API Key 即可上線。