# Swarms API

> Run AI agents and multi-agent swarms over HTTP. Base URL: https://api.swarms.world. Send your API key as `x-api-key: <key>` or `Authorization: Bearer <key>`.

`api.swarms.world` sends each request to the nearest healthy region. To pin one region, use `us-east-1.api.swarms.world`, `us-west-1.api.swarms.world`, `ap-southeast-1.api.swarms.world` or `eu-central-1.api.swarms.world`. Create an API key at https://swarms.world/platform/api-keys.

## Endpoints

- POST /v1/agent/completions: run one agent on a task
- POST /v1/agent/batch/completions: run several agent tasks concurrently
- POST /v1/swarm/completions: run a multi-agent swarm; GET /v1/swarms/available lists the swarm types
- POST /v1/swarm/batch/completions: run several swarms concurrently
- POST /v1/reasoning-agent/completions: run a reasoning agent
- POST /v1/graph-workflow/completions: run agents as a directed graph
- POST /v1/chat/completions: OpenAI-compatible chat completions
- GET /v1/models: OpenAI-compatible model list
- GET /v1/models/available: models an agent or swarm can use
- GET /v1/models/pricing: price per 1M input and output tokens for one `model_name`
- GET /v1/account/logs: your request history
- GET /v1/usage/costs: current pricing

## Reference

- [OpenAPI spec](https://api.swarms.world/openapi.json): every route with its request and response schema
- [MCP server](https://api.swarms.world/mcp): one tool per /v1 route over Streamable HTTP, same API key
- [Docs index](https://docs.swarms.ai/llms.txt)
- [Full docs](https://docs.swarms.ai/llms-full.txt): every docs page in one file, about 2.8 MB
