Open source · Apache-2.0

Put a price on any endpoint.

Humans and AI agents pay your API per request, in stablecoins. Speaks x402 and MPP. One line to integrate.

$npx goldrail dev

Built by 🟠 Goldsky

60 seconds · fake money included
$ npx goldrail dev :4402 · mock facilitator · wallet funded $ curl -i localhost:4402/api 402 Payment Required # quotes are free $ goldrail pay localhost:4402/api 200 OK goldrail-funding: settled # funds a balance… $ goldrail pay localhost:4402/api 200 OK goldrail-funding: credit # …next ~999 are free
How it works

One router in front of your API

Payments verify locally and debit a prepaid balance. Facilitators only see real money moving.

Apps fetch · curl AI agents MCP · x402 GOLDRAIL :4402 Challenge x402 + MPP in one 402 Verify · debit local — no round trip Route · settle budgets · failover prepaid balance every unit ledgered Your API unchanged FACILITATORS Circle CDP · Stripe
request served from credit settle — refills the balance
served 0 facilitator calls 0 ratio

demo runs ~8 requests per settle so you can see it — production is ~1,000

~1M/daypaid requests in production
~1,000×fewer facilitator calls
1 lineto integrate
2 protocolsx402 + MPP
Features

Everything a paid API needs

Credit rail

One settle, ~1,000 requests

Verify locally, debit a balance. No facilitator in your hot path.

Router

Protocols are routes, not bets

x402 and MPP in one 402. New chains and facilitators plug in.

Failsafe

Failover, budgets, breakers

Throttled facilitator reroutes. A lying one gets benched.

Live pricing

No deploy to change a price

Versioned config in your DB. Apply from CI, roll back instantly.

Fail dials

Experiments can't cause outages

Shadow mode prices traffic before charging. Fail-open per route.

Ledger

Revenue you can audit

Atomic units, reconciled against the facilitator. Per-payer statements.

Agent-native

Agents find and pay you

Discovery endpoints, built-in MCP, spend-capped payer tools.

Observability

Metrics and dashboards, wired

Prometheus, OTel traces, Grafana packs included.

Enterprise

SOC 2 evidence built in

SSO, RBAC, tamper-evident audit chain, one-command audit pack.

Quickstart

Charging in five minutes

No wallet. No signup. No real money. goldrail dev ships a mock facilitator and funded test wallets.

brew install goldsky-io/tap/goldrail # or cargo, or docker goldrail init # scaffold a priced route goldrail dev # mock money, admin panel, chaos API goldrail serve # production, same binary
npm install goldrail import { goldrail } from "goldrail"; app.use(goldrail()); // that's it app.use("/ops", goldrail.admin()); // optional panel
cargo add goldrail-tower let app = Router::new() .merge(api) .layer(GoldrailLayer::from_env()?); // prices live in config
go get github.com/goldsky-io/goldrail/sdk/go handler = goldrail.Middleware(handler)
goldrail mcp # one tool: paid_fetch(url) const fetch = paidFetch(wallet, { maxPerRequest: 5000n }); # selling? your catalog is already published: # /.well-known/x402 · llms.txt · MCP
Prove it works without writing a test: goldrail conformance --against localhost:3000 — and it refuses to run against mainnet.
Compare

Who owns your payment path?

Coinbase middlewareCloudflare gatewayGoldrail
modelembed the protocolrent the gatewayown the layer
protocolsx402 onlyx402 onlyx402 + MPP
fundingsettle every requestsettle every requestprepaid credit
price changesredeploytheir dashboardlive, versioned
ledgernonetheir analyticsbuilt in
runs wherein your apptheir edgeanywhere
lock-infacilitatorplatformnone

Full comparison in docs/comparison.md.

Born in production

Every rule was paid for with real money

Goldrail runs Goldsky's edge — ~1M paid requests a day. The scars are the spec.

A hidden rate limit refused 96% of settles.→ credit rail + auto-tuned budgets.
A price change clients couldn't converge on.→ every 402 says exactly what to sign.
A revenue dashboard wrong by 1000×.→ revenue counted in units settled.
A timeout is not a failure.→ ambiguous settles resolve, never blind-retry.