HTTP requests that pay— without leavingyour domain.

g402 is the managed payment layer for the x402 protocol. It brings native, pay-per-use payments to your APIs — under your own domain, not ours. We proxy payments, not traffic. Both clients and servers use Privy-backed wallets — created automatically, secured by design. No key handling, no blockchain setup, no checkout screens.

Not another hosted paywall — a domain-native protocol layer.

Most API monetization platforms host your paid endpoints on their domains. g402 runs payment logic under your own DNS, keeping your brand, SSL, and trust chain intact. If your API is api.yourdomain.com, we create g.yourdomain.com — an isolated edge gateway that enforces 402 payments and forwards valid requests upstream. You stay fully in control; we only manage payment negotiation and verification.

Feature Comparison

FeatureHosted Gatewaysg402 (Domain-Native)
Domain ownershipThird-partyYours (CNAME / A-record)
RedirectsYesNone
Wallet managementManual / user-sideAutomatic via Privy (client & server)
Transaction visibilityLimitedFull dashboard control
Lock-inHighZero

Two roles. One protocol. Seller & Buyer.

Seller Gateway
Seller Gateway SDK overview
  • Deploy a Cloudflare Worker or VM at g.yourdomain.com.
  • Enforce 402 at the edge; forward verified requests upstream.
  • Server wallets are also provisioned via Privy.
  • Configure pricing, facilitators, payouts in the Dashboard.
  • View transactions, set spending caps, and enforce usage limits.
Buyer SDK
Buyer SDK integration overview
  • Make any app, agent, or backend job x402-compatible.
  • Auto-detects and resolves 402 responses (no UI prompts).
  • Uses a Privy-backed wallet for signing & payments (no keys).
  • Optional Bring-Your-Own-Wallet (BYOW) for advanced users.
  • Works with fetch() or your HTTP client.

From request to verified response — in four lightweight steps

1

Client calls your gateway

The Client SDK sends a request to g.yourdomain.com and detects x402 requirements.

2

Edge enforcement

Gateway checks for valid payment proof or returns structured 402 metadata.

3

Privy wallets handle payment

Wallets for both sides are provisioned by Privy — no keys, no UI; BYOW optional.

4

Forward & respond

After verification, the request is proxied to your API and returns normally.

Feature highlights

Domain-Native Architecture

Stay under your own DNS. No third-party URLs, no redirects.

Privy-Backed Wallets

Clients & servers auto-provisioned, no keys, crypto-optional.

Agent-Ready Payments

Built for autonomous clients and backend agents — no UI needed.

Bring-Your-Own-Wallet (Optional)

Users can link an external wallet; Privy handles the switch.

Full Transaction Dashboard

Monitor every payment & refund; set caps, budgets, alerts.

Flexible Monetization

Pay-per-use, subscription, or hybrid — per route.

Edge-Native Enforcement

Cloudflare Worker / VM with sub-100 ms latency.

Facilitator & Payout Controls

Choose processor and settlement rules; zero lock-in.

Examples for both sides

Seller SDK (Cloudflare Worker)

export default async function handler(request) {
const payment = await verifyPayment(request)
if (!payment) {
return new Response('402 Payment Required', { status: 402 })
}
return await forwardToUpstream(request)
}

Buyer SDK

import { g402Client } from '@g402/sdk'
const client = new g402Client({
gateway: 'g.yourdomain.com',
wallet: 'privy' })
const response = await client.fetch('/api/premium')

What you get

All transactions visible in the Dashboard
Spending caps per client ID
Facilitator settings & payout schedule
Live analytics

FAQ

To preserve trust, SSL, and latency — enterprise compliance ready. g402 enforces payments without taking over your URL.

No. All wallets are provisioned and secured by Privy — no exposed keys.

Yes. BYOW via Privy — seamless external wallet linking when desired.

No. Payments happen automatically via the SDK; ideal for agent/API calls.

The Dashboard lets you track all txs, spending caps, budgets, and alerts in real time.

Facilitator-dependent and configurable. Set thresholds and AML rules from your Dashboard.

Ready to Get Started?

Join thousands of developers building the future of API monetization.