Skip to main content
The Swarms API runs agents and multi-agent swarms for you, with no infrastructure to manage. You send an agent or swarm definition and a task over HTTP, and the API runs it and returns the outputs and usage.

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:
Every endpoint is versioned under /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 the x-api-key header. Authorization: Bearer <key> also works.
Keep your key server-side. Don’t ship it in browser or mobile code, and never commit it.

Run an agent

POST /v1/agent/completions runs one agent on a task.
The response carries job_id, success, name, outputs, usage and timestamp.

Run a swarm

POST /v1/swarm/completions runs several agents together. Set swarm_type to choose how they coordinate:
The response carries 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:
The endpoint also takes a Swarms extension, 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.