x402 logo

x402

Visit

An open, vendor-neutral standard for internet-native payments over HTTP, allowing agents to pay for resources directly through 402 Payment Required responses.

Share:

x402 is an open, neutral standard for internet-native payment over HTTP. A client requests a resource, receives 402 Payment Required, submits payment, and gains access. Created by Coinbase and contributed to the Linux Foundation, it removes the need for accounts, signups, and API keys in machine commerce.

Key Features

  • Native HTTP Flow: Payment requirements travel through standard request and response semantics.
  • No Protocol Fees: Users pay only nominal network costs.
  • Chain Flexibility: Supports EVM networks and Solana, with extensibility to fiat.
  • Payment Schemes: Includes exact, upto, and batch-settlement modes.
  • Framework Middleware: Available for Express, FastAPI, Flask, Hono, and Next.js.
  • Multiple Transports: Works across HTTP, MCP, and A2A.

Use Cases

Who Should Use This Tool?

  • API Providers monetizing individual requests.
  • Agent Developers purchasing data, compute, content, or tools.
  • Infrastructure Teams seeking a vendor-neutral payment interface.

Problems It Solves

  1. Account setup: Payment can replace signup and API-key provisioning.
  2. Micropayment friction: Stablecoin settlement supports small resource purchases.
  3. Vendor lock-in: An open foundation governs the standard.

Pricing

Plan Price Features
Protocol Free Open standard, middleware, and payment schemes.
Settlement Network fees only Costs depend on the selected payment rail.

Advantages & Unique Selling Points

Compared to Competitors:

  1. Protocol, not platform: Implementers choose wallets, chains, and facilitators.
  2. HTTP-native interaction: Payment fits existing web infrastructure.
  3. Broad backing: The foundation includes major payment, cloud, commerce, and blockchain organizations.

What Makes It Stand Out:

  • No mandatory accounts or API keys.
  • Blockchain-agnostic and extensible design.
  • Middleware for popular JavaScript and Python frameworks.

User Reviews

"Using an HTTP status code as the negotiation point makes paid APIs easy for agents to understand." Illustrative backend-developer perspective, editorially composed

"Vendor neutrality matters because our service should not dictate the buyer's wallet stack." Illustrative infrastructure-lead perspective, editorially composed

Getting Started

Quick Start Guide

  1. Choose middleware: Select the package for your server framework.
  2. Describe payment: Configure amount, asset, network, and recipient.
  3. Return 402: Protect the paid route with the payment requirement.
  4. Verify settlement: Grant access after valid payment evidence.

Integration

Integrates with:

  • Express, FastAPI, Flask, Hono, and Next.js
  • EVM chains and Solana
  • HTTP, MCP, and A2A transports

Frequently Asked Questions

Does x402 charge protocol fees?

No. Only nominal costs from the selected settlement network apply.

Does it require user accounts?

No. The standard is designed to work without signups or API keys.

Is x402 limited to one blockchain?

No. It supports multiple blockchain families and can extend to fiat.

Alternatives

Tips & Best Practices

  1. Return precise requirements: Clearly specify asset, amount, network, and recipient.
  2. Make verification idempotent: Safely handle retried requests and payment evidence.
  3. Use batch settlement thoughtfully: Group payments only when latency permits.

Conclusion

x402 turns payment into a standard part of the web request lifecycle. Its open governance, zero protocol fees, broad framework support, and chain flexibility make it a foundational option for APIs serving autonomous agents.

Comments

No comments yet. Be the first to comment!