Payment execution
- Returns HTTP 402 payment requirements
- Defines price, network, asset, and recipient
- Lets wallets or agents sign the payment
- Verifies and settles the paid request
Built on x402. Base-first. Rail-agnostic.
PayAI adds budgets, approvals, and receipts to x402 payments, so autonomous agents can pay for APIs, data, compute, and tools without receiving a blank check.
agent requests paid API
API returns 402 Payment Required
PayAI checks grant:
budget: 10 USDC
per_payment_limit: 0.25 USDC
allowed_purpose: research
decision: allow
rail: x402 on Base USDC
receipt: recorded
x402 answers how agents pay.
PayAI answers whether agents should pay.
Receipts explain why they paid.
Relationship to x402
x402 is the payment execution layer. PayAI sits before and after the payment: policy before the signature, receipt after settlement.
Core primitives
PayAI models the controls a real team needs before allowing autonomous software to spend money.
Define who can spend, how much, where, for what purpose, and until when.
Evaluate every x402 payment request against budget, merchant, risk, and task context.
Escalate unfamiliar merchants, large payments, or sensitive categories to a human.
Record amount, asset, network, tx hash, resource hash, task id, and agent rationale.
Developer experience
import { createPayAI } from "@payai-sh/x402";
const payai = createPayAI({
agentId: "research-agent",
network: "base",
currency: "USDC",
grant: "./grant.json",
});
const response = await payai.fetch(
"https://data.example.com/report",
{ purpose: "research" }
);
The first adapter targets x402 payments on Base with USDC. The protocol stays rail-agnostic so teams can add Solana, Polygon, Stripe, or internal balance rails later.
Where it starts
Early access
We are building the open-source policy and receipt layer for x402 payments. Join the first group of builders testing agent budgets, approvals, and audit logs.