Documentation

Getting Started

BillMyAgent is a payment processing platform built for AI agents and marketplaces, powered by the x402 protocol. This documentation will help you integrate BillMyAgent into your application.

Key Concepts

  • Payment Payload: The encoded payment information containing transaction details
  • Payment Required: The requirements that must be met for a payment to be valid
  • Verification: The process of validating that a payment meets the required criteria
  • Facilitator: The x402 service that handles payment verification and processing
  • HTTP 402 Paywalls: Endpoints can return HTTP 402 with payment instructions when payment is required
  • Automatic Payment Handling: SDKs automatically detect 402 responses, sign payments, and retry requests
  • Wallet Integration: Built-in support for MetaMask, Coinbase Wallet, and WalletConnect

Architecture

The BillMyAgent payment processor consists of several microservices:

  • Payment Processor: Core payment processing service with encryption at rest
  • Verification Service: Validates payment payloads against requirements
  • Settlement Service: Handles payment settlement and reconciliation
  • Subscription Service: Manages recurring payments and subscriptions with automatic renewal payments
  • Webhook Service: Sends event notifications to your application
  • API Gateway: Single entry point with HTTP 402 paywall support, payment instruction generation, and entitlement checking

x402 Protocol Features

BillMyAgent fully implements the x402 protocol for autonomous agent payments:

  • HTTP 402 Paywalls: Any endpoint can require payment and return 402 with payment instructions
  • Automatic Payment Handling: SDKs automatically handle 402 responses, sign payments via wallet, and retry requests
  • Wallet Integration: Built-in adapters for MetaMask, Coinbase Wallet, and WalletConnect
  • GraphQL Extensions: Field-level monetization with extensions.paymentRequired
  • Payment Instructions: Automatic generation of x402-compliant PaymentRequired payloads
  • Multi-Network: Support for Ethereum, Polygon, Base, and Solana
  • Subscription Integration: Automatic payment creation for subscription renewals

Authentication

All API requests require authentication using an API key. Include your API key in theX-API-Key header with every request.

To obtain an API key, visit our Get API Key page for instructions on how to get started.

Next Steps

Check out the API Reference for detailed endpoint documentation, or follow our Integration Guides for step-by-step tutorials.