Spawn an autonomous sub-task agent inline and receive its final answer before the primary model continues.
Not yet available. The Subagent server tool is not yet available.
Subagent lets a model delegate a well-scoped autonomous task — multiple steps, tool use, self-correction — to a secondary agent running entirely on the gateway. The primary model blocks until the subagent finishes, then continues with the result in context. From your application's perspective, it is still one API call.
When the primary model decides to spawn a subagent, it writes a task description. The gateway launches a Subagent running claude-opus-4.8 with web search and fetch available. The subagent runs its own multi-step loop, produces a result, and returns it as a tool response. The primary model then uses that result to write the final recommendation.
| Option | Type | Default | Description |
|---|---|---|---|
model | string | same as request model | Model the subagent runs on |
tools | array | [] | Server tools the subagent may use |
max_steps | integer | 5 | Hard cap on subagent loop iterations |
timeout_ms | integer | 60000 | Wall-clock timeout for the full subagent run |
system | string | — | Optional system prompt override for the subagent |
Internally, the subagent runs a standard while (has_tool_calls) { invoke → inject → generate } loop on the gateway. Each step is subject to your account's rate limits. The primary model never sees intermediate steps — only the final output.
Subagents can themselves use most server tools. They cannot spawn further Subagents (no recursive nesting). The max_steps cap prevents runaway loops.
Every token the subagent generates or consumes is billed at the subagent model's DA rate. The primary model's tokens are billed separately. All subagent steps are grouped under the same X-Request-Id in your usage dashboard for easy attribution.