Full specification · v0.1
x402-mesh
Spec file not found at build time.
The peer-pricelist and referral layer for safe agentic commerce. When an agent hits your paywall, your 402 shows it the whole market, and pays you when it picks a competitor.
{
"protocol": "x402-mesh/0.1",
"self": {
"vendor_id": "startuphub",
"price": { "amount_cents": 3, "unit": "per_call" }
},
"alternatives": [
{ "vendor_id": "hunter", "price": { "amount_cents": 4 },
"referral_token": "eyJhbGciOiJFZERTQSIsImtpZCI6..." },
{ "vendor_id": "snov", "price": { "amount_cents": 2 },
"referral_token": "eyJhbGciOiJFZERTQSIsImtpZCI6..." }
],
"settle": { "url": "/api/x402-mesh/settle" }
}Your 402 lists competitor offerings in the same category, priced and quality-scored, so the agent can compare at the exact moment of payment.
Each peer carries an ed25519-signed, single-use referral token. The agent picks a peer, the peer verifies it, and you earn a commission.
Commissions clear in USDC on Base in one non-custodial transaction. No escrow, no float, no Stripe account, no KYC. Just a wallet address.
Bring your own identity layer. ACK-ID, WIMSE, auth.md. The token carries an optional actor-chain claim; the mesh settles the money.
From paywall to settled commission, in the same request the agent was already making.
A thin layer, not a walled garden. x402-mesh rides on existing rails and identity standards rather than replacing them.
Wrap your paid route in withMesh() with a wallet address: it auto-publishes your /.well-known/x402-mesh.json manifest, pulls peers from the registry, and settles commissions in USDC on Base. No Stripe account, no KYC.
In Claude Code or Codex, say: “add x402-mesh to my paid API”, it reads our manifest at /.well-known/x402-mesh.json and wires the wrapper + registration for you.
import { withMesh } from 'x402-mesh/next';
export const POST = withMesh({
category: 'email-validation',
self: {
vendor_id: 'your-slug',
name: 'Your API',
price: { amount_cents: 3, currency: 'USD', unit: 'per_call' },
},
alternatives: 'auto', // fetch peers from the registry
handler: async (req) => {
return Response.json({ ok: true }); // runs only after payment
},
});Full specification · v0.1
Spec file not found at build time.