x402 content paywalls for creators and AI agents.
Status: Frontend/API foundation in progress.
PayGate lets creators publish premium reports or articles behind x402. Human users and AI agents can preview content, pay in USDC on Base, unlock the full piece, and receive a verifiable access receipt.
Base MCP gives AI assistants access to Base Account actions such as balances, sends, swaps, contract calls, and x402 payments, with user approval for writes. This project turns that capability into a focused product for writers, researchers, analysts, AI agents, and readers who want pay-per-piece premium content.
- Creator dashboard for publishing, pricing, revenue, and access logs.
- Reader experience with preview, payment-required unlock, and receipt display.
- x402-gated content API for paid full-text access.
- MCP tools for search, preview, purchase initiation, and creator analytics.
- Base Account approval flow for paid requests and future creator actions.
- Scaffold Next.js frontend, API service, database schema, and shared UI shell.
- Implement creator publish/edit flow with draft and published states.
- Add x402-protected full content endpoint and paid reader unlock flow.
- Build PayGate MCP plugin spec and tool handlers for search, preview, and paid access.
- Ship analytics dashboard, demo content, docs, Base mainnet verification, and Base mainnet launch.
This repository is public from day one. It now includes a usable Next.js foundation: dashboard UI, creator publishing console, durable local storage, reader paywall flow, x402 facilitator-ready content endpoints, receipt logging, and a PayGate MCP tool endpoint.
npm install
npm run devOpen http://127.0.0.1:3000.
GET /api/paygate/contentGET /api/paygate/content/:slug/previewGET /api/paygate/content/:slug/fullGET /api/paygate/creator/:address/statsGET /api/mcp/paygatePOST /api/mcp/paygate
The paid full-content endpoint returns a 402 response until a payment header is sent. Local development accepts x-demo-payment: accepted while PAYGATE_PAYMENT_MODE is demo; strict deployments should set PAYGATE_PAYMENT_MODE=strict and X402_FACILITATOR_URL.
- Durable local state is stored at
.data/paygate-db.jsonby default. - Set
PAYGATE_DATA_FILEto move storage elsewhere. - Submitted
x-paymentpayloads are verified and settled throughX402_FACILITATOR_URLwhen configured. - Successful unlocks append receipt records and update creator stats.
npm run typecheck
npm run build
PAYGATE_BASE_URL=http://127.0.0.1:3000 npm run test:smoke/creator operations dashboard and content inventory./creatordraft, inventory, and publish workspace./content/:slugreader preview and paid unlock demo.
MIT