API documentation
Full guides and endpoint reference at docs.swarms.ai
Get an API key
Create a key on the Swarms platform
Base URL
The official production URL is:/v1, such as https://api.swarms.world/v1/agent/completions. The full API documentation is at docs.swarms.ai.
Authentication
Create a key on the API keys page and send it in thex-api-key header. Authorization: Bearer <key> also works.
Run an agent
POST /v1/agent/completions runs one agent on a task.
job_id, success, name, outputs, usage and timestamp.
Common agent_config fields
Common agent_config fields
Run a swarm
POST /v1/swarm/completions runs several agents together. Set swarm_type to choose how they coordinate:
job_id, status, swarm_name, swarm_type, output, number_of_agents, execution_time and usage.
Swarm types
GET /v1/swarms/available returns the current list with descriptions.
Use OpenAI-compatible clients
POST /v1/chat/completions accepts the standard OpenAI request and returns the standard OpenAI response, streaming included. Point any OpenAI SDK at the Swarms API:
max_loops (1 to 50), for multi-step agent reasoning. POST /v1/messages is Anthropic-compatible and POST /v1/responses is compatible with the OpenAI Responses API.
Endpoints
For request and response schemas, guides and examples for every endpoint, see the Swarms API documentation.