LIVE ON BASE MAINNET · X402 V2 · OFFICIAL MCP REGISTRY

Pay-Per-Call Settlement & Paywall Rails for AI Agents

APIs, MCP servers, and quant signal streams on Base; USDC or NGT; no accounts, no API keys, no ETH for gas.

import { ngtPaywall } from "@ngtchain/paywall";

app.get("/v1/quote", ngtPaywall({
  payTo: "0xYourWallet",
  accept: [
    { asset: "NGT", price: "0.001" },
    { asset: "USDC", price: "0.0025" },
  ],
  facilitatorKey: process.env.FACILITATOR_KEY,
}), (req, res) => {
  res.json({ paidBy: req.ngtPayment.payer });
});

@ngtchain/paywall@0.2.2 HTTP 402 middleware. Unpaid calls get an x402 v2 challenge. Paid calls settle USDC or NGT on Base, then your handler runs. npm install @ngtchain/paywall@0.2.2 viem

How it works

  1. 1

    The API asks for payment.

    Unpaid calls get HTTP 402 with price and payee.

  2. 2

    Your agent checks limits and signs.

    It signs locally only if the price fits your caps.

  3. 3

    Payment settles on Base.

    The facilitator pays gas; the response comes back.

Why use it

No signup or API key.

Payment proof travels in the request.

Policy controls belong at the wallet, not the prompt.

Caps per call and per session are enforced in code. Prices above your cap are refused before any signature.

pay_and_fetch("/premium")
Paid fetch failed: Refusing to pay 0.05 NGT; above the 0.005 NGT cap.

Real tool output · test seller · no funds moved

Open source. Key stays on your machine.

Packages are on npm. The key is never a tool argument.

Use cases

Pay-per-call MCP and APIs

Gate a route with ngtPaywall. Agents pay it with pay_and_fetch or payAndFetch, in USDC or NGT, with no account.

Quant signal feeds

Meter a signal stream per call. The reference feed is 0.001 USDC and returns sample data, not trading advice.

Gasless PaymasterAutoTopUp

The agent signs EIP-3009 and holds no ETH. The facilitator submits the transfer and pays Base gas.

Build it yourself OpenAPI · Node · Python Hide

OpenAPI

https://www.ngtchain.com/openapi.json

Node.js

// npm i @ngtchain/client@1.5.3
import { payAndFetch } from '@ngtchain/client';

const res = await payAndFetch(process.env.NGT_AGENT_PRIVATE_KEY, 'https://www.ngtchain.com/v1/agent/stream', { maxAmount: '0.001' });
console.log(res.data, res.payment?.transaction);

Python

import base64, json, requests
url = 'https://www.ngtchain.com/v1/agent/stream'
challenge = json.loads(base64.b64decode(requests.get(url).headers['payment-required']))
accepted = challenge['accepts'][0]
# Sign domain accepted['extra']['name'], then retry with the x402 v2 envelope.

Status

Early stage. NGT has no market yet, and paid checkout is paused.

Settled stream calls from NGT Transfer logs to the treasury at 0.001 NGT. Team wallets excluded. Source: GET /health and GET /v1/stats. SDK installs: GET /v1/npm-stats.

Status
…
All-time settled
…
Last 24 hours
…
Unique paying wallets
…
Last settlement
…
SDK installs
10,852+

Team test calls: …

Token details

Canonical NGT contract · Base Mainnet Active
0xc97b05F2F68D5CED7aB65F83ab5f4f7A64d9CC44

Fixed supply of 1,000,000,000 NGT.

Deployment 0x5fefd888dfe25b1705e358f6bfcef030799de983899c78d63acaf8c55dbb912e · block 52566773

Ecosystem

Protected by AgentExec and VPCShield pre-execution gates.