Getting started
Quickstart
From no account to a model answer and a finished swarm in about five minutes.
- 1
Create an API key
Sign in and open Models → API keys. Name the key and copy it: it is shown once. Keys start with
sk-. - 2
Add credits
Both APIs draw on your workspace's prepaid credits. Add some under Billing. A request that your balance can't cover is refused with a
402before anything is spent. - 3
Save the key in your shell
Terminalexport API_KEY="sk-..."
Call a model
The Model API speaks the OpenAI Chat Completions format, so any OpenAI client works with a different base URL.
curl https://swarmcomputers.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"max_tokens": 2000,
"messages": [{"role": "user", "content": "Explain SSRF in two sentences."}]
}'from openai import OpenAI
import os
client = OpenAI(base_url="https://swarmcomputers.com/v1", api_key=os.environ["API_KEY"])
reply = client.chat.completions.create(
model="deepseek-v4.1-flash",
max_tokens=2000,
messages=[{"role": "user", "content": "Explain SSRF in two sentences."}],
)
print(reply.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://swarmcomputers.com/v1", apiKey: process.env.API_KEY });
const reply = await client.chat.completions.create({
model: "deepseek-v4.1-flash",
max_tokens: 2000,
messages: [{ role: "user", content: "Explain SSRF in two sentences." }],
});
console.log(reply.choices[0].message.content);Start a swarm
Send a task, a size and a budget. The swarm plans the work, starts agents and stops on its own when it is done or the budget is used. You are never billed above budget_usd.
curl https://swarmcomputers.com/v1/swarms \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"task": "Compare the five most popular open-source vector databases: licence, hosting options, pricing, and one paragraph on when to pick each.",
"size": "small",
"budget_usd": 5
}'import os, time, requests
base = "https://swarmcomputers.com/v1"
headers = {"Authorization": f"Bearer {os.environ['API_KEY']}"}
swarm = requests.post(f"{base}/swarms", headers=headers, json={
"task": "Compare the five most popular open-source vector databases: licence, "
"hosting options, pricing, and one paragraph on when to pick each.",
"size": "small",
"budget_usd": 5,
}).json()
while swarm["status"] in ("planning", "running", "wrapping_up"):
time.sleep(20)
swarm = requests.get(f"{base}/swarms/{swarm['id']}", headers=headers).json()
print(swarm["status"], swarm["spent_usd"])
print(swarm["result"])const base = "https://swarmcomputers.com/v1";
const headers = { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" };
let swarm = await fetch(`${base}/swarms`, {
method: "POST",
headers,
body: JSON.stringify({
task: "Compare the five most popular open-source vector databases: licence, hosting options, pricing, and one paragraph on when to pick each.",
size: "small",
budget_usd: 5,
}),
}).then((r) => r.json());
while (["planning", "running", "wrapping_up"].includes(swarm.status)) {
await new Promise((r) => setTimeout(r, 20_000));
swarm = await fetch(`${base}/swarms/${swarm.id}`, { headers }).then((r) => r.json());
}
console.log(swarm.status, swarm.spent_usd, swarm.result);The response comes back at once with status: "planning". A small swarm usually finishes in 10–20 min. To watch it live instead of polling, stream its events. To see the plan and estimate before anything runs, send "plan_only": true.
Agents start offline
allow_domains, or ask us to switch on open-web browsing for your account. See what agents can reach.