Ӿ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

    Choose an integration path

    Use @x402/core for a high-level resource server SDK, or use the lightweight x402NanoClient to call verify/settle directly with timeouts, typed errors, and a built-in verify-and-settle workflow. Both work — pick what fits your stack.

  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

Payment Flow

The x402 protocol adds a payment layer to standard HTTP requests. Here is the full flow for a Nano payment:

  1. 1

    Client requests a protected resource

    The client makes a standard HTTP request to your API endpoint.

  2. 2

    Server returns 402 Payment Required

    The response includes a PAYMENT-REQUIRED header containing the Base64-encoded payment requirements: accepted schemes, price, network and the recipient Nano address.

  3. 3

    Client signs a Nano block and computes PoW

    The client constructs a Nano send block for the specified amount to the recipient address, signs it with its private key, and generates proof of work.

  4. 4

    Client retries with payment signature

    The client retries the original request with the Base64-encoded payment payload in the PAYMENT-SIGNATURE header.

  5. 5

    Server verifies and settles via facilitator

    Your server forwards the payment payload to this facilitator. The facilitator validates the signed block and broadcasts it to the Nano network for settlement. The outcome is returned in the PAYMENT-RESPONSE header. Once confirmed, your server serves the protected content.

SDK Reference

There are two ways to integrate with this facilitator. Choose the approach that fits your architecture.

Option A: @x402/core (Resource Server SDK)

The official x402 SDK provides a high-level API for resource servers. It handles payment configuration, verification, and settlement through HTTPFacilitatorClient.

Installation
npm install @x402/core
Register the Facilitator
import { HTTPFacilitatorClient } from '@x402/core/server'
const facilitator = new HTTPFacilitatorClient({
url: 'https://x402nano.org/facilitator'
})

No API key needed in the constructor. Optionally pass one via HTTP headers for analytics (see Authentication).

Verify & Settle
Verify the payment, then settle on-chain before serving content.
const verifyResult = await facilitator.verify(
paymentPayload,
paymentRequirements,
)
if (verifyResult.isValid) {
const settleResult = await facilitator.settle(paymentPayload, paymentRequirements)
if (settleResult.success) {
// Payment settled — serve protected content
}
} else {
// Payment invalid: verifyResult.invalidReason
}

Option B: x402NanoClient (Lightweight SDK)

A production-ready TypeScript SDK shipped with this facilitator. It gives you typed facilitator errors, request timeouts, retry controls, flexible auth headers, and a single verifyAndSettle() workflow, while still exposing low-level verify() and settle() methods when you need full control.

Setup
Copy src/lib/x402/client.ts from the repository into your project.
import { x402NanoClient } from '@/lib/x402'
const facilitator = new x402NanoClient({
endpoint: 'https://x402nano.org',
apiKey: process.env.FACILITATOR_API_KEY, // optional
authMode: 'x-api-key',
timeoutMs: 10_000,
headers: {
'x-service-name': 'my-agent',
},
})
Verify & Settle
Use the high-level workflow for the common payment path.
import { X402NanoClientError } from '@/lib/x402'
try {
const result = await facilitator.verifyAndSettle(
paymentPayload,
paymentRequirements,
{
retries: 1,
retryDelayMs: 500,
},
)
if (!result.ok) {
// Payment invalid: result.verify.invalidReason
return
}
// Payment settled — serve protected content
console.log(result.settle)
} catch (error) {
if (error instanceof X402NanoClientError) {
console.error(error.status, error.retryAfter, error.responseBody)
}
}
Why use it?
Real value over raw fetch — fewer footguns, better production defaults.
  • Built-in request timeout handling with per-call overrides.
  • Typed `X402NanoClientError` with status, retry-after, and response body.
  • Supports both `x-api-key` and `Authorization: Bearer` auth styles.
  • Convenient `verifyAndSettle()` workflow for the standard happy path.
  • Low-level methods still available for custom payment orchestration.

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

AI Agents

x402 was designed with machine-to-machine payments in mind. An AI agent can autonomously discover, pay for, and consume API endpoints without human intervention.

Agent payment flow

When an AI agent calls your x402-protected endpoint, it receives a 402 Payment Required response containing the Base64-encoded PAYMENT-REQUIRED header with the payment details, payment amount, recipient Nano address, and network identifier.

The agent constructs a Nano send block for the specified amount, signs it with its private key, generates proof of work, and retries the request with the Base64-encoded payment payload in the PAYMENT-SIGNATURE header.

Your server extracts the payment signature and forwards it to this facilitator via /facilitator/verify and /facilitator/settle. The facilitator validates the block signature and broadcasts it to the Nano network. Once settled, your server serves the protected content.

The official @x402/client SDK handles this entire flow automatically on the client side.

Rate Limits

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

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

Error Handling

All errors return a consistent JSON format. 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.