AgentPay — x402 Payment Infrastructure for AI Agents
AgentPay is the payment infrastructure layer for autonomous AI agents, IoT devices, and machine-to-machine commerce. It implements the x402 Agent Grant System — EIP-712 signed spend policies that let agents pay each other without sharing private keys.
What It Does
- Agent Grants — short-lived, budget-capped, scope-restricted spend authorizations (IAM for agents)
- Event-driven settlement — Base L2 payment confirmation in 2–6 seconds, automatic refunds on failure
- Reputation scoring — optional Sybil-resistant trust layer via The Graph subgraph
- Open spec — fully documented, conformance-tested, implement without AgentPay
Quick Start (60 seconds, no wallet)
git clone https://github.com/shawnhvac/x402.git
cd x402/examples/minimal-node-python
# Terminal 1 — receiving agent
cd python-receiving-agent && pip install -r requirements.txt && python app.py
# Terminal 2 — paying agent
cd node-paying-agent && npm install && npm start
See a full payment cycle — grant → verify → settle → receipt — in your terminal.
On-Chain (Base Sepolia)
Flip two env vars and run the same example with real USDC on Base Sepolia: BASE_SEPOLIA.md
How It Works
Every x402 payment is an HTTP request with a signed grant header:
POST /api/tool HTTP/1.1
X-402-Payment: <base64-encoded EIP-712 grant + EIP-3009 authorization>
The receiving agent verifies the grant offline (no RPC in the happy path), settles on-chain via EIP-3009 transferWithAuthorization, and returns a receipt in the response header.
Spec Suite
Six live documents covering every layer of the stack:
| Spec | Description |
|---|---|
| grants.md | EIP-712 grant schema, security rules, revocation |
| payment-flow.md | End-to-end lifecycle |
| conformance.md | One-command test suite |
| reputation.md | Reputation scoring |
| subgraph.md | The Graph deployment guide |
Links
- Website: x402-agent-pay.com
- GitHub: github.com/shawnhvac/x402
- Implementations: COMMUNITY.md
- Network: Base L2 (USDC)
Metadata
Release files for x402grants 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| x402grants-0.1.0.tar.gz | 2.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| x402grants-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.8 kB
Release files / x402grants-0.1.0.tar.gz
| Download URL | x402grants-0.1.0.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c4e9a2b6c36e83ff1c9eba9f812d3a21186ead95014be17327e8f6fbf120c45
|
|
BLAKE2b-256 checksum How to use checksums |
b736ecbf896fa7f54e3f58fb90f9d94ae3f99ab083bd17b9600af27333f76e09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / x402grants-0.1.0-py3-none-any.whl
| Download URL | x402grants-0.1.0-py3-none-any.whl |
|---|---|
| Size | 2.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb34565b21c545815c25b6687d6b41725e223f441ec18b74d1227f1ac5ebda3b
|
|
BLAKE2b-256 checksum How to use checksums |
ee5af3b08fe3e8f1feb0f1bc231351ea406ad5a5099b5ecff380a6ecf7a0d9a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|