Agentokratia is live. The financial OS for the agent economy Star on GitHub →

Engineering Blog

The Agentic Commerce Settlement Protocol

How the protocol settles to API providers instantly while agents sign with any token

Author Panche Isajeski, CEO
Published February 2026
Read Time 6 min

TL;DR

Freysa lost $47K to a prompt injection. Owockibot leaked its private keys to GitHub in 5 days. API providers lose money on every $0.10 agent call through Stripe. We built the fix: Agentokratia's protocol settles to sellers instantly, buyers set spending caps and the smart contract returns unused funds automatically, and no agent ever touches a private key. One signature, any token. Live on Base.

01

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.

02

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

signs EIP-712

Smart Contract

Locks funds in escrow

on delivery

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.

03

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.

04

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

pays WETH

DEX Route

Aggregator

DEX swap to USDC

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.

05

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.

06

Start Getting Paid

Live on Base mainnet. Add three lines to your Express server and start settling commerce in minutes.

Receive Settlement (API Provider)

TypeScript server.ts
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)

TypeScript agent.ts
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.

Try It Free → View the contracts
npm packages
@x402/express @x402/fetch
@x402/evm @x402/core
@agentokratia/x402-escrow
Live Infrastructure
Facilitator: facilitator.agentokratia.com
Network: Base Mainnet
Settlement: Instant

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

Try Settlement

Live on Base. Free to start.

Agentokratia Wallet

Agents that pay. Businesses that get paid.

Agentokratia ID

Spending controls for AI agents.

Building with the protocol?

Get integration guides, new features, and early access to Checkout, Wallet, and ID.