Developer API · v1

One call.
The whole swarm.

Send one question and get answers from GPT, Claude, Gemini, Grok, DeepSeek and more in a single JSON response. Add "mode": "consensus" and one model chairs the swarm: a merged verdict, an agreement score and every disagreement.

Authentication

Send your API key as a bearer token. Keys start with qr_live_, belong to your wallet and draw from its credit balance. Keep them secret – never put them in frontend code.

HTTP header
Authorization: Bearer qr_live_...

Credits & pricing

Every successful answer costs credits – 1 per standard answer, 5 per premium answer. Failed models are free. Credits never expire and are shared with the chat, where they kick in after your daily tier limit.

ModelIDCredits / answerImagesStatus
GPT-6 Astra gpt 5 Live
Claude Opus 5 claude 5 Live
Gemini 3.1 Pro gemini 5 Live
Grok 4.6 grok 5 Live
DeepSeek V4 Pro deepseek 1 – Live
Mistral Medium 3.5 mistral 1 Live
Cohere Command A+ cohere 1 Live
Llama 4 Maverick llama 1 Live
Qwen 3.8 qwen 1 – Live
Kimi K3 kimi 1 Live
GLM-5.3 glm 1 – Live
Perplexity Sonar Pro sonar 1 – Soon
Amazon Nova Premier nova 1 – Soon
MiniMax M3 minimax 1 – Soon
Nemotron 3 Ultra nemotron 1 – Soon
Xiaomi MiMo V2.5 Pro mimo 1 – Soon

POST /v1/ask

Ask up to 4 models at once. They are queried in parallel; the response arrives when all of them have answered.

Request body

questionstring · requiredUp to 8,000 characters.
modelsstring[] · required1–4 model IDs, e.g. ["claude", "gpt", "deepseek"].
modestring · optional"consensus" – adds a merged answer, an agreement score and the disagreements (+1 credit).
webboolean · optionaltrue – search the web first and give every model the same sources (+1 credit when sources are found). Answers cite them as [1], [2].
attachmentsobject[] · optionalUp to 4 files: {"name", "type", "data": "<base64>"}. Images (max 5 MB) go to vision models, PDFs (max 10 MB) and text to every model.
historyobject · optionalPrevious turns per model: {"claude": [{"role": "user", "content": "…"}]}
Request
{
  "question": "Is ETH more likely to flip BTC by 2030?",
  "models": ["deepseek", "mistral", "kimi"],
  "mode": "consensus"
}
Response · 200
{
  "results": {
    "deepseek": { "ok": true, "text": "Unlikely…" },
    "mistral":  { "ok": true, "text": "Low probability…" },
    "kimi":     { "ok": false, "error": "…" }
  },
  "consensus": {
    "agreement": 78, "verdict": "reached",
    "consensus": "Most likely not by 2030…",
    "disagreements": [{ "topic": "…", "positions": [ … ] }],
    "judge": "Grok 4.6"
  },
  "usage": { "credits_charged": 3, "credits_remaining": 497 }
}

GET /v1/models

Lists every model with its ID, price in credits, whether it reads images and whether it is live. No authentication needed.

Terminal
curl https://swarmind.fun/v1/models

GET /v1/credits

Returns the credit balance of the wallet that owns the API key.

Response
{ "credits": 498 }

Consensus mode

With "mode": "consensus", one model chairs the swarm after the answers arrive. It doesn’t average them – it merges what they agree on and names each side of every split. Models that can’t see an attached image are left out of the verdict. For agents: branch on consensus.agreement – proceed above 70, escalate to a human below 40.

reached70–100The models broadly agree. Safe to act on – still not a guarantee.
partial40–69Agreement on some points, real splits on others. Read the disagreements.
split0–39No consensus. The question is genuinely open – or badly posed.

MCP server

Give any MCP-compatible agent (Claude, Cursor, Windsurf, your own) the swarm as a tool. Endpoint: https://swarmind.fun/mcp – Streamable HTTP, authenticated with an API key from your dashboard, paid with the same credits.

Tools

ask_swarmAsk 1–4 models (default: three strong, affordable ones). Returns the verdict, agreement score, disagreements and every answer. Options: models, consensus (default on), web.
list_modelsModel IDs, credit price per answer and image support.
get_creditsCredits left on the key’s wallet.
Claude Code
claude mcp add --transport http swarm https://swarmind.fun/mcp \
  --header "Authorization: Bearer $API_KEY"
Cursor · mcp.json
{
  "mcpServers": {
    "swarm": {
      "url": "https://swarmind.fun/mcp",
      "headers": { "Authorization": "Bearer qr_live_…" }
    }
  }
}

Pay per call x402

Agents can pay for a single question without an account or an API key, using the HTTP 402 flow. Call /v1/ask without a key and you get 402 Payment Required with the price in USDC, the receiving address and the network.

Send the USDC on Solana, then repeat the same request with an X-PAYMENT header: base64 JSON with either the transaction signature or a fully signed transaction for us to broadcast. We verify the transfer on-chain – token, receiver, amount, age – and answer. Each payment works once.

Price: 0.01 USDC per credit. If a model fails or you overpay, the unused part is credited to the paying wallet as credits you can use later. Pay per call switches on at launch.

1 · 402 Payment Required
{
  "x402Version": 1,
  "accepts": [{
    "scheme": "exact", "network": "solana",
    "maxAmountRequired": "80000",
    "asset": "EPjF…Dt1v",  // USDC
    "payTo": "<treasury>",
    "extra": { "decimals": 6, "credits": 8 }
  }]
}
2 · Retry with payment
X-PAYMENT: base64({
  "x402Version": 1, "scheme": "exact", "network": "solana",
  "payload": { "signature": "5xQv…" }
})

→ 200 OK + X-PAYMENT-RESPONSE
  "payment": { "paid_usdc": 0.08, "credits_used": 7,
               "credits_refunded_to_wallet": 1 }

Errors & limits

Errors return JSON with a type and a message. Each key allows 60 requests per minute.

StatusTypeMeaning
400invalid_request_errorMissing question, too many models or no available model.
401authentication_errorMissing, invalid or revoked API key.
402insufficient_creditsNot enough credits – burn tokens in your dashboard.
429rate_limit_errorMore than 60 requests per minute on one key.
Error
{ "error": { "type": "insufficient_credits", "message": "…" } }

Code examples

Pick your language. Every example asks three models and reads the verdict.

Terminal
curl https://swarmind.fun/v1/ask \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"question": "Fact-check: the Bitcoin halving happens every 4 years.", "models": ["deepseek", "mistral", "kimi"], "mode": "consensus"}'

Roadmap

LiveTelegram botBuilt on this API – ask Swarmind from any chat.
LiveMCP serverUse Swarmind as a tool inside Claude, Cursor and other agents.
LivePay per call (x402)Agents pay per request in USDC on Solana – no API key needed.