Guides
Give it to your agent
Your coding agent can use Swarm Computers for you. Copy the prompt below into Claude Code, Cursor, Codex or any agent with a terminal, and give it a key.
- 1
Create a key for the agent
Open Models → API keys and name it after the agent, so you can revoke it on its own.
- 2
Put the key in its environment
Terminalexport API_KEY="sk-..." - 3
Paste the prompt
Into the chat, or into a rules file such as
CLAUDE.md,AGENTS.mdor.cursor/rules, so it is there every session.
Prompt for your agent
You can use Swarm Computers, an API for AI models and agent swarms. Full docs: https://swarmcomputers.com/docs
Base URL: https://swarmcomputers.com/v1
Auth: send "Authorization: Bearer $API_KEY" with every request. Keep the key out of code and logs.
## Model API (OpenAI and Anthropic compatible)
- POST /v1/chat/completions OpenAI Chat Completions format, streaming supported.
- POST /v1/messages Anthropic Messages format (x-api-key header also works).
- GET /v1/models Models and prices.
Models: "deepseek-v4.1-flash" (standard) and "deepseek-v4.1-flash-uncensored" (no refusals, for security work). 1M context, tool calling.
These are reasoning models: give max_tokens room (at least 1000) or the visible answer may be empty.
## Swarm API (a team of agents for one task)
- POST /v1/swarms Body: {"task": "...", "size": "small" | "medium" | "large" | "max", "budget_usd": 10}
Sizes: small up to 5 agents ($10 default budget), medium up to 20 ($50), large up to 50 ($150), max up to 100 (budget_usd required).
Optional: "goal": "what done means, as something countable or measurable" (each round is scored against it in "progress", and the swarm stops when it is met), "plan_only": true (plan and estimate, then wait for POST /v1/swarms/{id}/start), "deadline_minutes", "model", "allow_domains": [verified domains], "web": true (only if enabled for the account).
- GET /v1/swarms/{id} Status, plan, estimate, agents, spend. Poll every 15-30 s, or stream:
- GET /v1/swarms/{id}/events Server-sent events until the swarm stops.
- GET /v1/swarms/{id}/result Merged result (add ?format=markdown for plain Markdown) plus each agent's report and the file list.
- GET /v1/swarms/{id}/files/{path} One file from the run folder.
- GET /v1/swarms/{id}/archive The whole run folder as a ZIP.
- POST /v1/swarms/{id}/board {"text": "..."} sends a note every agent reads.
- POST /v1/swarms/{id}/pause | /resume {"add_budget_usd": 5} | /cancel
Statuses: planning, awaiting_approval, running, wrapping_up, paused, completed, failed, cancelled.
The budget is a hard cap. The whole budget is held from credits when the swarm is created and the unused part is returned. At 80% of the budget a warning event is sent; near the cap agents wrap up and the swarm pauses with a partial result. A paused swarm can be resumed with more budget for 7 days.
## Security scans
POST /v1/swarms with {"preset": "security_scan", "target": "example.com", "size": "small"}. The target must be a hostname the owner verified in the dashboard, or a subdomain they ticked in a verified domain's scope; agents can reach only that hostname. By default the scan is defensive: agents look and report without attacking. Add "mode": "offensive", "authorized": true to let them try to break in; send that only when the owner has told you they own the target, allow the attack and accept the Security Testing Terms at /docs/security-testing-terms. Offensive scans are refused for sites verified by file, on platform names like github.io, or hosted on platforms such as Shopify. You cannot verify domains through the API: ask the owner.
## Errors
Errors come back as JSON with a message. 401: bad key. 402: not enough credits, tell the owner instead of retrying. 429: slow down and retry. 400: read the message and fix the request.
When I ask for something big (research across many sources, many files, a site audit), start a swarm with "plan_only": true, show me the plan and the estimate, and start it once I agree. Report the result and what it cost.Or point it at the docs
The same text is served as plain text at /llms.txt, so an agent that can fetch pages only needs this line:
Prompt
Read https://swarmcomputers.com/llms.txt and use that API for big research and multi-step jobs. My key is in $API_KEY.Good things to ask for
- “Use a swarm to research the twenty biggest competitors and give me a comparison table. Keep it under $15.”
- “Plan a swarm to migrate every test in this repo to Vitest. Show me the plan and estimate first.”
- “Run a security scan of staging.example.com with a $10 budget and summarise what is confirmed.”
- “Use deepseek-v4.1-flash-uncensored to write the exploit for this finding, then the fix.”
It will ask before spending big
The prompt tells your agent to plan big jobs first and show you the estimate. Every swarm is capped at its budget either way.