agents/api
Core concepts

Multi-agent orchestration

Understand independent contexts, parallel work, coordination, and when a single agent is enough.

Main agent
Independent subtasks
Subagent results
Combined answer

Independent work can run concurrently

Subagents have their own context and can work in parallel. A main agent assigns scoped tasks and combines their results. Reviewing different documents or investigating independent causes can benefit from this structure.

Enable orchestration

Set agent.multi_agent.enabled to true and choose max_concurrent_subagents. The harness provides tools to create, message, wait for, and interrupt subagents. You do not need to manually declare those orchestration tools.

Example
// Inside the agent configuration
multi_agent: {
  enabled: true,
  max_concurrent_subagents: 2
}

Keep dependent work ordered

A downstream task that requires an upstream result should wait for that result. Multiple agents editing the same files need coordination. Separate context does not imply a separate safe workspace. Give each agent an expected output and clear scope.

Evaluate the tradeoff

More agents can increase token consumption and coordination overhead. Compare total usage, completion time, and output quality against a single-agent baseline. Use subagents because tasks separate cleanly, not because a larger agent count sounds more capable.

Read the official reference

Check the source for current API fields, account requirements, and service limits.

OpenAI: multi-agent