Skip to main content

Overview

The Auto Agent Builder generates agent configurations from a task. You describe what you want accomplished; a single builder agent designs the smallest team that covers it and returns each agent’s name, description, system prompt, and model choice as ready-to-use AgentSpec entries. Two things to know up front:
  • It designs, it does not run. The response contains agent configurations only — no agents are constructed or executed, and nothing beyond the single builder call is billed. Pipe the returned roster into /v1/swarm/completions (or any multi-agent endpoint) to actually run it.
  • Available on all tiers. Unlike its siblings Graph Workflow and Batched Grid Workflow, this endpoint is not premium-gated. It is billable, so your account needs a minimum credit balance of $1.00.
Endpoint: POST /v1/auto-agent-builder/completions Base URL: https://api.swarms.world (production) or your custom deployment URL

Authentication

All requests require an API key passed in the x-api-key header:

Input Parameters

AutoAgentBuilderInput Schema

Output Parameters

AutoAgentBuilderOutput Schema

Generated agent entries

Each entry in agents is an AgentSpec, but the builder populates only these fields — do not expect the full AgentSpec surface (e.g. max_tokens, tools_list_dictionary) unless you supplied it via agent_kwargs:

Usage Schema

Cost Calculation

The endpoint bills one builder-agent call:
  • Input tokens: $6.50 per 1M tokens
  • Output tokens: $18.50 per 1M tokens
  • Flat builder-agent fee: $0.01
token_cost = input_cost + output_cost + cost_per_agent. The generated agents cost nothing until you run them. See Pricing for current rates.

Error Responses

Examples

Minimal request

Example response:

Exact roster size with shared agent settings

Build a team, then run it

The returned roster round-trips unmodified into the swarm endpoint:

Best Practices

  • Let the builder decide the size. max_agents is a ceiling, not a target — the builder prefers the smallest team that covers the task. Reach for num_agents only when you need an exact count.
  • Use agent_kwargs for runtime settings. Fields like max_loops, max_tokens, or streaming_on applied via agent_kwargs land on every generated agent; the builder’s own choices (agent_name, description, system_prompt, model_name) always win over colliding keys.
  • Review before running. The roster is plain JSON — inspect or edit the system prompts and model choices before posting them to a completions endpoint, especially for cost-sensitive workloads.

Rate Limits

Standard tier-based rate limits apply. See Rate Limits.

Support