Create task (stream/json)
Create a new task or continue an existing one. Returns SSE by default, or JSON acknowledgement when requested.
Response Modes:
- default (
response_formatomitted): streaming SSE response (text/event-stream) response_format=json: synchronous acknowledgement (202+ task id/status JSON)- if
response_formatis omitted andAccept: application/jsonis sent, JSON acknowledgement is returned.
Mode Options:
agent(default): Full agent mode with all tools, execution capabilities, and memorychat: Conversational mode with limited tools (web search, knowledge search)
Direct Agent Execution:
- Use
agent_idto bypass AgentSwarm and route to a specific agent
Secrets (Opt-In):
- Use
secretsto pass only selected secret names into task runtime - If omitted, no user/project secrets are exposed by default
Authorizations
JWT authentication token
Body
Bypass AgentSwarm and route to specific agent
Array of agent IDs for multi-agent orchestration
Enable the ask_question tool for the planner with durable DB-backed suspension. When false (default), the tool and its prompt sections are removed entirely so the planner must proceed without asking the user clarifying questions.
When mode=plan, auto-execute the plan without waiting for user approval
Optional. When set, controls how task results are handed off on completion. webhook — POST the completion artifact to the team webhook URL when configured. artifact — persist the completion artifact for GET /api/v1/tasks/{id}/artifacts. When omitted, no completion handoff runs.
webhook, artifact Optional file references
Optional task ID. If omitted or invalid, server generates one.
Run task in an ephemeral sandbox with no prior user context
Max execution-verification loop iterations. When omitted, defaults to 0 for agent mode (no verification) and 1 for plan mode (single execute + verify cycle). 0 = explicitly skip verification. 1+ = run that many execute+verify cycles.
0 <= x <= 5Max LLM steps for execution mode only. Does not affect plan or verification phases. Defaults to 45 (direct) or 60 (swarm).
4 <= x <= 200agent = full tools, chat = limited tools, plan = info-gathering + strategic planning
agent, chat, plan Optional model. If omitted/empty, server resolves default via user/team/tag policy.
auto, opus-4.8, opus-4.7, opus-4.6, sonnet-4.6, haiku-4.5, gpt-5.5-high, gpt-5.4-xhigh, gpt-5.4-high, gpt-5.3-codex-high, gemini-3-pro, gemini-3-flash, grok-4.3-high, grok-4.3-fast, kimi-k2.6, glm-5, glm-5.1, deepseek-v4-pro-high Project ID to scope task to. If omitted, task is user-scoped.
Optional response mode.
- sse: stream response events
- json: immediate acknowledgement with task id/status When omitted, server falls back to Accept header and defaults to sse.
sse, json Optional sandbox to run this task on. Use the id returned by GET /api/v1/sandboxes. When omitted, your default sandbox is used.
Optional secret names to expose at runtime (opt-in). Only listed names are resolved and made available to tools. If omitted or empty, no user/project secrets are exposed.
Optional shorthand user input. Used only when message.parts is absent.
Task visibility. Defaults to private when omitted/empty.
public, private, unlisted, team Response
Streaming SSE response
The response is of type string.

