Agents Are Losing Real Money Right Now
In November 2024, an AI agent called Freysa was tricked into sending $47,000 in ETH to a stranger with a single prompt injection. In February 2026, Gitcoin's Owockibot leaked its own private keys to a public GitHub repo. The wallet was drained within minutes. Five days of work, $2,100 gone. Our own founder had an agent leak a private key to GitHub during a coding session.
These aren't hypotheticals. Agents are transacting with real money, right now, with zero spending limits, no refund mechanism, and no way to recover funds when things go wrong.
And on the other side: API providers settling $0.10 agent calls through Stripe, losing 30 cents per transaction in fees, waiting 30 days for settlement. On a $0.10 call, that's a 330% fee. The economics are broken for everyone.
Never Overpay Again
Your agent authorizes $10 for an API session. It uses $3.47. You get $6.53 back automatically. No disputes, no support tickets, no waiting. Unused funds always come back to you.
Figure 1: Smart Contract Escrow Flow
Client
Agent or User
Smart Contract
Locks funds in escrow
Merchant
API Provider
Your agent signs once and makes thousands of API calls. No wallet popups, no per-request approvals, no gas fees. When the session ends, the exact unused amount returns to your wallet.
For API providers: the smart contract settles to your wallet the moment you deliver. No chargebacks, no fraud risk, no 30-day settlement windows. Settlement is guaranteed before your server even processes the request.
Contract: 0xA969a17210C80EC60FFEA6b03F4E5624B9Fb92A8
Base Mainnet. Verified on Basescan.
Settlement in Seconds, Not Weeks
If you sell an API today, you wait weeks for Stripe to settle. You eat 2.9% + $0.30 per call. On a $0.10 API call, that's a 330% fee. Here, settlement is instant and costs a fraction of a cent.
authorize
Agent approves a spending limit. No money moves until you deliver.
settle
You deliver the service, the smart contract settles. Instant. No invoicing, no net-30.
session
One approval covers thousands of API calls. No friction on every request.
refund
Service went down? Smart contract refunds the buyer automatically. No disputes.
reclaim
Session expired? Smart contract returns unused funds to the buyer automatically.
swap
Buyer signs with any token. Automatic swap settles to USDC. Always the right currency.
Any Token In, USDC Settled
Your customers hold different tokens. A DeFi agent has WETH. A social agent has DEGEN. You don't want to manage 50 token balances. Price in USDC, and the protocol handles the conversion automatically. The smart contract settles exactly what you priced.
Figure 2: Swap Settlement Flow
Agent
Holds WETH
DEX Route
Aggregator
Merchant
Receives USDC
You integrate once, set your price in USDC, and never think about tokens again. Whether the buyer signs with WETH, DEGEN, or BRETT, the smart contract settles exactly $0.01 in USDC to your wallet. No slippage risk on your side.
Zero currency risk: The conversion rate locks at the moment of signing. Your price is your price. The buyer absorbs the swap, and the smart contract settles the exact dollar amount you quoted.
See It Work
A $5 transaction, start to finish. The buyer signs with WETH. The smart contract settles USDC to the seller. One signature, zero gas, under 3 seconds. No SDK integration, no API keys, no onboarding. Just an HTTP header.
Start Getting Paid
Live on Base mainnet. Add three lines to your Express server and start settling commerce in minutes.
Receive Settlement (API Provider)
import { paymentMiddleware } from '@x402/express';
import { x402ResourceServer, HTTPFacilitatorClient } from '@x402/core/server';
import { EscrowScheme } from '@agentokratia/x402-escrow/server';
const facilitator = new HTTPFacilitatorClient({
url: 'https://facilitator.agentokratia.com',
createAuthHeaders: async () => ({
verify: { Authorization: `Bearer ${process.env.X402_API_KEY}` },
settle: { Authorization: `Bearer ${process.env.X402_API_KEY}` },
}),
});
const escrow = new EscrowScheme({ facilitator });
const accepts = await escrow.buildAccepts({
network: 'eip155:8453',
price: '$0.01',
payTo: '0xYourWallet',
});
app.use(paymentMiddleware(
{ 'GET /api/data': { accepts } },
new x402ResourceServer(facilitator)
));
Pay for APIs (Agent Developer)
import { wrapFetchWithPayment, x402Client } from '@x402/fetch';
import { ExactEvmScheme } from '@x402/evm/exact/client';
import { EscrowScheme } from '@agentokratia/x402-escrow/client';
const client = new x402Client()
.register('eip155:8453', new ExactEvmScheme(signer))
.register('eip155:8453', new EscrowScheme(walletClient));
const paidFetch = wrapFetchWithPayment(fetch, client);
const res = await paidFetch('https://api.example.com/api/data');
// Handles 402 response, signs payment, retries automatically
Want to try this?
The protocol is live on Base. Free to start, no signup required.
@x402/express @x402/fetch@x402/evm @x402/core@agentokratia/x402-escrow
Agents are spending real money right now.
Wallets are getting drained. API providers are losing money on every call.
Sellers deserve instant settlement. Buyers deserve protection.
Both are live on Base today.
What's next
Building with the protocol?
Get integration guides, new features, and early access to Checkout, Wallet, and ID.