Back to Eliza

x402 Plugin

packages/docs/plugin-registry/x402.md

2.0.11.4 KB
Original Source

The x402 plugin implements the HTTP 402 Payment Required protocol, enabling Eliza agents to handle micropayments for premium services and content access.

On-demand plugin. This plugin is resolved from the remote elizaOS plugin registry and auto-installs when configured. It is not included in Eliza's bundled plugins.json index.

Package: @elizaos/plugin-x402

Installation

bash
eliza plugins install @elizaos/plugin-x402

Configuration

Enable via Features

json
{
  "features": {
    "x402": true
  }
}

Prerequisites

A configured blockchain wallet is required for payment processing. See the Wallet Guide for setup.

How It Works

  1. An external service responds with HTTP 402 and a payment request header
  2. The x402 plugin intercepts the response and evaluates the payment request
  3. If approved, it signs a payment transaction using the agent's wallet
  4. The payment proof is attached to the retried request
  5. The service verifies the payment and fulfills the request

Features

  • HTTP 402-based micropayment handling
  • Pay-per-request agent service monetization
  • Integrates with blockchain wallet for payment processing
  • Supports EVM and Solana payment chains