> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyspend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AnySpend x402 overview

Pay for paywalled APIs and services with any token using the x402 open payment protocol

**[GitHub Repository](https://github.com/b3-fun/anyspend-x402)**

View source code, examples, and contribute

**[npm Package](https://www.npmjs.com/package/@b3dotfun/anyspend-x402)**

Install @b3dotfun/anyspend-x402 package

## What is AnySpend x402

AnySpend x402 is B3's implementation of the **x402 payment protocol** that enables instant, automatic cryptocurrency payments directly over HTTP. Unlike traditional x402 facilitators that only support USDC, **AnySpend allows you to pay with any compatible token** (EIP-2612 or EIP-3009) while resource servers receive any token they prefer.

The x402 protocol modernizes the HTTP `402 Payment Required` status code, turning it into a practical solution for machine-to-machine micropayments, paywalled APIs, and autonomous agent interactions.

## For buyers (payers)

Pay for paywalled resources using any compatible token you hold:


- **Pay with compatible tokens**: Use any token with EIP-2612 or EIP-3009 support for gasless payments
- **Standard protocol**: Works with any x402-enabled service using standard HTTP
- **No manual swaps**: AnySpend automatically converts your token to what the seller needs
- **Simple integration**: One SDK works across all x402 services

**[Token Compatibility Checker](https://anyspend.com/x402-tokens)**

Browse compatible tokens with EIP-2612 or EIP-3009 support across 19+ networks

**Use Cases:**
- Access premium APIs and AI agent services
- Pay for computational resources and data feeds
- Enable autonomous agent-to-agent payments
- Consume paywalled content programmatically

## For sellers (resource servers)

Accept payments in USDC while your customers pay with their preferred token:

- **Receive USDC**: Get paid in USDC regardless of what token the customer uses
- **Express middleware**: Add payments to your API with just a few lines of code
- **No blockchain infrastructure**: AnySpend handles all on-chain complexity
- **Instant settlement**: Payments are verified and settled automatically

**Use Cases:**
- Monetize premium APIs and data services
- Build paid AI agent workflows
- Create paywalled content and tools
- Accept crypto payments without crypto expertise

## Quick start

Choose your path:

**[I want to pay for services](/anyspend/x402-quickstart-buyers)**

**For Buyers**: Learn how to use the x402 client SDK to pay for paywalled resources with any token

**[I want to accept payments](/anyspend/x402-quickstart-sellers)**

**For Sellers**: Add the Express middleware to your API and start accepting multi-token payments


## How it works

**Client Requests Resource**

User's application makes a standard HTTP request to your API

**Payment Required**

Your API returns `402 Payment Required` with payment details

**Token Preference**

Client specifies their preferred payment token (USDC, USDT, etc.)

**AnySpend Quotes**

AnySpend calculates the equivalent amount in the client's chosen token

**Client Signs Payment**

User signs a cryptographic authorization for their token

**Automatic Settlement**

AnySpend swaps the token to USDC and settles to your wallet

**Resource Delivered**

Your API receives payment confirmation and returns the requested resource

## Key differentiators

### Multi-token support

**Standard x402**: Resource servers and clients must both use USDC

**AnySpend x402**: Clients pay with **any compatible token** (EIP-2612 or EIP-3009 support required) they hold. AnySpend handles the conversion.

```
Client pays with DAI (EIP-2612) → AnySpend swaps to 1 USDC → Seller receives 1 USDC
```

### No infrastructure required

Resource servers don't need to:
- Run blockchain nodes
- Manage wallets or private keys
- Handle token swaps or bridging
- Monitor transaction status

AnySpend's facilitator handles all blockchain operations and provides simple HTTP endpoints for verification and settlement.

### Standard protocol compliance

Clients using AnySpend don't need to know they're using a special facilitator. The flow uses standard x402 protocol messages, and the multi-token conversion happens on the resource server side through middleware.

## Package delivery

AnySpend x402 consists of two packages:

**Server SDK**

**@b3dotfun/anyspend-x402**

  Universal server middleware supporting Express, Next.js, and Hono for resource servers to easily accept multi-token payments

**Client SDK**

**anyspend-x402-client**

  Platform-agnostic TypeScript SDK for clients to make payments with signature helpers

## Powered by AnySpend facilitator

All x402 payments are processed through the AnySpend Facilitator, which handles:

- Multi-token support across 19+ blockchain networks
- Automatic token swaps and cross-chain routing
- Gasless payments for users
- Standards-compliant x402 implementation
- Drop-in replacement for any x402 facilitator

**Production Endpoint:** `https://mainnet.anyspend.com/x402`

**[AnySpend facilitator](/anyspend/x402-facilitator)**

API endpoints, architecture, and configuration