documentation

Ӿ402Nano Facilitator

This facilitator verifies and settles x402 payments on the Nano network. Point any x402-compatible resource server at https://x402nano.org/facilitator and start accepting feeless payments — no account required.

Quick Start

Start accepting Nano payments in minutes. No account required — the facilitator works out of the box.

  1. 1

    No signup needed

    The facilitator is permissionless. Start using it immediately — no account, no API key.

  2. 2

    Install the SDK

    Use @x402/next for built-in Next.js middleware and route handler support, or @x402/core for manual verify/settle in any server framework.

  3. 3

    Verify, settle, serve

    When a client sends a payment signature, forward it to the facilitator for verification and on-chain settlement. Optionally create an account later for usage analytics.

Facilitator URL
Add the URL to your server config or SDK constructor.
FACILITATOR_URL=https://x402nano.org/facilitator

How payments work

x402 adds a payment layer to standard HTTP requests. Here is the entire life of a Nano payment — five steps, no human in the loop.

  1. 1.Client requests a protected resource

    GET /premium

    A standard HTTP request hits your API endpoint. No payment yet.

  2. 2.Server answers 402 Payment Required

    402 PAYMENT REQUIRED

    The response carries a PAYMENT-REQUIRED header with the payment terms: scheme, price, network, and recipient.

  3. 3.Client signs a Nano block

    nano:mainnet · 0.001 Ӿ

    The client builds a Nano send block for the exact amount, signs it with its private key, and computes proof of work.

  4. 4.Client retries with the receipt

    PAYMENT-SIGNATURE

    The original request is replayed with the signed payment payload in the PAYMENT-SIGNATURE header.

  5. 5.Facilitator verifies and settles

    /facilitator/verify → /facilitator/settle

    Your server forwards the payload to the facilitator, which validates it and broadcasts the block to the Nano network. Once confirmed, the protected content is served.

What a 402 actually says

The PAYMENT-REQUIRED header is a base64url-encoded JSON document. Decoded, it looks like this (abridged):

decoded PAYMENT-REQUIRED
{
"x402Version": 2,
"accepts": [
{
"scheme": "exact",
"network": "nano:mainnet",
"asset": "nano",
"price": "0.001",
"payTo": "nano_3hxq...e3g9",
"maxTimeoutSeconds": 300,
"description": "Access to premium API"
}
]
}

Header value: eyJ4NDAyVmVyc2lvbiI6MiwiYWNjZXB0cyI6W3sic2NoZW1lIjoiZXhhY3QiLCJuZXR3b3JrIjoibmFubzptYWlubmV0IiwiYXNzZXQiOiJuYW5vIiwicHJpY2UiOiIwLjAwMSIsInBheVRvIjoibmFub18zaHhxZm9oNHM1dW9jY3ptZm5wMTd4M290b2RvZHRuYjg1ZDM0ZTh3aDRpZjFzb2RjaDNuMzRrbnVlM2c5IiwibWF4VGltZW91dFNlY29uZHMiOjMwMCwiZGVzY3JpcHRpb24iOiJBY2Nlc3MgdG8gcHJlbWl1bSBBUEkifV19

Endpoint reference

Three HTTP endpoints. All accept JSON and return JSON. API keys are optional — see Authentication.

GET/facilitator/supportedrate: 500 / min

Discovers what this facilitator accepts: protocol version, payment scheme, and network. Useful for clients that negotiate payment kinds before requesting a protected resource.

Response 200

{
"kinds": [
{
"x402Version": 2,
"scheme": "exact",
"network": "nano:mainnet"
}
],
"extensions": [],
"signers": {
"nano:*": []
}
}

curl

curl https://x402nano.org/facilitator/supported
POST/facilitator/verifyrate: 200 / min

Checks that a signed payment payload is valid for the given requirements — correct scheme, network, recipient, amount, and signature. Verification never broadcasts anything on-chain.

Request body

{
"paymentPayload": {
"x402Version": 2,
"scheme": "exact",
"network": "nano:mainnet",
"payload": {
"signature": "..."
}
},
"paymentRequirements": {
"scheme": "exact",
"network": "nano:mainnet",
"asset": "nano",
"price": "0.001",
"payTo": "nano_3hx...e3g9",
"maxTimeoutSeconds": 300
}
}

Response 200

{
"isValid": true,
"payer": "nano_1q..."
}

curl

curl -X POST https://x402nano.org/facilitator/verify \
-H "content-type: application/json" \
-d '{"paymentPayload":{...},"paymentRequirements":{...}}'
POST/facilitator/settlerate: 200 / min

Broadcasts the signed block to the Nano network and returns the on-chain transaction hash. Call this only after verification succeeds — and only once per payment.

Request body

{
"paymentPayload": {
"x402Version": 2,
"scheme": "exact",
"network": "nano:mainnet",
"payload": {
"signature": "..."
}
},
"paymentRequirements": {
"scheme": "exact",
"network": "nano:mainnet",
"asset": "nano",
"price": "0.001",
"payTo": "nano_3hx...e3g9",
"maxTimeoutSeconds": 300
}
}

Response 200

{
"success": true,
"transaction": "F2E5F...9C1",
"network": "nano:mainnet",
"payer": "nano_1q..."
}

SDKs

Use @x402/next for first-class Next.js integration, or @x402/core for manual verify/settle in any server framework.

@x402/next (Next.js Integration)

The official Next.js package provides paymentProxy for protecting page routes via middleware and withX402 for wrapping API route handlers. Settlement only happens after a successful response, so clients are never charged for failed requests.

Installation

npm install @x402/next @x402/core

Protect page routes (proxy.ts)

The middleware intercepts matching routes and returns 402 Payment Required until the client pays.

import { paymentProxy, x402ResourceServer } from '@x402/next'
import { HTTPFacilitatorClient } from '@x402/core/server'
const facilitator = new HTTPFacilitatorClient({
url: 'https://x402nano.org/facilitator',
})
const server = new x402ResourceServer(facilitator)
export const proxy = paymentProxy(
{
'/premium': {
accepts: {
scheme: 'exact',
network: 'nano:mainnet',
price: '0.001',
payTo: 'nano_1your_address_here',
},
description: 'Access to premium content',
},
},
server,
)
export const config = {
matcher: ['/premium/:path*'],
}

Protect API routes (withX402)

Wrap individual route handlers. Payment is only settled after the handler returns a successful response.

// app/api/ai-chat/route.ts
import { NextRequest, NextResponse } from 'next/server'
import { withX402 } from '@x402/next'
const handler = async (req: NextRequest) => {
// Your API logic
return NextResponse.json({ message: 'Hello from paid API' })
}
export const POST = withX402(
handler,
{
accepts: {
scheme: 'exact',
network: 'nano:mainnet',
price: '0.0001',
payTo: 'nano_1your_address_here',
},
description: 'AI chat completion',
},
server, // your configured x402ResourceServer
)

Authentication

API keys are optional. The facilitator works without authentication. Include an API key to enable usage analytics in your dashboard.

Passing your API key (optional)

Option 1: x-api-key header

x-api-key: x402n_your_api_key_here

Option 2: Authorization header

Authorization: Bearer x402n_your_api_key_here

Rate limits

To ensure fair usage and protect the network, the following rate limits apply per IP address:

EndpointLimitWindow
/facilitator/supported500 requestsper minute
/facilitator/verify200 requestsper minute
/facilitator/settle200 requestsper minute

Errors

All errors return a consistent JSON shape. Check the HTTP status code and message for debugging.

400 Bad Request

Missing or invalid JSON body. Check your request format.

401 Unauthorized

The API key provided is invalid. If you don't need analytics, omit the key entirely.

429 Too Many Requests

Rate limit exceeded. Wait and retry after the limit window resets.

500 Internal Server Error

Something went wrong on our end. Check the dashboard for incident status.

Response shape

{
"error": "Bad Request",
"message": "Missing required fields: paymentPayload and paymentRequirements."
}

FAQ

Do I need an account or API key?+

No. The facilitator is permissionless — it works out of the box. An account and API key are optional and only unlock usage analytics in your dashboard.

What does it cost?+

Nothing. The facilitator charges no fees and Nano transfers are feeless by design. You pay your payers exactly what you ask for — nothing is skimmed off.

What networks and schemes are supported?+

Currently the exact scheme on nano:mainnet. Check /facilitator/supported at runtime — it always reflects the live configuration.

How fast is settlement?+

Nano confirms in well under a second. Once your client broadcasts and the network confirms, your /verify call returns valid and /settle returns the confirmed transaction hash.

What happens if a payment is never settled?+

Nothing. Settlement only happens when you call /settle. An unverified or unsettled signed block is never broadcast, so the payer keeps their funds.

Can AI agents use this?+

Yes — that's the point. An agent can request a resource, receive the 402, sign a Nano block, and retry, all without human intervention. See How payments work.

Stuck or building something cool?

Join our Discord for support and community.

Join our Discord