AgentPay-x402

Autonomous AI agent that discovers, pays for, and uses APIs with real crypto micropayments

AgentPay-x402

Created At

HackMoney 2026

Project Description

AgentPay is an autonomous AI agent that can discover paid APIs, negotiate prices, and pay for them using real cryptocurrency without human intervention.

Today, most AI agents break when they encounter paid tools or premium data sources. They either rely on prepaid credits or manual API keys. AgentPay solves this by giving the AI agent its own wallet and a payment protocol.

The system uses the HTTP 402 “Payment Required” flow. When the agent requests a paid tool, the backend returns a 402 response with pricing details. The agent automatically pays using the Yellow Network NitroLite SDK, which enables instant, off-chain micropayments through state channels. If the off-chain path fails, the system can fall back to standard on-chain EVM transactions.

The agent then retries the request with payment proof and receives the data, completing a fully autonomous pay-per-use loop.

AgentPay demonstrates the future of AI-to-API commerce, where agents can independently discover, pay for, and use digital services in real time.

How it's Made

AgentPay is built as a full-stack application with a React frontend and a Node.js backend marketplace.

The frontend acts as both the AI brain and the wallet. It uses the Groq SDK for LLM inference and integrates the Yellow Network NitroLite SDK to manage token balances, approvals, and off-chain payments through state channels.

The backend is an Express-based tool marketplace that exposes multiple paid APIs such as weather data, job search, and audio generation. Each tool is priced in USDC and protected using an HTTP 402 payment flow. If a request arrives without payment, the server returns a 402 response with price and payment metadata.

The frontend catches the 402 response, executes the payment via the Yellow SDK, and retries the request with a payment proof header. The backend then verifies the proof and returns the tool result.

Tech stack:

  • Frontend: React, Vite
  • Backend: Node.js, Express
  • AI: Groq LLM
  • Payments: Yellow Network NitroLite SDK, x402
  • Blockchain: EVM (Sepolia) with USDC
  • Hosting: Vercel (frontend), serverless/Node backend
background image mobile

Join the mailing list

Get the latest news and updates

AgentPay-x402 | ETHGlobal