# x402

CreateWithAI Hub page: https://createwithaihub.com/finance/x402
Latest version of this file: https://createwithaihub.com/finance/x402.md

- Type: Tool · Category: Finance
- Publisher: x402 Foundation (Linux Foundation), originated by Coinbase
- Pricing: Free · License: Apache-2.0
- Runs on: Web, API (cloud)

Open payment standard built on HTTP 402 that lets APIs, sites and MCP servers charge clients and AI agents per request.

x402 is an open protocol for paying for web resources inside the normal HTTP request flow. A server answers with 402 Payment Required and its payment terms, the client (often an AI agent) signs a payment and retries with a PAYMENT-SIGNATURE header, and a facilitator verifies and settles it, mostly in stablecoins on networks such as Base and Solana. It was started at Coinbase and is now governed by the x402 Foundation under the Linux Foundation. It is for developers who want to sell API calls, content or MCP tool calls per use without accounts or subscriptions.

Useful for: Charging $0.10 per call for a paid tool in an MCP server, settled in USDC to your own wallet.

## Key features

- Server middleware for Express, Hono, Fastify and Next.js, and client wrappers for fetch and axios
- @x402/mcp package for paid tool calls in MCP servers and automatic payment in MCP clients
- SDKs for TypeScript, Python (pip install x402) and Go
- Payment schemes exact, upto and batch-settlement across EVM, Solana, Stellar, Aptos and other networks
- No protocol fees; payments go straight to your wallet address
- Apache-2.0 licensed, governed by the x402 Foundation (Linux Foundation)

## Connection

- Billing model: Usage-based / credits, Paid by AI agents
- Who sells: Your own payment account
- Built for: Web apps & SaaS, APIs & MCP servers
- Hosting: Self-hostable

## Before you start

- A crypto wallet address to receive payments
- Node.js, Python or Go

## Install steps from the official documentation

Express server:

```
npm install @x402/core @x402/evm @x402/svm @x402/express
```

Fetch client:

```
npm install @x402/core @x402/evm @x402/svm @x402/fetch
```

MCP:

```
npm install @x402/mcp @x402/core @modelcontextprotocol/sdk
```

Python:

```
pip install x402
```

## Limitations

- The public x402.org facilitator is for testnet and development; production mainnet needs a facilitator provider, your own facilitator or self-facilitation
- Payments are mainly onchain (stablecoins); clients need a funded wallet
- Network fees still apply, and third-party facilitators may set their own terms

## Official links

- Website: https://www.x402.org
- Source repository: https://github.com/x402-foundation/x402
- Documentation: https://docs.x402.org
- Source: https://github.com/x402-foundation/x402 (README: open standard, payment flow, TypeScript/Python/Go install commands, schemes, facilitator guidance; Apache-2.0 LICENSE; active; coinbase/x402 is now a fork of this repo)
- Source: https://github.com/x402-foundation/x402/tree/main/typescript/packages/mcp (@x402/mcp: paid tool calls in MCP servers and payment handling in MCP clients; install command)
- Source: https://www.x402.org (Open neutral standard; 'Zero protocol fees... just pay nominal payment network fees'; docs links)
- Source: https://x402.org/linux-foundation-announces-operational-launch-of-x402-foundation-to-standardize-internet-native-payments-for-ai-agents-and-applications/ (x402 Foundation launched under the Linux Foundation (July 14, 2026); x402 started at Coinbase and was contributed by it)
- Source: https://docs.x402.org/core-concepts/facilitator (x402.org facilitator intended for development and testnet; production facilitators support Base, Solana, Polygon, Avalanche and more)
