# coinbase/x402

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/coinbase-x402).**

5,477 stars · 1,133 forks · TypeScript · apache-2.0

## Links

- GitHub: https://github.com/coinbase/x402
- Homepage: https://x402.org
- awesome-repositories: https://awesome-repositories.com/repository/coinbase-x402.md

## Description

x402 is a protocol and framework that enables cryptocurrency payments for HTTP API calls, using the HTTP 402 status code to negotiate payment before granting access to resources. It supports per-request micropayments across multiple blockchain networks, with batch settlement of off-chain vouchers into a single on-chain transaction to reduce costs. The protocol also includes wallet-based signature authentication, allowing access without a payment when only identity verification is required.

The framework distinguishes itself with a service discovery registry where paid endpoints are listed with metadata and pricing, enabling autonomous agents to find and select services programmatically. It offers flexible billing models per route—fixed price, usage-based, and aggregated batch settlement—and supports gas sponsorship so users can make payments without holding native tokens. A plugin-based payment lifecycle lets developers insert custom hooks for verification, settlement, error handling, and extensions such as marketplace listing, receipts, and gas sponsorship. The system also integrates with the Model Context Protocol, wrapping tools with payment requirements so clients can pay automatically.

Additional capabilities include HTTP middleware for accepting payments, client libraries that automate the payment handshake and retry logic, and facilitator services that offload transaction signing and on-chain settlement. The framework supports multiple EVM networks with runtime registration, handles repeat payment deduplication, and allows overriding payment amounts for usage-based settlement. Payment schemes are registered using a builder pattern, and services can be published to a searchable marketplace directory accessed via natural-language queries.

## Tags

### Networking & Communication

- [HTTP Payment Gating](https://awesome-repositories.com/f/networking-communication/http-payment-gating.md) — Implements a protocol using HTTP 402 responses to negotiate and verify cryptocurrency payments before granting access.
- [Batch Settlement Workflows](https://awesome-repositories.com/f/networking-communication/off-chain-payment-channels/batch-settlement-workflows.md) — Aggregates multiple off-chain payment vouchers into a single on-chain transaction to reduce settlement costs. ([source](https://docs.x402.org/core-concepts/network-and-token-support.md))
- [Payment Handshake Automations](https://awesome-repositories.com/f/networking-communication/payment-requirement-notifications/payment-handshake-automations.md) — Automates the HTTP 402 payment handshake by parsing requirements, generating signed payment payloads, and retrying requests. ([source](https://docs.x402.org/guides/mcp-server-with-x402.md))
- [Service Discovery Registries](https://awesome-repositories.com/f/networking-communication/service-discovery-registries.md) — Maintains a machine-readable directory of paid endpoints with metadata and pricing for autonomous agent discovery.
- [Automated Payment Channel Lifecycles](https://awesome-repositories.com/f/networking-communication/off-chain-payment-channels/automated-payment-channel-lifecycles.md) — Automates the full payment channel lifecycle including deposit, claiming, settling, and refunding funds. ([source](https://docs.x402.org/schemes/batch-settlement.md))
- [Payment Requirement Validators](https://awesome-repositories.com/f/networking-communication/payment-requirement-notifications/payment-requirement-validators.md) — Validates payment requirements against expected criteria such as amount, network, and scheme before authorizing a payment. ([source](https://docs.x402.org/guides/mcp-server-with-x402.md))

### Business & Productivity Software

- [Billing Model Definitions](https://awesome-repositories.com/f/business-productivity-software/billing-model-definitions.md) — Defines per-route billing models with fixed, usage-based, and batched settlement options. ([source](https://docs.x402.org/getting-started/quickstart-for-sellers.md))
- [Fixed-Usage-Batch Pricing Models](https://awesome-repositories.com/f/business-productivity-software/fixed-usage-batch-pricing-models.md) — Supports three billing modes per API route: fixed price, usage-based, and aggregated batch settlement.
- [Automatic Payment Retry Clients](https://awesome-repositories.com/f/business-productivity-software/online-payment-processing/request-based-payment-gating/automatic-payment-retry-clients.md) — Wraps web requests to automatically intercept payment responses, generate payment headers, and retry the request. ([source](https://docs.x402.org/getting-started/quickstart-for-buyers.md))
- [Payment Lifecycle Hooks](https://awesome-repositories.com/f/business-productivity-software/payment-event-triggers/payment-lifecycle-hooks.md) — Supports custom lifecycle hooks at server, client, and facilitator stages to extend payment verification and settlement logic. ([source](https://docs.x402.org/sdk-features.md))
- [Agent Payment Facilitators](https://awesome-repositories.com/f/business-productivity-software/payment-integrations/agent-payment-facilitators.md) — Uses a remote facilitator service to coordinate payment verification and settlement. ([source](https://docs.x402.org/guides/migration-v1-to-v2.md))
- [AI Agent Payment Frameworks](https://awesome-repositories.com/f/business-productivity-software/payment-integrations/agent-payment-facilitators/ai-agent-payment-frameworks.md) — Enables autonomous AI agents to discover, negotiate, and pay for API services using blockchain transactions.
- [Facilitator-Based Settlement Offloading](https://awesome-repositories.com/f/business-productivity-software/payment-integrations/agent-payment-facilitators/facilitator-based-settlement-offloading.md) — Offloads payment verification and blockchain settlement to an external facilitator service. ([source](https://docs.x402.org/core-concepts/facilitator.md))
- [Multi-Chain Payment Schemes](https://awesome-repositories.com/f/business-productivity-software/payment-integrations/multi-merchant-payment-support/multi-chain-payment-schemes.md) — Accepts payments across multiple blockchain networks by selecting the appropriate payment scheme automatically. ([source](https://docs.x402.org/guides/mcp-server-with-x402.md))
- [Payment Scheme Frameworks](https://awesome-repositories.com/f/business-productivity-software/payment-scheme-frameworks.md) — Defines multiple payment models including fixed-price, usage-based, and batch settlement for API routes. ([source](https://docs.x402.org/schemes/overview.md))
- [Fixed-Price Payment Gating](https://awesome-repositories.com/f/business-productivity-software/online-payment-processing/request-based-payment-gating/fixed-price-payment-gating.md) — Gates resource access behind authorization of the exact fixed price amount. ([source](https://docs.x402.org/schemes/exact.md))
- [Payment Destination Management](https://awesome-repositories.com/f/business-productivity-software/payment-destination-management.md) — Configures wallet addresses as payment destinations for receiving cryptocurrency payments. ([source](https://docs.x402.org/core-concepts/wallet.md))
- [Self-Hosted Payment Facilitators](https://awesome-repositories.com/f/business-productivity-software/payment-integrations/agent-payment-facilitators/self-hosted-payment-facilitators.md) — Enables deployment of custom facilitator servers for transaction signing and gas sponsorship. ([source](https://docs.x402.org/core-concepts/network-and-token-support.md))
- [Custom Payment Extensions](https://awesome-repositories.com/f/business-productivity-software/payment-lifecycle-management-suites/payment-process-interceptors/custom-payment-extensions.md) — Builds custom extension objects to add tailored behaviors to the payment lifecycle. ([source](https://docs.x402.org/extensions/overview.md))
- [Cryptographic Payment Proofs](https://awesome-repositories.com/f/business-productivity-software/payment-receipts/cryptographic-payment-proofs.md) — Generates cryptographically signed payment offers and receipts for verifiable proof of interaction. ([source](https://docs.x402.org/extensions/offer-receipt.md))
- [Payment Artifact Verification](https://awesome-repositories.com/f/business-productivity-software/payment-receipts/cryptographic-payment-proofs/payment-artifact-verification.md) — Verifies signed payment offers and receipts to ensure they match and are authentic. ([source](https://docs.x402.org/extensions/offer-receipt.md))
- [Configurable Settlement Schemes](https://awesome-repositories.com/f/business-productivity-software/payment-scheme-frameworks/configurable-settlement-schemes.md) — Accepts multiple settlement schemes like exact amount and up-to amount for flexible payment handling. ([source](https://cdn.jsdelivr.net/gh/coinbase/x402@main/README.md))

### Data & Databases

- [Blockchain Payment Middleware](https://awesome-repositories.com/f/data-databases/transaction-verification-services/cryptocurrency-payment-verifiers/blockchain-payment-middleware.md) — Intercepts HTTP requests with 402 responses to negotiate and verify cryptocurrency payments before granting access. ([source](https://cdn.jsdelivr.net/gh/coinbase/x402@main/README.md))
- [Multi-Blockchain Payment Processing](https://awesome-repositories.com/f/data-databases/transaction-verification-services/cryptocurrency-payment-verifiers/blockchain-payment-middleware/multi-blockchain-payment-processing.md) — Processes payments across multiple blockchains using native token standards with gasless transfers. ([source](https://docs.x402.org/core-concepts/network-and-token-support.md))
- [Multi-Chain Payment Gateways](https://awesome-repositories.com/f/data-databases/transaction-verification-services/cryptocurrency-payment-verifiers/multi-chain-payment-gateways.md) — Processes and verifies cryptocurrency transfers across multiple blockchain networks with a unified interface.
- [Per-Request Payment Verifiers](https://awesome-repositories.com/f/data-databases/transaction-verification-services/cryptocurrency-payment-verifiers/per-request-payment-verifiers.md) — Verifies cryptocurrency payments per HTTP API request with automatic handshake and retry logic.

### Security & Cryptography

- [Wallet Ownership Verification](https://awesome-repositories.com/f/security-cryptography/identity-authentication/identity-based-authentication/wallet-ownership-verification.md) — Provides wallet signature verification to authenticate users and authorize access to gated resources. ([source](https://docs.x402.org/extensions/sign-in-with-x.md))
- [Facilitated Gas Sponsorships](https://awesome-repositories.com/f/security-cryptography/token-based-gas-payment-systems/facilitated-gas-sponsorships.md) — Enables users to make blockchain payments without holding native tokens by delegating gas costs to a facilitator.
- [Self-Hosted Payment Facilitators](https://awesome-repositories.com/f/security-cryptography/authentication-services/self-hosted-deployments/self-hosted-payment-facilitators.md) — Deploys a self-hosted facilitator for independent payment verification and settlement. ([source](https://docs.x402.org/dev-tools/facilitators.md))
- [Crypto Wallet Content Payments](https://awesome-repositories.com/f/security-cryptography/private-wallet-management/cryptocurrency-wallets/crypto-wallet-content-payments.md) — Uses a cryptocurrency wallet to sign payment payloads and authorize on-chain transactions for content access. ([source](https://docs.x402.org/core-concepts/wallet.md))
- [Gas Sponsorship for Approvals](https://awesome-repositories.com/f/security-cryptography/token-based-gas-payment-systems/gas-sponsorship-for-approvals.md) — Sponsors gas costs for token approval transactions, enabling gasless user payments. ([source](https://docs.x402.org/extensions/erc20-approval-gas-sponsoring.md))
- [Wallet Signature Authentication](https://awesome-repositories.com/f/security-cryptography/wallet-signature-authentication.md) — Authenticates HTTP requests via wallet signatures, granting resource access without on-chain transactions.

### Web Development

- [Paid API Request Handlers](https://awesome-repositories.com/f/web-development/api-management-tools/paid-api-request-handlers.md) — Enables automatic payment per request when calling remote APIs, handling the payment handshake transparently. ([source](https://docs.x402.org/guides/mcp-server-with-x402.md))
- [Channel-Based Paid API Requests](https://awesome-repositories.com/f/web-development/api-management-tools/api-request-handling/channel-based-paid-api-requests.md) — Makes paid API requests by signing vouchers, managing deposits, and handling channel recovery transparently. ([source](https://docs.x402.org/schemes/batch-settlement.md))
- [Per-Route Extension Configuration](https://awesome-repositories.com/f/web-development/http-server-customization-tools/route-and-middleware-extensions/per-route-extension-configuration.md) — Configures payment extensions on a per-route basis within the middleware. ([source](https://docs.x402.org/extensions/overview.md))
- [Service Marketplace Listings](https://awesome-repositories.com/f/web-development/service-discovery/service-marketplace-listings.md) — Registers HTTP endpoints with pricing and metadata in a searchable directory for autonomous service discovery. ([source](https://docs.x402.org/getting-started/quickstart-for-sellers.md))

### Artificial Intelligence & ML

- [Model Context Protocol Payment Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/model-context-protocol-payment-integrations.md) — Integrates with the Model Context Protocol to wrap tools with payment requirements and automatic client payment. ([source](https://docs.x402.org/sdk-features.md))

### Part of an Awesome List

- [Blockchain Network Registration](https://awesome-repositories.com/f/awesome-lists/devtools/core-and-community-extensions/framework-capability-extensions/network-core-extensions/blockchain-network-registration.md) — Registers new EVM blockchains at runtime without code changes to support additional payment networks. ([source](https://docs.x402.org/core-concepts/network-and-token-support.md))
- [Multi-Network Signature Verifications](https://awesome-repositories.com/f/awesome-lists/devtools/core-and-community-extensions/framework-capability-extensions/network-core-extensions/blockchain-network-registration/multi-network-signature-verifications.md) — Accepts and verifies wallet signatures across multiple blockchain networks on the same service. ([source](https://docs.x402.org/extensions/sign-in-with-x.md))
- [Payment Extension Plugins](https://awesome-repositories.com/f/awesome-lists/devtools/server-plugins-and-extensions/payment-extension-plugins.md) — Adds optional payment features like marketplace listing and gas sponsorship through extension plugins. ([source](https://docs.x402.org/sdk-features.md))

### Development Tools & Productivity

- [Marketplace Search Engines](https://awesome-repositories.com/f/development-tools-productivity/marketplace-search-engines.md) — Provides natural-language query search for paid services, returning paginated results from the marketplace. ([source](https://docs.x402.org/extensions/bazaar.md))
- [Paid Service Directories](https://awesome-repositories.com/f/development-tools-productivity/open-source-software/service-registries/paid-service-directories.md) — Lists paid API endpoints with pricing and metadata in a searchable directory for programmatic service discovery.
- [Paid Service Catalogue Publishers](https://awesome-repositories.com/f/development-tools-productivity/paid-service-catalogue-publishers.md) — Registers web resources or tools in a marketplace directory with metadata, formats, and price information. ([source](https://docs.x402.org/extensions/bazaar.md))
- [Paid Service Discovery Tools](https://awesome-repositories.com/f/development-tools-productivity/paid-service-discovery-tools.md) — Lists all registered marketplace services with filtering by type and price for autonomous agent selection. ([source](https://docs.x402.org/extensions/bazaar.md))

### Software Engineering & Architecture

- [MCP Tool Discovery Metadata](https://awesome-repositories.com/f/software-engineering-architecture/schema-metadata-utilities/schema-metadata-definitions/custom-metadata-extensions/tool-metadata-extensions/mcp-tool-discovery-metadata.md) — Exposes tool metadata including name, description, and input schema for discovery and invocation via a marketplace. ([source](https://docs.x402.org/guides/mcp-server-with-x402.md))
