v46

latestOpenAPI 3.1.0raw.githubusercontent.com2025-11-25213680.0 KB

Run Swarm

Run a swarm with the specified task. Supports streaming when stream=True.

post/v1/swarm/completions

Headers

x-api-keystring required

Request body

namestring nullable

The name of the swarm, which serves as an identifier for the group of agents and their collective task.

descriptionstring nullable

A comprehensive description of the swarm's objectives, capabilities, and intended outcomes.

max_loopsinteger nullable

The maximum number of execution loops allowed for the swarm, enabling repeated processing if needed.

swarm_type'AgentRearrange' | 'MixtureOfAgents' | 'SequentialWorkflow' | 'ConcurrentWorkflow' | 'GroupChat' | 'MultiAgentRouter' | 'AutoSwarmBuilder' | 'HiearchicalSwarm' | 'auto' | 'MajorityVoting' | 'MALT' | 'DeepResearchSwarm' | 'CouncilAsAJudge' | 'InteractiveGroupChat' | 'HeavySwarm' nullable

The classification of the swarm, indicating its operational style and methodology.

rearrange_flowstring nullable

Instructions on how to rearrange the flow of tasks among agents, if applicable.

taskstring nullable

The specific task or objective that the swarm is designed to accomplish.

imgstring nullable

An optional image URL that may be associated with the swarm's task or representation.

rulesstring nullable

Guidelines or constraints that govern the behavior and interactions of the agents within the swarm.

tasksstring[] nullable

A list of tasks that the swarm should complete.

streamboolean nullable

A flag indicating whether the swarm should stream its output.

service_tierstring nullable

The service tier to use for processing. Options: 'standard' (default) or 'flex' for lower cost but slower processing.

heavy_swarm_loops_per_agentinteger nullable

The number of loops to run per agent in the heavy swarm.

heavy_swarm_question_agent_model_namestring nullable

The model name to use for the question agent in the heavy swarm.

heavy_swarm_worker_model_namestring nullable

The model name to use for the worker agent in the heavy swarm.

Response

Successful Response

job_idstring nullable required

The unique identifier for the swarm completion.

statusstring nullable required

The status of the swarm completion.

swarm_namestring nullable required

The name of the swarm.

descriptionstring nullable required

The description of the swarm.

swarm_typestring nullable required

The type of the swarm.

{"stackTrail":"components:schemas:SwarmCompletion:properties:output:anyOf","oasType":"schema","type":"unknown","title":"Output","description":"The output of the swarm.","nullable":true}
number_of_agentsinteger nullable required

The number of agents in the swarm.

service_tierstring nullable required

The service tier of the swarm.

execution_timenumber nullable required

The execution time of the swarm.

usageobject nullable required

The usage of the swarm.