所有伺服器工具
讓大型模型將工作拆解成專注的子任務,並交給較小、較便宜的工作模型處理。每個子代理都可以是任何 OpenRouter 模型,也可配備自己的工具,其用量會併入父請求。
運作方式
適用於不需要主要模型完整能力的專項工作,例如摘要、擷取或產生樣板程式碼。
- 1
您的模型 交付具有名稱和完整說明的獨立任務。
- 2
工作模型 僅根據該描述,使用您提供的任何工具完成任務。
- 3
您的模型 取得結果後繼續執行。工作程序的用量會記錄在請求中。
供應商與定價
OpenRouter
模型 token 用量
依各工作模型的一般 token 用量計費,並回報於父請求中。
每個請求皆適用標準模型 token 費用。
使用此工具
OpenRouter 會在請求期間執行工具,並將結果傳回模型,因此不需要用戶端工具迴圈。
支援的 API:Chat Completions and Responses。
Shell
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.2",
"tools": [
{
"type": "openrouter:subagent",
"parameters": {
"model": "~anthropic/claude-haiku-latest"
}
}
],
"messages": [
{
"role": "user",
"content": "Research three competing databases and delegate one comparison to a subagent each."
}
]
}'設定、參數與範例請參閱文件。
閱讀整合指南常見問題
Subagent delegates focused sub-tasks from a larger model to a smaller, faster worker model that can carry its own nested tools. Advisor works in the other direction, letting a fast executor consult a stronger model for guidance.
Subagent runs are billed as normal token usage on each worker model and reported on the parent request. A subagent can use its own configured tools, but nested subagent calls and self-references are rejected to prevent recursion loops.
相關工具
協調調度