{
  "$schema": "https://agentsjson.org/schema.json",
  "version": "0.1.0",
  "info": {
    "title": "SwarmIO",
    "description": "A hosted agent harness: deep research as an API. One POST kicks off a swarm that plans, browses, reads sources, and cross-checks, then returns a cited report; poll or stream for the result. No framework, model, or scraping stack to choose. Self-serve onboarding with no browser and no human — starter credits land automatically on signup, and an agent can buy more itself over the x402 protocol (USDC on Base).",
    "version": "1.0.0",
    "homepage": "https://ioswarm.io"
  },
  "sources": [
    {
      "type": "openapi",
      "url": "https://ioswarm.io/api/v1/openapi.json"
    },
    {
      "type": "llms.txt",
      "url": "https://ioswarm.io/llms.txt"
    }
  ],
  "auth": {
    "type": "bearer",
    "instructions": "No key? Mint one with no human: 1) GET https://ioswarm.io/api/v1/auth/config for the Supabase url + anon key. 2) POST {supabase_url}/auth/v1/signup (header apikey: {anon_key}) with a fresh email/password — email confirmation is off, the access_token works immediately. 3) POST https://ioswarm.io/api/v1/agent/register with that token (stamps your agent id; idempotent). 4) POST https://ioswarm.io/api/v1/account/api-keys {\"name\":\"my-agent\"} — store the returned sk_swarm_ key, it is shown once. 5) Send it as Authorization: Bearer sk_swarm_… on every call. Out of credits? POST https://ioswarm.io/api/v1/x402/topup?usd=5 with your bearer and no payment header; the 402 carries the payment requirements (v1 in the body, v2 in the PAYMENT-REQUIRED header). Sign the EIP-3009 authorization and repeat the request with X-PAYMENT or PAYMENT-SIGNATURE set."
  },
  "flows": [
    {
      "id": "onboard",
      "description": "Zero to authenticated API client, no browser and no human. Starter credits land automatically on the first authenticated call.",
      "actions": [
        {
          "id": "getAuthConfig",
          "description": "Discover the auth backend (public, no credentials)."
        },
        {
          "id": "supabaseSignup",
          "description": "Create the account directly against Supabase Auth ({supabase_url}/auth/v1/signup). Returns an access_token immediately."
        },
        {
          "id": "registerAgent",
          "description": "Stamp the account as an agent (POST /api/v1/agent/register). Idempotent — safe to call on every boot."
        },
        {
          "id": "mintApiKey",
          "description": "Mint a long-lived sk_swarm_ key (POST /api/v1/account/api-keys). Store it — shown once."
        }
      ]
    },
    {
      "id": "research",
      "description": "Ask a question, get a cited report. Optionally route first to pick the right mode.",
      "actions": [
        {
          "id": "routePrompt",
          "description": "POST /api/v1/route — classify a freeform prompt into the right mode. Never charged."
        },
        {
          "id": "launchRun",
          "description": "POST /api/v1/runs with {mode, input}. Returns the run record incl. its id. Billed from your credits."
        },
        {
          "id": "pollRun",
          "description": "GET /api/v1/runs/{id} until status is completed (or stream GET /api/v1/runs/{id}/events as SSE)."
        },
        {
          "id": "getReport",
          "description": "GET /api/v1/runs/{id}/report — the finished, cited report."
        }
      ]
    },
    {
      "id": "topup",
      "description": "Refill credits when the starter grant runs out — machine-payable, no browser.",
      "actions": [
        {
          "id": "getCryptoTerms",
          "description": "GET /api/v1/billing/crypto — receiving address, network (Base), asset (USDC), rate, minimum."
        },
        {
          "id": "sendUsdc",
          "description": "Transfer USDC on Base to the pay_to address from any wallet you control."
        },
        {
          "id": "claimTopup",
          "description": "POST /api/v1/billing/crypto-topup {tx_hash} with your bearer — the transfer is verified on-chain and credits land. Idempotent per tx hash."
        }
      ]
    }
  ]
}
