for sellers · apis + mcp tools

Charge agents per call. In one line.

Put a USDC price on any route or MCP tool. Agents pay over x402 and the money settles to your wallet through Coinbase CDP, PayAI or thirdweb, from any country. We never touch it.

npm i @coinslot/paywall

packages land on npm with v0.1 — until then install from the repo

{ pay per call }

server.ts
app.use("/v1/*", paywall({
  payTo: process.env.WALLET!,
  routes: {
    "GET /v1/fact": "$0.001",
    "POST /v1/search": "$0.01",
  },
}))

Set a price, Point it at your wallet, Test on Base Sepolia, Go live

  1. 01

    Set a price

    One price for a whole prefix, or a price per route. Prices are dollar strings and settle in USDC.

    server.ts
    app.use("/v1/*", paywall({
      payTo: process.env.WALLET!,
      routes: {
        "GET /v1/fact": "$0.001",
        "POST /v1/search": "$0.01",
      },
    }))
  2. 02

    Point it at your wallet

    payTo is your address. The facilitator settles each payment straight to it. Nothing sits in between.

    typescript
    paywall({ price: "$0.002", payTo: "0xYourAddress", network: "base", facilitator: "cdp" })
  3. 03

    Test on Base Sepolia

    Run your server with network "base-sepolia" and make one real paid request with test USDC. You'll see the 402, the payment and the 200.

    terminal
    npx @coinslot/cli test http://localhost:3000/v1/fact
  4. 04

    Go live

    Switch the network to base or solana. Add a receipts key if you want the hosted dashboard. Ship.

    typescript
    paywall({
      price: "$0.002",
      payTo: process.env.WALLET!,
      network: "base",
      receipts: { apiKey: process.env.COINSLOT_API_KEY },
    })

for sellers · apis + mcp tools

Hono · Express · Next.js · MCP tool

Put the middleware in front of any route or MCP tool. Agents get a 402 with your price, pay in USDC and get the response. The money settles to your wallet through the facilitator you choose.

{ pay per call }

src/index.ts
import { Hono } from "hono"
import { paywall } from "@coinslot/paywall/hono"

const app = new Hono()

app.use("/v1/*", paywall({
  payTo: process.env.WALLET!,   // your address: USDC settles here
  network: "base-sepolia",      // "base" when you go live
  routes: {
    "GET /v1/fact": "$0.001",
    "POST /v1/search": "$0.01",
  },
}))

app.get("/v1/fact", (c) => c.json({ fact: "Octopuses have three hearts." }))

export default app

Bring your own facilitator.

The facilitator submits the transaction, and its own pricing applies. Coinbase CDP, for example, gives a free monthly allowance and then bills the seller a small fee per transaction. Coinslot takes no fee.

  • Base
  • Base Sepolia
  • Solana
  • Solana devnet
  • Polygon
  • Arbitrum

The default. CDP sets its own pricing: a free monthly allowance, then a small fee per transaction, billed to the seller. Coinslot adds nothing on top.

paywall({ price: "$0.002", payTo, facilitator: "cdp" })

The boring parts, done.

01

Idempotent by default

A retry with the same payment gets the stored response, not a second charge. Agents with flaky networks stop costing you support tickets.

{ never twice }

02

Rate limit per payer

Cap each paying wallet, say 60 calls a minute, so one agent with a full wallet can't crowd out the rest.

{ 60 / min / payer }

03

Receipts

Send each settled payment to the hosted dashboard: revenue per endpoint, payers, errors and responses that never got delivered.

{ every cent, logged }

04

x402 Bazaar listing

Optionally list your endpoint in the x402 Bazaar so agents can discover it. One description string.

{ get found }

05

Alerts

Telegram or email when errors spike or a paid call goes unanswered. Part of the hosted dashboard.

{ know first }

Revenue per endpoint, not per guess.

Every row is a settled payment with a link to the explorer. Filter by endpoint, payer or status, and see which paid calls failed to deliver.

app / seller / revenuedemo data
Revenue · 7d$48.91USDC
Paid calls20,4787 days
Payers287wallets
Undelivered6paid, no 200
Revenue per day USDC
EndpointPriceCallsRevenueDelivered
POST /v1/search$0.011,904$19.0499.7%
POST /v1/summarize$0.0052,210$11.0599.8%
GET /v1/fact$0.0019,812$9.8199.9%
GET /weather/now$0.0015,322$5.32100%
mcp · pdf.extract$0.0031,230$3.6999.4%
  • 12:04:31POST /v1/search0x71c…9a2e$0.01Paid0x8f3a…c21d
  • 12:04:29GET /v1/fact0x2b9…11f0$0.001Paid0x41de…07b3
  • 12:04:22GET /v1/fact0x2b9…11f0$0.001Replayed · not charged0x41de…07b3
  • 12:04:18mcp · pdf.extract0x9e0…c4d8$0.003Pendingsettling

faq

Fair questions.

{ pay per call }

No. You need a wallet address that can receive USDC. The facilitator verifies each payment and settles it on-chain.

Yes. Paywall speaks plain x402 V2. Any x402 client can pay, with or without Coinslot on its side.

The facilitator submits the transaction, and its own pricing applies. Coinbase CDP, for example, gives a free monthly allowance and then bills the seller a small fee per transaction. Coinslot takes no fee.

Yes. There's no country gate in the SDK. You need a wallet and a facilitator that serves you.

The dashboard shows paid calls that didn't get a successful response, per endpoint, so you see them before your users do. One-click refunds from your own wallet are planned for v0.2.

Yes. Wrap a tool handler in paidTool({ price, payTo }) and every call to that tool requires payment.

Your API already has a price. Now it has a slot.

{ pay per call }