Swarms

Execute Swarm Completion

Execute a swarm completion with the specified task. Supports both standard and streaming responses.

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. At most 50.

swarm_type'AgentRearrange' | 'MixtureOfAgents' | 'SequentialWorkflow' | 'ConcurrentWorkflow' | 'GroupChat' | 'MultiAgentRouter' | 'HierarchicalSwarm' | 'MajorityVoting' | 'CouncilAsAJudge' | 'HeavySwarm' | 'LLMCouncil' | 'DebateWithJudge' | 'RoundRobin' | 'PlannerWorkerSwarm' 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.

tasksstring[] nullable

A list of tasks that the swarm should complete.

streamboolean nullable

A flag indicating whether the swarm should stream its output.

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.

heavy_swarm_variant'default' | 'medium' | 'heavy' nullable

For HeavySwarm: which agent variant to run. One of 'default', 'medium', or 'heavy'.

council_judge_model_namestring nullable

For CouncilAsAJudge: the model name used by the judge that delivers the final ruling.

chairman_modelstring nullable

For LLMCouncil: the model name used by the chairman that synthesizes the council's responses.

multi_agent_collab_promptboolean nullable

Inject the multi-agent collaboration prompt so agents coordinate with one another. Set False to disable.

heavy_swarm_max_loopsinteger nullable

For HeavySwarm: the maximum number of loops each agent in the heavy swarm may run.

list_all_agentsboolean nullable

Whether to list all agents and their descriptions to one another so each agent is aware of the others.

director_model_namestring nullable

The model name to use for the director/overseer agent (if any). For HierarchicalSwarm, this is the model name of the director.

director_settingsobject nullable

Optional settings or hyperparameters for the director agent. For HierarchicalSwarm, this is the settings of the director. You can set temperature, top_p, max_tokens, etc.

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.

execution_timenumber nullable required

The execution time of the swarm.

usageobject nullable required

The usage of the swarm.

tasksstring[] nullable

The batch of tasks the request carried, echoed back so a caller can match results to what it sent. Absent for a single-task run.

Changes

Changed in 12 of the 80 revisions of this API.8454

    • ○

      the request property default value changed from gpt-4.1 to gpt-5.4

      request-property-default-value-changed

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ▲

      removed the enum value BatchedGridWorkflow of the request property /

      request-property-enum-value-removed

    • ▲

      removed the enum value auto of the request property /

      request-property-enum-value-removed

    • ○

      added the new None enum value to the request property ////

      request-property-enum-value-added

  • 0882a16375db14See the full diff
    • ▲

      removed from the /// request property anyOf list

      request-property-any-of-removed

    • ○

      added the new optional request property ///

      new-optional-request-property

    • ○

      added subschema #3 to the /// request property anyOf list

      request-property-any-of-added

    • ○

      added subschema #1 to the /// request property anyOf list

      request-property-any-of-added

    • ○

      added subschema #2 to the /// request property anyOf list

      request-property-any-of-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • ▲

      the / request property's max was decreased to 50.00

      request-property-max-decreased

    • ●

      the / request property's max was set to 100.00

      request-property-max-set

  • dd6e1de072c711See the full diff
    • ●

      the //// request property's min was set to 1.00

      request-property-min-set

    • ○

      the request property default value medium was removed

      request-property-default-value-removed

    • ○

      added the new optional request property ///

      new-optional-request-property

    • ○

      added the new optional request property ///

      new-optional-request-property

    • ○

      added the new optional request property ///

      new-optional-request-property

    • ○

      the request property default value changed from true to false

      request-property-default-value-changed

    • ○

      the request property default value changed from gpt-4.1 to claude-sonnet-5

      request-property-default-value-changed

  • 90f1182a9c4d126See the full diff
    • ▲

      removed the enum value AutoSwarmBuilder of the request property /

      request-property-enum-value-removed

    • ○

      added the new optional request property /////

      new-optional-request-property

    • ○

      added the new optional request property /////

      new-optional-request-property

    • ○

      added the new optional request property /////

      new-optional-request-property

    • ○

      added the new optional request property /////

      new-optional-request-property

    • ○

      added the new optional request property /////

      new-optional-request-property

    • ○

      added the new optional request property /////

      new-optional-request-property

    • ○

      added the new optional request property /////

      new-optional-request-property

    • ○

      added the new optional request property /////

      new-optional-request-property

    • ○

      added the new optional request property /////

      new-optional-request-property

    • ○

      added the new optional request property /////

      new-optional-request-property

    • ○

      added the new optional request property /////

      new-optional-request-property

    • ○

      added the new optional request property ///////

      new-optional-request-property

    • ○

      added the new optional request property ///////

      new-optional-request-property

    • ○

      added the new optional request property ///////

      new-optional-request-property

    • ○

      added the new optional request property ///////

      new-optional-request-property

    • ○

      added the new optional request property ///////

      new-optional-request-property

    • ○

      added the new optional request property ///////

      new-optional-request-property

    • ○

      added the new optional request property ///////

      new-optional-request-property

    • ○

      added the new optional request property ///////

      new-optional-request-property

    • ○

      added the new optional request property ///////

      new-optional-request-property

    • ○

      added the new optional request property ///////

      new-optional-request-property

    • ○

      added the new optional request property ///////

      new-optional-request-property

    • ○

      the request property default value changed from 10 to 30

      request-property-default-value-changed

    • ○

      the request property default value changed from 10 to 30

      request-property-default-value-changed

    • ○

      added the new minimal enum value to the request property ////

      request-property-enum-value-added

    • ○

      added the new none enum value to the request property ////

      request-property-enum-value-added