Quick Start

Deploy your first x402-enabled service or start consuming paid APIs in under 5 minutes.

Choose Your Path

Building a service to monetize? Or consuming existing services? Pick your path and get started.

Service Providers

Launch an API that accepts x402 micropayments:

2

Install Package

Add the x402 middleware to your project via npm or pip

3

Configure Middleware

Set your payment address and facilitator endpoint in the middleware

4

Deploy

Push to production and start accepting micropayments instantly

Consumers

Start calling x402-protected APIs:

1

Discover Services

Browse the marketplace to find AI services, data APIs, and specialized tools

2

Test Free

Use built-in testing interfaces to validate service behavior before spending

3

Connect Wallet

Link your MetaMask, Phantom, or preferred wallet for transactions

4

Install Client

Add the x402 client library to handle payments automatically

5

Start Transacting

Make API calls with automatic payment handling - just use standard HTTP methods

Quick Example

Server (Express.js)

import { x402Middleware } from '@payai/x402-server';

app.use('/api/*', x402Middleware({
  payTo: "0x742d35Cc...",
  network: "base"
}));

app.get('/api/data', (req, res) => {
  res.json({ result: "paid data" });
});

Client (Node.js)

import { X402Client } from '@payai/x402-client';

const client = new X402Client({
  signer: wallet,
  network: "base"
});

const data = await client.get('https://api.example.com/api/data');
console.log(data);

Dive Deeper

Explore comprehensive guides, API references, and integration examples for production deployments.

Full Documentation
Nova402