Built on x402. Base-first. Rail-agnostic.

The payment policy layer for AI agents.

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

We extend x402. We do not replace it.

x402 is the payment execution layer. PayAI sits before and after the payment: policy before the signature, receipt after settlement.

x402

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
PayAI

Policy and receipts

  • Checks budget, merchant, purpose, and limits
  • Routes approvals for sensitive payments
  • Links spend to agent tasks and tool calls
  • Records audit-ready receipts for teams
Agent
PayAI Policy
x402 Payment
PayAI Receipt
Not a wallet Not a facilitator Not a new payment rail

Core primitives

Give agents spend permissions, not unlimited wallets.

PayAI models the controls a real team needs before allowing autonomous software to spend money.

01

Grants

Define who can spend, how much, where, for what purpose, and until when.

02

Policies

Evaluate every x402 payment request against budget, merchant, risk, and task context.

03

Approvals

Escalate unfamiliar merchants, large payments, or sensitive categories to a human.

04

Receipts

Record amount, asset, network, tx hash, resource hash, task id, and agent rationale.

Developer experience

Wrap agent fetch. Enforce policy before payment.

@payai-sh/x402
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" }
);

Base-first, not Base-only.

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.

Package scope
@payai-sh/*
Default rail
x402 on Base USDC
Policy mode
Local JSON grants or hosted dashboard
Receipt mode
Offchain log with optional hash anchoring

Where it starts

A control plane for agentic spend.

Paid APIs MCP servers Data providers Compute jobs Agent marketplaces

Early access

Make x402 safe for autonomous agents.

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.