USDC gasless x402 payments on Mantle Network

Build monetized APIs using standard HTTP 402 responses. Our SDK handles blockchain micropayments seamlessly while your users enjoy a gasless experience. Self-hosted facilitator processes payments automatically.

*API keys are needed only for additional analytics
and connections to NOT self-hosted facilitators.

npm install @puga-labs/x402-mantle-sdkCopied!
npx create-mantle-facilitatorCopied!

Powered by

System Status
IDLE / WAITING

User Client

Initiates request to premium API endpoint via HTTP.

GET /dataSending

API Gateway

Server validates payment headers. Returns a 402 error if the header is missing or invalid.

Waiting for response...

Mantle Facilitator

After user approval, it transfers USDC, automatically pays the gas fee through the Mantle network, and generates a payment header.

Auto-PaymentIdle

What is a facilitator and why is it needed?

A facilitator is a crucial component of the x402-mantle-sdk that handles blockchain micropayments automatically. It processes USDC transfers, pays gas fees through the Mantle network, and generates payment headers seamlessly—so your users never worry about transaction complexity. Choose the deployment option that fits your needs.

Types of facilitators

Self-hosted

FREE

Completely free and available to everyone. Launch your own facilitator instance with a single command and maintain full control over your payment infrastructure.

npx create-mantle-facilitatorCopied!

Hosted by @puga-labs

MANAGED

Perfect solution for developers who prefer a managed service. Simply top up your MNT balance in your personal dashboard and use our route with your API key—no infrastructure management required.

Sponsored by Mantle

COMING SOON

A future initiative providing subsidized facilitator access for qualifying projects. Stay tuned for updates on eligibility criteria and application process.

SDK - what it does
and how to set it up

Our SDK provides a seamless way to integrate HTTP 402 payment-required responses into your applications. It handles the complexity of blockchain micropayments, allowing you to focus on building your API.

The SDK is built with a modular architecture, supporting both frontend and backend implementations. It automatically manages payment headers, facilitator connections, and transaction states.

Key Features:

  • Automatic payment header generation
  • Built-in retry logic and error handling
  • Support for multiple frameworks
  • Type-safe TypeScript implementation

Frontend Integration

Primarily designed for React and Next.js applications. Shows how your code transforms when using our SDK.

Before:

// Your code placeholder
// Manual payment handling
// Complex state management
fetch('/api/data', {
  headers: { /* manual headers */ }
})

After (with SDK):

// With x402-mantle-sdk
import { useX402 } from '@puga-labs/x402-sdk'

const { data, pay } = useX402('/api/data')
// Automatic payment handling ✓

Backend Integration

Adapters available for popular frameworks: Express, Next.js API routes, Web Standards, and more.

Before:

// Your backend code
// Manual 402 response handling
// Payment verification logic

After (with SDK):

// With x402-mantle-sdk
import { withX402 } from '@puga-labs/x402-sdk'

export default withX402(handler, {
  price: '0.01' // USDC
})

Analytics - track all transactions in one place

By default, your data stays completely private—nothing leaves your infrastructure. But if you want detailed analytics, enable it with just a few lines of code.

1. Get your API key

Obtain an API key from your personal dashboard

2. Add API key to your code

2.1 Backend Integration

// Add to your backend code
const x402 = withX402(handler, {
  apiKey: 'your-api-key-here',
  price: '0.01'
});

2.2 Facilitator Configuration

// Add same key to facilitator
{
  "apiKey": "your-api-key-here",
  "facilitatorUrl": "..."
}

3. Access your dashboard and track all transactions

Dashboard Interface Preview

(Screenshot placeholder)