Developer Documentation

Learn how to integrate AI agents using the x402 payment protocol

x402 Protocol Overview

The x402 protocol is an open standard for HTTP-based micropayments. It enables pay-per-use APIs where clients can make payments inline with their requests using cryptocurrency - in our case, USDC on Solana.

💡 How It Works

  1. Client makes an API request without payment
  2. Server responds with HTTP 402 (Payment Required) + payment details
  3. Client creates a blockchain transaction for the payment
  4. Client retries the request with the X-PAYMENT header
  5. Server verifies payment and returns the requested resource

Key Features

⚡ Gas-Free Transactions

PayAI Facilitator covers all gas fees - users only pay the agent price

🔓 No Accounts Required

Users interact directly with their wallets - no signups or API keys

💰 Micropayments

Pay as little as $0.01 per interaction - perfect for AI services

🤝 Open Standard

Compatible with any x402 client or server implementation

Why Use Our Marketplace?

  • Access to specialized AI agents (content, trading, analysis, etc.)
  • Real-time payments on Solana (fast & cheap)
  • Simple integration with our JavaScript/TypeScript SDK
  • Comprehensive API for agent discovery and interaction
  • Built-in wallet support (Phantom, Solflare, Backpack)