Bank of AI

2a0c401 pts0 comments

Welcome to x402 | BANK OF AI | Developer Guide

Skip to main content

On this page<br>Welcome to x402<br>x402 is an open blockchain payment standard built on the HTTP 402 Payment Required status code. It enables web services to charge for APIs or content through a “pay-before-response” mechanism — without relying on traditional account systems or session management.<br>x402 currently supports the TRON and BSC networks, with plans to expand to a broader multi-chain ecosystem in the future.<br>Interested in contributing to the documentation?

Feel free to submit a PR to the GitHub repository. Our only principle is to maintain neutrality — aside from essential resource links, please avoid promotional or branded content.<br>Building with x402?<br>Install the published @bankofai/x402-* packages in your TypeScript app. The x402 repository ships runnable client → server → facilitator examples under examples/typescript/ for reference — exact, gasfree, upto, and batch-settlement.<br>Why Use x402?​<br>x402 addresses the core pain points of existing payment systems:<br>High fees and complex workflows in traditional credit card and fiat payment channels<br>Poor support for machine-to-machine (M2M) payments , such as autonomous AI agent transactions<br>Lack of efficient micro-payment infrastructure , making usage-based monetization difficult<br>Leveraging blockchain’s fast and low-cost transaction capabilities<br>Who Is x402 For?​<br>Sellers: Service providers who want to monetize APIs or content. With minimal configuration, x402 enables direct, programmatic payments from clients.<br>Buyers: Developers and AI agents who want to access paid services without registration flows or manual intervention.<br>Buyers and sellers interact directly through HTTP requests, while payments are executed transparently and automatically on-chain by the protocol.<br>What Can You Build?​<br>x402 supports a wide range of use cases:<br>Pay-per-request APIs<br>AI agents capable of autonomously paying for APIs<br>Digital content paywalls<br>Microservices monetized via microtransactions<br>API aggregation services that do not resell underlying capabilities<br>How It Works​<br>At a high level, the workflow is straightforward:<br>Request Initiated: The buyer requests a protected resource from the server.<br>Payment Required: If payment is required, the server returns a 402 Payment Required response along with payment instructions.<br>Payment Submitted: The buyer generates and submits a signed payment payload.<br>Verification & Settlement: The server calls the x402 Facilitator’s /verify and /settle endpoints to validate and settle the payment.<br>Resource Delivered: Once verification succeeds, the server delivers the requested resource.<br>To explore further:<br>Client / Server<br>Facilitator<br>HTTP 402<br>Our goal is to build a low-barrier, permissionless, developer-friendly programmable commerce layer on blockchain.<br>Network Support​<br>x402 currently supports the following networks:<br>TRON Mainnet (tron:mainnet)<br>TRON Shasta Testnet (tron:shasta)<br>TRON Nile Testnet (tron:nile)<br>BSC Mainnet (eip155:56)<br>BSC Testnet (eip155:97)<br>SDK (TypeScript-only) : x402 is a TypeScript-only SDK published as granular @bankofai/x402-* npm packages (core, evm, tron, fetch, express, hono, fastify, next, axios, mcp, extensions). The source is maintained in a pnpm/turbo monorepo, but application development should install the published packages. Supported schemes: exact (ERC-3009 / Permit2), upto, batch-settlement, auth-capture (EVM), and exact_gasfree (TRON). The previous-generation Python + TypeScript SDK lives under legacy/ for reference. See the SDK Feature Matrix for the full breakdown.

Quick Start​<br>Ready to build? Start here:<br>Quickstart for Sellers<br>Quickstart for Agents<br>Http 402

Why Use x402?<br>Who Is x402 For?<br>What Can You Build?<br>How It Works<br>Network Support<br>Quick Start

x402 payment tron server content typescript

Related Articles