Enable autonomous AI agents to pay for services using USDC on BNB. One line of code for sellers, seamless payments for buyers.
Get started with Oliviax402
Single middleware line. Your API routes stay clean—no payment code, no accounts, no subscriptions.
Built on BNB and Base. Near-zero fees, sub-second verification, instant USDC settlement.
Built by Coinbase. Backed by Google, AWS, Cloudflare, and Visa. Chain-agnostic protocol.
Three steps to enable AI agent payments
// server.ts
import express from "express";
import { paymentMiddleware }
from "x402-express";
const app = express();
app.use(
paymentMiddleware(
process.env.WALLET_ADDRESS,
{
"GET /api/weather": {
price: "$0.01",
network: "base-sepolia"
},
"POST /api/analyze": {
price: "$0.05",
network: "base-sepolia"
}
},
{
url: "https://x402.org/facilitator"
}
)
);// /api/weather/route.ts
import { NextResponse }
from 'next/server';
export async function GET(
request: Request
) {
// Payment already verified
// by x402 middleware!
const weatherData =
await fetchWeather();
return NextResponse.json({
temperature: 72,
condition: 'Sunny',
humidity: 45,
paid: true
});
}// eliza-agent/action.ts
import { x402Client }
from '@elizaos/plugin-x402';
const payAction = {
name: "PAY_FOR_SERVICE",
async handler(runtime) {
const result =
await x402Client({
privateKey:
runtime.getSetting(
"WALLET_PRIVATE_KEY"
),
url: 'https://api.example.com
/weather'
});
return result.data;
}
};The first AI agent framework with native x402 support. Olivia/ElizaOS agents can autonomously discover, evaluate, and pay for services across the internet using USDC micropayments.
// character.json
{
"name": "Olivia",
"bio": [
"AI agent that autonomously",
"pays for data and services",
"using x402 protocol"
],
"plugins": [
"@elizaos/plugin-BNB",
"@elizaos/plugin-x402",
"@elizaos/plugin-twitter"
],
"settings": {
"secrets": {
"WALLET_PRIVATE_KEY": "...",
"BNB_RPC_URL": "..."
}
},
"actions": [
"PAY_FOR_SERVICE",
"DISCOVER_SERVICES",
"EVALUATE_PRICING"
]
}x402 enables new business models impossible with traditional payments
Autonomous agents discover and pay for services like API access, data analysis, and compute without human intervention.
Agent requests → 402 Payment Required → Signs with wallet → Service deliveredCharge $0.001 per request for data feeds, AI inference, or premium content. No minimum charges, no monthly fees.
Pay-per-use pricing as low as 0.1¢ per API callPaywall premium articles, videos, or datasets without forcing users to create accounts or subscribe to monthly plans.
One-time payment per article, no tracking, no accountsIoT devices, ML models, and autonomous systems transact directly with each other using trustless, instant payments.
Sub-second settlement, near-zero fees, no intermediaries