Live on Base & Solana · zero protocol fees

Agents that pay their own way.

x402Swarms is a network of autonomous AI agents that discover, purchase, and consume paid APIs over the x402 protocol — settling micropayments in USDC per request. No API keys. No accounts. No human in the loop.

Read the docs → See how it works

Built on the open HTTP 402 standard from Coinbase & Cloudflare's x402 Foundation.

swarm@x402 — agent-runtime
1M+
x402 txns settled
$0.0001
avg cost / call
<2s
settlement time
0%
protocol fee
The handshake

One request. One payment. One response.

Every agent in the swarm runs the same four-step loop against any x402-enabled endpoint. The server names a price, the agent signs USDC, the facilitator settles on-chain, the data comes back.

STEP 01
🔍

Discover

Agents query the Bazaar discovery layer to find endpoints that match the task — price, network, and schema included.

STEP 02

Get 402

The resource server replies 402 Payment Required with payment instructions in the header. No account needed.

STEP 03
✍️

Sign & pay

The agent signs a USDC payment payload from its own wallet and retries the request with proof attached.

STEP 04
📦

Consume

Facilitator settles on-chain in <2s. Server returns 200 OK with the data. The swarm chains the next call.

The network

Not one agent. A coordinated swarm.

A single agent can buy an API call. A swarm divides a goal across dozens of agents, each funding its own slice of the work and reporting back to the hive.

Autonomous wallets

Self-funding agents

Every agent carries its own wallet with policy-based spending limits. It pays per request and never needs you to approve a checkout. Caps, allowlists, and kill-switches keep it inside the lines.

Discovery

Bazaar-aware routing

Swarms read the x402 discovery extension to find the cheapest endpoint that satisfies the schema. If one provider is down or overpriced, the swarm routes around it.

Coordination

Hive task-splitting

A planner decomposes a goal into sub-tasks, spawns worker agents, and merges results. Each worker is disposable; the hive memory persists.

Multi-chain

Base & Solana native

Settle on Base via EIP-3009 or Solana via SPL — same client, same loop. Pick the chain by fee, finality, or where the provider lives.

Auditability

Full payment trail

Every micropayment is an on-chain receipt. The swarm exposes a live ledger so you can see exactly what each agent bought, when, and for how much.

Framework-agnostic

Plug into anything

Wrap agents from LangChain, CrewAI, or your own runtime. If it speaks HTTP, it can join the swarm and start transacting.

The coordination token

$x402SWARMS — fuel for the hive.

USDC pays the APIs. $x402SWARMS coordinates the network: staking for priority routing, governance over the Bazaar registry, and rewards for agents that provide reliable services.

$x402SWARMS

x402Swarms coordination token
NetworkSolana (SPL)
Total supply1,000,000,000
Settlement assetUSDC
Tax0 / 0
LPBurned
CA Evn2rdh7qgAX6kM4bnTfHThrBG6PfHHKPoydidcrswrm

Hold to participate.

  • Priority routing — staked swarms get first pick of high-demand endpoints during congestion.
  • Registry governance — vote on which providers enter the curated Bazaar registry.
  • Provider rewards — endpoints rated reliable by the swarm earn $x402SWARMS emissions.
  • Compute credits — burn $x402SWARMS for discounted facilitator throughput.
Documentation

Spawn your first swarm.

Everything you need to install the runtime, fund an agent wallet, and run a swarm against live x402 endpoints.

# Introduction

x402Swarms is a runtime for spawning networks of autonomous agents that transact over the x402 protocol. Each agent can independently discover paid APIs, settle USDC micropayments per request, and consume the response — all without human-managed accounts or API keys.

The protocol is built on the long-reserved HTTP 402 Payment Required status code. When an agent hits a paid endpoint, the server returns a 402 with payment terms; the agent signs a payment and retries. The whole loop settles on-chain in under two seconds.

Heads up: x402Swarms is an independent runtime built on top of the open x402 standard. It is not affiliated with or endorsed by Coinbase, Cloudflare, or the x402 Foundation.

# Installation

The runtime ships as a TypeScript package. Install x402swarms alongside the x402 SDK packages for the chains you want to settle on.

bash
# core runtime + x402 packages
npm install x402swarms @x402/core @x402/fetch

# add the chains you'll settle on
npm install @x402/evm   # Base, Arbitrum, Polygon
npm install @x402/svm   # Solana
Pre-release: the x402swarms package is shipping soon. The @x402/* packages are part of the live x402 SDK and available today.

# Quickstart

Spin up a single agent, give it a funded wallet, and let it buy a weather data call. The agent handles the 402 handshake automatically.

typescript
import { Agent } from "x402swarms";

const agent = new Agent({
  wallet: process.env.AGENT_PRIVATE_KEY,
  network: "base",
  limits: { perCall: "0.05", daily: "5.00" } // USDC
});

// agent hits a paid endpoint — 402 handled automatically
const data = await agent.fetch("https://api.example.com/weather?");

console.log(data.json());
console.log(agent.receipts()); // on-chain payment trail
Fund the agent wallet with a small amount of USDC on your chosen network before running. Start on testnet (base-sepolia) while you experiment.

# The Agent

An Agent is the atomic unit: one wallet, one set of spending limits, one HTTP client that understands x402. It exposes a fetch() drop-in that transparently pays for any 402 response within its limits.

  • agent.fetch(url, opts) — request a resource; auto-pays on 402.
  • agent.receipts() — returns the on-chain payment ledger.
  • agent.balance() — current USDC balance of the agent wallet.

# The Swarm

A Swarm coordinates many agents toward one goal. A planner splits the task, spawns workers, and merges their results. Workers are ephemeral; the swarm's shared memory persists across the run.

typescript
import { Swarm } from "x402swarms";

const swarm = new Swarm({
  size: 8,                      // number of worker agents
  network: "solana",
  budget: "25.00",              // total USDC cap for the run
  discovery: "bazaar"           // auto-find cheapest endpoints
});

const result = await swarm.run({
  goal: "Compile a market report on SOL memecoins launched today"
});

console.log(result.summary);
console.log(swarm.spent()); // total USDC spent across all agents

# Wallets & limits

Spending controls are enforced before any payment is signed. An agent that hits a cap stops and reports rather than overspending. This is the guardrail that makes autonomy safe.

LimitDescription
perCallMax USDC the agent will pay for a single request. Requests priced above this are skipped.
dailyRolling 24-hour spend ceiling per agent.
budgetHard total cap for an entire swarm run. The swarm halts when reached.
allowlistOptional list of provider domains the agent is permitted to pay.

# Configuration

Configure the runtime via the constructor or a swarm.config.json file at your project root.

KeyTypeDefault
networkstring"base"
facilitatorstring (url)CDP public facilitator
discovery"bazaar" | "manual""bazaar"
sizenumber4
budgetstring (USDC)required

# FAQ

Do agents need an API key for each provider?

No. That's the entire point of x402 — payment is the authentication. An agent pays per request and gets the resource, with no account or key.

What stops an agent from draining its wallet?

Hard spending limits (perCall, daily, budget) are enforced in the runtime before any payment is signed. Fund the wallet with only what you're willing to spend.

Which chains are supported?

Anywhere x402 settles — currently Base, Solana, Arbitrum, Polygon, and Ethereum. Base and Solana are the most common thanks to low fees and fast finality.

Is this affiliated with Coinbase?

No. x402Swarms is an independent project built on the open x402 standard.

SWARM

Let the swarm go shopping.

Give your agents a wallet and a goal. They'll find the data, pay for it, and bring it back — while you sleep.