Swarms AI — Multi-Agent Orchestration
Build production-grade multi-agent systems using the Swarms API platform. Supports single agents, reasoning agents, and swarms of 3–10,000+ agents with 20+ architecture patterns.
Quick Reference
- Base URL:
https://api.swarms.world
- Auth:
x-api-key header with API key from swarms.world/platform/api-keys
- Docs index:
https://docs.swarms.ai/llms.txt
- Python SDK:
pip install swarms-client
- Marketplace: swarms.world
Architecture Tiers
| Tier |
Name |
Agents |
Endpoint |
| 1 |
Individual Agent |
1 |
/v1/agent/completions |
| 2 |
Reasoning Agent |
1-2 internal |
/v1/reasoning-agent/completions |
| 3 |
Multi-Agent Swarm |
3–10,000+ |
/v1/swarm/completions |
Workflow
1. Single Agent
import requests
payload = {
"agent_config": {
"agent_name": "MyAgent",
"description": "Purpose of the agent",
"system_prompt": "You are...",
"model_name": "gpt-4o", # or claude-sonnet-4-20250514, etc.
"role": "worker",
"max_loops": 1,
"max_tokens": 8192,
"temperature": 0.5,
"auto_generate_prompt": False,
"tools_list_dictionary": None
},
"task": "Your task here"
}
response = requests.post(
"https://api.swarms.world/v1/agent/completions",
headers={"x-api-key": API_KEY, "Content-Type": "application/json"},
json=payload
)
2. Multi-Agent Swarm
payload = {
"name": "My Swarm",
"description": "What this swarm does",
"agents": [
{
"agent_name": "Agent1",
"description": "Role 1",
"system_prompt": "You are...",
"model_name": "gpt-4o",
"role": "worker",
"max_loops": 1,
"max_tokens": 8192,
"temperature": 0.5
},
{
"agent_name": "Agent2",
"description": "Role 2",
"system_prompt": "You are...",
"model_name": "claude-sonnet-4-20250514",
"role": "worker",
"max_loops": 1,
"max_tokens": 8192,
"temperature": 0.5
}
],
"max_loops": 1,
"swarm_type": "SequentialWorkflow", # See architecture table
"task": "Your task here"
}
response = requests.post(
"https://api.swarms.world/v1/swarm/completions",
headers={"x-api-key": API_KEY, "Content-Type": "application/json"},
json=payload
)
3. Token Launch (Solana)
payload = {
"name": "My Agent Token",
"description": "Agent description",
"ticker": "MAG",
"private_key": "[1,2,3,...]" # Solana wallet private key
}
response = requests.post(
"https://swarms.world/api/token/launch",
headers={"Authorization": "Bearer API_KEY", "Content-Type": "application/json"},
json=payload
)
# Returns: token_address, pool_address, listing_url
# Cost: ~0.04 SOL
Available Swarm Architectures
Use the swarm_type parameter:
| Type |
Description |
Best For |
SequentialWorkflow |
Linear pipeline, each agent builds on previous |
Step-by-step processing |
ConcurrentWorkflow |
Parallel execution |
Independent tasks, speed |
AgentRearrange |
Dynamic agent reordering |
Adaptive workflows |
MixtureOfAgents |
Specialist agent selection |
Multi-domain tasks |
MultiAgentRouter |
Intelligent task routing |
Large-scale distribution |
HierarchicalSwarm |
Nested hierarchies with delegation |
Complex org structures |
MajorityVoting |
Consensus across agents |
Decision making |
BatchedGridWorkflow |
Grid pattern execution |
Multi-task × multi-agent |
GraphWorkflow |
Directed graph of agent nodes |
Complex dependencies |
GroupChat |
Agent discussion |
Collaborative brainstorming |
InteractiveGroupChat |
Real-time agent interaction |
Dynamic collaboration |
AutoSwarmBuilder |
Auto-generate optimal swarm |
When unsure of architecture |
HeavySwarm |
High-capacity processing |
Large workloads |
DebateWithJudge |
Structured debate |
Adversarial evaluation |
RoundRobin |
Round-robin distribution |
Even load distribution |
MALT |
Multi-agent learning |
Training systems |
CouncilAsAJudge |
Expert panel evaluation |
Quality assessment |
LLMCouncil |
LM council for decisions |
Group decision making |
AdvancedResearch |
Research workflows |
Deep research |
auto |
Auto-select best type |
Default/unknown |
Agent Config Parameters
| Param |
Type |
Default |
Description |
agent_name |
string |
— |
Unique agent identifier |
description |
string |
— |
Agent purpose |
system_prompt |
string |
— |
Behavior instructions |
model_name |
string |
gpt-4.1 |
AI model (gpt-4o, claude-sonnet-4-20250514, etc.) |
role |
string |
worker |
Agent role in swarm |
max_loops |
int/string |
1 |
Iterations ("auto" for autonomous) |
max_tokens |
int |
8192 |
Max response length |
temperature |
float |
0.5 |
Creativity (0.0–2.0) |
auto_generate_prompt |
bool |
false |
Auto-enhance system prompt |
tools_list_dictionary |
list |
— |
OpenAPI-style tool definitions |
streaming_on |
bool |
false |
Enable SSE streaming |
mcp_url |
string |
— |
MCP server URL |
selected_tools |
list |
all safe |
Restrict available tools |
Rules
- Always use environment variables for API keys — never hardcode.
- Set appropriate
max_loops — use "auto" only when sub-agent delegation is needed.
- Match
swarm_type to use case (see architecture table).
- For streaming, set
streaming_on: true and parse SSE events (metadata → chunks → usage → done).
- Token launches cost ~0.04 SOL from the provided wallet.
- Batch endpoint (
/v1/swarm/batch/completions) requires Pro/Ultra/Premium tier.
- Reasoning agents (
/v1/reasoning-agent/completions) require Pro+ tier.
Resource Map
| Topic |
Reference |
| Full API architecture & tiers |
references/architecture.md |
| Sub-agent delegation patterns |
references/sub-agents.md |
| ATP payment protocol (Solana) |
references/atp-protocol.md |
| Marketplace publishing |
references/marketplace.md |
| Streaming implementation |
references/streaming.md |
| Tools integration |
references/tools.md |
| All docs pages |
https://docs.swarms.ai/llms.txt |
Read references only when the task requires that specific depth.
1---
2name: swarms-ai
3description: Build and orchestrate multi-agent AI systems using the Swarms API. Use when creating single agents, multi-agent swarms (sequential, concurrent, hierarchical, mixture-of-agents, majority voting, graph workflows), launching agent tokens on Solana, integrating ATP payment protocol, publishing to Swarms Marketplace, using sub-agent delegation, streaming responses, or building any multi-agent orchestration pipeline. Covers Python, TypeScript, and cURL.
4metadata:
5 source: https://skillmd.com/skills/modbender/swarms-ai
6---
7
8# Swarms AI — Multi-Agent Orchestration
9
10Build production-grade multi-agent systems using the Swarms API platform. Supports single agents, reasoning agents, and swarms of 3–10,000+ agents with 20+ architecture patterns.
11
12## Quick Reference
13
14- **Base URL:** `https://api.swarms.world`
15- **Auth:** `x-api-key` header with API key from [swarms.world/platform/api-keys](https://swarms.world/platform/api-keys)
16- **Docs index:** `https://docs.swarms.ai/llms.txt`
17- **Python SDK:** `pip install swarms-client`
18- **Marketplace:** [swarms.world](https://swarms.world)
19
20## Architecture Tiers
21
22| Tier | Name | Agents | Endpoint |
23|------|------|--------|----------|
24| 1 | Individual Agent | 1 | `/v1/agent/completions` |
25| 2 | Reasoning Agent | 1-2 internal | `/v1/reasoning-agent/completions` |
26| 3 | Multi-Agent Swarm | 3–10,000+ | `/v1/swarm/completions` |
27
28## Workflow
29
30### 1. Single Agent
31
32```python
33import requests
34
35payload = {
36 "agent_config": {
37 "agent_name": "MyAgent",
38 "description": "Purpose of the agent",
39 "system_prompt": "You are...",
40 "model_name": "gpt-4o", # or claude-sonnet-4-20250514, etc.
41 "role": "worker",
42 "max_loops": 1,
43 "max_tokens": 8192,
44 "temperature": 0.5,
45 "auto_generate_prompt": False,
46 "tools_list_dictionary": None
47 },
48 "task": "Your task here"
49}
50
51response = requests.post(
52 "https://api.swarms.world/v1/agent/completions",
53 headers={"x-api-key": API_KEY, "Content-Type": "application/json"},
54 json=payload
55)
56```
57
58### 2. Multi-Agent Swarm
59
60```python
61payload = {
62 "name": "My Swarm",
63 "description": "What this swarm does",
64 "agents": [
65 {
66 "agent_name": "Agent1",
67 "description": "Role 1",
68 "system_prompt": "You are...",
69 "model_name": "gpt-4o",
70 "role": "worker",
71 "max_loops": 1,
72 "max_tokens": 8192,
73 "temperature": 0.5
74 },
75 {
76 "agent_name": "Agent2",
77 "description": "Role 2",
78 "system_prompt": "You are...",
79 "model_name": "claude-sonnet-4-20250514",
80 "role": "worker",
81 "max_loops": 1,
82 "max_tokens": 8192,
83 "temperature": 0.5
84 }
85 ],
86 "max_loops": 1,
87 "swarm_type": "SequentialWorkflow", # See architecture table
88 "task": "Your task here"
89}
90
91response = requests.post(
92 "https://api.swarms.world/v1/swarm/completions",
93 headers={"x-api-key": API_KEY, "Content-Type": "application/json"},
94 json=payload
95)
96```
97
98### 3. Token Launch (Solana)
99
100```python
101payload = {
102 "name": "My Agent Token",
103 "description": "Agent description",
104 "ticker": "MAG",
105 "private_key": "[1,2,3,...]" # Solana wallet private key
106}
107
108response = requests.post(
109 "https://swarms.world/api/token/launch",
110 headers={"Authorization": "Bearer API_KEY", "Content-Type": "application/json"},
111 json=payload
112)
113# Returns: token_address, pool_address, listing_url
114# Cost: ~0.04 SOL
115```
116
117## Available Swarm Architectures
118
119Use the `swarm_type` parameter:
120
121| Type | Description | Best For |
122|------|-------------|----------|
123| `SequentialWorkflow` | Linear pipeline, each agent builds on previous | Step-by-step processing |
124| `ConcurrentWorkflow` | Parallel execution | Independent tasks, speed |
125| `AgentRearrange` | Dynamic agent reordering | Adaptive workflows |
126| `MixtureOfAgents` | Specialist agent selection | Multi-domain tasks |
127| `MultiAgentRouter` | Intelligent task routing | Large-scale distribution |
128| `HierarchicalSwarm` | Nested hierarchies with delegation | Complex org structures |
129| `MajorityVoting` | Consensus across agents | Decision making |
130| `BatchedGridWorkflow` | Grid pattern execution | Multi-task × multi-agent |
131| `GraphWorkflow` | Directed graph of agent nodes | Complex dependencies |
132| `GroupChat` | Agent discussion | Collaborative brainstorming |
133| `InteractiveGroupChat` | Real-time agent interaction | Dynamic collaboration |
134| `AutoSwarmBuilder` | Auto-generate optimal swarm | When unsure of architecture |
135| `HeavySwarm` | High-capacity processing | Large workloads |
136| `DebateWithJudge` | Structured debate | Adversarial evaluation |
137| `RoundRobin` | Round-robin distribution | Even load distribution |
138| `MALT` | Multi-agent learning | Training systems |
139| `CouncilAsAJudge` | Expert panel evaluation | Quality assessment |
140| `LLMCouncil` | LM council for decisions | Group decision making |
141| `AdvancedResearch` | Research workflows | Deep research |
142| `auto` | Auto-select best type | Default/unknown |
143
144## Agent Config Parameters
145
146| Param | Type | Default | Description |
147|-------|------|---------|-------------|
148| `agent_name` | string | — | Unique agent identifier |
149| `description` | string | — | Agent purpose |
150| `system_prompt` | string | — | Behavior instructions |
151| `model_name` | string | `gpt-4.1` | AI model (gpt-4o, claude-sonnet-4-20250514, etc.) |
152| `role` | string | `worker` | Agent role in swarm |
153| `max_loops` | int/string | `1` | Iterations (`"auto"` for autonomous) |
154| `max_tokens` | int | `8192` | Max response length |
155| `temperature` | float | `0.5` | Creativity (0.0–2.0) |
156| `auto_generate_prompt` | bool | `false` | Auto-enhance system prompt |
157| `tools_list_dictionary` | list | — | OpenAPI-style tool definitions |
158| `streaming_on` | bool | `false` | Enable SSE streaming |
159| `mcp_url` | string | — | MCP server URL |
160| `selected_tools` | list | all safe | Restrict available tools |
161
162## Rules
163
164- Always use environment variables for API keys — never hardcode.
165- Set appropriate `max_loops` — use `"auto"` only when sub-agent delegation is needed.
166- Match `swarm_type` to use case (see architecture table).
167- For streaming, set `streaming_on: true` and parse SSE events (metadata → chunks → usage → done).
168- Token launches cost ~0.04 SOL from the provided wallet.
169- Batch endpoint (`/v1/swarm/batch/completions`) requires Pro/Ultra/Premium tier.
170- Reasoning agents (`/v1/reasoning-agent/completions`) require Pro+ tier.
171
172## Resource Map
173
174| Topic | Reference |
175|-------|-----------|
176| Full API architecture & tiers | `references/architecture.md` |
177| Sub-agent delegation patterns | `references/sub-agents.md` |
178| ATP payment protocol (Solana) | `references/atp-protocol.md` |
179| Marketplace publishing | `references/marketplace.md` |
180| Streaming implementation | `references/streaming.md` |
181| Tools integration | `references/tools.md` |
182| All docs pages | https://docs.swarms.ai/llms.txt |
183
184Read references only when the task requires that specific depth.