PipRail

Open x402 standard · verified live on mainnet

The payment layer for the agent economy.

Accept x402 crypto payments on every chain — or hand your AI agent a wallet to pay on its own. One line, 28 chains, USDC/USDT/native straight to your wallet. No middleman, no account, no fee.

$ npm install @piprail/sdk viem

Live on every major chain

Ethereum logoSolana logoTON logoTron logoNEAR logoSui logoAptos logoAlgorand logoStellar logoXRP Ledger logoBase logoBNB Chain logoArbitrum logoPolygon logoOptimism logoAvalanche logoHyperEVM logoMonad logoMantle logoLinea logoScroll logozkSync Era logoCelo logoSonic logoUnichain logoWorld Chain logoSei logoInjective logo

28

chains built in

0

protocol fee

1

line to integrate

MIT

open source

Two sides, one SDK.

The same package lets a server charge for a route and an agent pay for one. Pick your side — both are a couple of lines.

Accept — your server gets paid

Gate any route so it charges for itself. Express, Next.js, or any edge runtime — no backend, no database.

server.ts
import { requirePayment } from '@piprail/sdk'

app.get('/report',
  requirePayment({
    chain: 'solana',
    token: 'USDC',
    amount: '0.05',
    payTo,
  }),
  (req, res) => res.json({ data }),
)
Build a paid API

Pay — your agent pays for itself

Point an agent at a paid URL and it pays the 402 on its own — inside a budget it can’t exceed.

agent.ts
import { PipRailClient } from '@piprail/sdk'

const client = new PipRailClient({
  chain: 'arbitrum',
  wallet: { privateKey: process.env.KEY },
})

// On a 402: pays, then retries.
const res = await client.fetch(url)
Give your agent a wallet
Live demo

Don’t take our word for it. Run it in your browser.

Build a real 402 challenge and watch an agent price it — live, client-side, no install. The SDK loads from a CDN right on the page.

piprail.com/demo
402 Payment Required · Base · USDC
{
  "amount": "50000",
  "asset":  "0x8335…2913",
  "payTo":  "0xYourWallet"
}
🤖 agent pays 0.05 USDC ✓

One protocol. Every chain.

Every blockchain settles value its own way. PipRail collapses that behind a single x402 line and one self-custodial driver per family — so the same integration pays and gets paid across all 10, native coin or stablecoin. Backendless, no fee, no one in the middle. No other x402 SDK reaches this far.

EVM ×19 logo EVM ×19 Solana logo Solana TON logo TON Tron logo Tron NEAR logo NEAR Sui logo Sui Aptos logo Aptos Algorand logo Algorand Stellar logo Stellar XRPL logo XRPL

Widest coverage in x402

28 chains across 10 families, with native, self-custodial drivers — the only package that reaches TON, Tron, NEAR, Sui, Aptos, Algorand, and the XRP Ledger together.

Backendless by default

No facilitator, no relayer, no protocol fee. The payer broadcasts their own transfer, and you verify it against your own RPC — where most x402 stacks settle through a third party.

One line, zero infra

npm install, name a chain, add a wallet. Nothing to sign up for, deploy, or host — you’re charging agents in minutes.

How it works.

A four-step round trip over plain HTTP. No facilitator, no custody. See the full flow →

  1. 01

    Agent calls your route

    It gets back a 402 quote — price, token, payTo, chain.

  2. 02

    Agent pays on-chain

    One transfer, straight to your wallet. PipRail never touches the funds.

  3. 03

    You verify locally

    Your server checks the tx against your own RPC: succeeded, recent, right amount + recipient.

  4. 04

    You return the data

    200 OK — and the same proof can never be spent twice.

@piprail/mcp

Give your AI agent a wallet.

Paste one config block and Claude Desktop, Cursor, or any MCP client pays x402-gated APIs on its own — across 28 chains, capped by a spend policy it cannot exceed. No code, no backend, no custody.

  • piprail_discover — find payable APIs on the open indexes — the phone book
  • piprail_quote_payment — price a gated URL — without paying
  • piprail_plan_payment — check it can afford it: balance, gas, recipient-readiness
  • piprail_pay_request — fetch it, paying the 402 automatically
  • piprail_register — list an endpoint you run so other agents find it
claude_desktop_config.json
// claude_desktop_config.json — paste, restart, done
{
  "mcpServers": {
    "piprail": {
      "command": "npx",
      "args": ["-y", "@piprail/mcp"],
      "env": {
        "PIPRAIL_PRIVATE_KEY": "0x…",
        "PIPRAIL_CHAIN": "base",
        "PIPRAIL_MAX_AMOUNT": "0.10"
      }
    }
  }
}

npx -y @piprail/mcp — nothing to install. Then say “pay for and summarize that report.”

Payable isn’t the same as findable.

x402 lets your endpoint charge — PipRail makes it discoverable, built on the open x402 indexes that already exist. No registry, no database, no fee — nothing PipRail-hosted. Three opt-in moves:

Emit

Turn your gate’s config into a crawlable /openapi.json — a static file on your own origin.

Register

client.register(url) lists you on 402 Index — no auth, no signature, searchable in seconds.

Discover

client.discover({ query }) reads the open indexes so an agent finds what to pay.

28 chains, 10 families.

19 EVM mainnets plus Solana, TON, Tron, NEAR, Sui, Aptos, Algorand, Stellar & the XRP Ledger — each with its canonical stablecoins and native coin, ready to go. Any other chain works via one config object.

Browse every chain
Ethereum logoSolana logoTON logoTron logoNEAR logoSui logoAptos logoAlgorand logoStellar logoXRP Ledger logoBase logoBNB Chain logo +16

FAQ.

The essentials. More on the SDK, MCP, and Chains pages.

What is PipRail?

PipRail is an open-source (MIT) TypeScript SDK for x402 crypto payments. It lets any HTTP endpoint charge for itself, and lets AI agents pay for APIs on their own — across 28 chains, with no backend, no database, no account, and no fee. Payments settle straight to your own wallet, verified locally against your own RPC. It ships as two packages: @piprail/sdk (the library) and @piprail/mcp (an MCP server that hands any AI agent a budget-bound wallet). It also does x402 discovery, so endpoints can be registered on open indexes and found by agents.

What is x402?

x402 revives the dormant HTTP 402 "Payment Required" status code as a real payment protocol. A server answers a request with 402 plus a machine-readable challenge (price, token, chain, pay-to address); the caller pays on-chain and retries with proof, and the request goes through. It lets an HTTP endpoint charge for itself — no API keys, accounts, or invoices — which is exactly what AI agents need to pay for data and compute autonomously.

How do AI agents pay for APIs with PipRail?

Wrap the agent's HTTP calls with PipRailClient. Give it a wallet and a chain, then call client.fetch(url): on a 402 it reads the challenge, sends the payment on-chain, waits for confirmation, and retries with proof — automatically. An opt-in spend policy (maxAmount, maxTotal, chains, tokens, hosts) refuses out-of-bounds calls before any send, and paymentTools(client) hands the same to an LLM via MCP or function-calling — budget-bound so it can't overspend.

How do I let Claude or Cursor pay for things autonomously?

Install the PipRail MCP server: add a small config block to your MCP client (Claude Desktop, Cursor, Claude Code, Windsurf, VS Code, or Cline) that runs "npx -y @piprail/mcp" with your wallet key, chain, and spend caps. The agent gains five tools — piprail_discover (find payable APIs), piprail_quote_payment, piprail_plan_payment, piprail_pay_request, and piprail_register (list its own) — so it finds and pays x402-gated APIs on its own across 28 chains. It runs locally with your own wallet, and the spend policy is enforced before any on-chain send, so the model literally cannot overspend.

Which chains and tokens does PipRail support?

28 chains across 10 families: 19 EVM mainnets (Ethereum, Base, Arbitrum, Optimism, Polygon, BNB Chain, Avalanche, HyperEVM, Monad, Mantle, Sonic, Linea, Scroll, Celo, zkSync, Unichain, World Chain, Sei, Injective) plus Solana, TON, Tron, NEAR, Sui, Aptos, Algorand, Stellar, and the XRP Ledger. USDC almost everywhere, USDT on most chains, EURC on Stellar, RLUSD on XRPL, the native coin on every chain, or any other token by address. One parameter — chain — picks everything.

Is there a fee to use PipRail?

No. PipRail charges no fee and takes no cut. It's an open-source (MIT) npm package, not a platform or hosted service. Payments settle straight into your own wallet — there's no PipRail backend, facilitator, or middleman in the path. You pay only normal network gas on whichever chain you choose.

Get paid by agents in the next five minutes.

One install. One line. Straight to your wallet, on every chain that matters.

Building on the agent economy? PipRail is open to grants, chain integrations, sponsorships & strategic opportunities. Partner with us