Meterdoor 0.1.0
Meterdoor: docs
Everything that matters before you integrate: demo, quickstart, flow, limits and the status of each feature.
Try it locally, no keys needed
The demo shows both payment paths on your own machine, before you buy anything or create an account.
Simulation: Stripe, the x402 facilitator and the blockchain are simulated in the same process. You need no accounts and no keys, no money moves, and nothing leaves your machine. There is no public online demo.
What the demo looks like
Recordings of the real demo from core 0.1.0, generated automatically. Everything in it is simulated: example prices, no real money. The demo interface is in German.



Requirements
- Node.js 20 or newer, with npm
- Git
- a browser
Steps
The working directory is the meterdoor folder created by git clone. There, npm run demo starts a server on 127.0.0.1 only; open http://127.0.0.1:8402/. The demo stops after 10 minutes or with Ctrl+C. The demo interface is in German.
You will see five cases: payment required, euros through a simulated checkout, USDC through a simulated agent, replaying the same payment proof without a second charge, and an unclear settlement that is resolved via the (simulated) chain. If environment variables that look like real credentials are set, the demo refuses to start.
git clone https://github.com/WestLabsAI/meterdoor cd meterdoor npm install npm run demo # then open in your browser: # http://127.0.0.1:8402/
Flow per payment path
What a person in a browser and an AI agent each get for their payment.
Time-limited access
Person in a browser · euros via Stripe
- Request without payment: redirect to Stripe Checkout
- Pay once in euros (sample price: €0.50)
- Access to exactly this endpoint for the configured duration from payment (example: 1 hour)
- Unlimited requests until expiry; redeeming again does not extend it
Pay per request
AI agent · USDC via x402
- Request without payment:
402with payment requirements - Agent pays (sample price: 0.01 USDC) and sends the proof in the
X-PAYMENTheader - Response for exactly this request
- New request: new payment. The same proof again (e.g. after a dropped connection): the same response without a second charge, for one hour by default. Stored responses are not evicted during that time; if the store is full, a new paid request is rejected before settlement instead (current source; in the npm package 0.1.0 a full store may evict already handed-over responses earlier, a replay then ends with 402 without a second charge)
Prices and duration are sample values from the code example; you set both yourself. Stripe requires at least €0.50 per payment.
Quickstart: add it to your Express app
Meterdoor 0.1.0 is on npm. You install it into your project like any other package. Tested with Express 4 and Node.js 20 or newer.
Prefer a ready-made project? The starter starter/express is a working Express API with one paid endpoint: add a wallet address or a Stripe test key, npm install, npm run dev. Includes tests, free under Apache 2.0. No server of your own: deploy it on Railway in one click (enter a wallet address; Railway bills its usage to your own Railway account).
The example server.js (Express). The tabs show the flow in a browser and for an agent.
import express from "express"; import { paywall } from "meterdoor"; const app = express(); app.set("trust proxy", 1); app.get("/api/report", paywall({ price: { eur: "0.50", usdc: "0.01" }, stripe: { key: process.env.STRIPE_KEY }, x402: { payTo: process.env.WALLET, network: "base-sepolia" }, access: { secret: process.env.ACCESS_SECRET, ttlSeconds: 3600 }, }), (req, res) => res.json({ report: "…" }) ); app.listen(process.env.PORT || 3000);
# 1. Browser requests the route without payment GET /api/report Accept: text/html HTTP/1.1 303 See Other Location: https://checkout.stripe.com/c/pay/cs_test_… # 2. Back from Stripe after payment GET /api/report?pw_session=cs_test_… # Session verified: token with a fixed expiry # (payment time + ttlSeconds, here 3600 s) HTTP/1.1 303 See Other Set-Cookie: pw_token=v2.…; HttpOnly; SameSite=Lax Location: /api/report # 3. Unlimited requests until expiry GET /api/report Cookie: pw_token=v2.… HTTP/1.1 200 OK { "report": "…" }
# 1. Agent requests without payment GET /api/report Accept: application/json HTTP/1.1 402 Payment Required { "x402Version": 1, "accepts": [{ "scheme": "exact", "network": "base-sepolia", "maxAmountRequired": "10000", "payTo": "0x…" }], "checkout": "…/api/report?pw_checkout=1" } # 2. Agent pays 0.01 USDC and retries GET /api/report X-PAYMENT: eyJ4NDAy… # verify → your route → settle HTTP/1.1 200 OK X-PAYMENT-RESPONSE: eyJzdWNj… { "report": "…" } # New request: new payment. Same proof again: # stored response, no second charge.
-
Install
In your app's folder. Meterdoor is an ES module: your
package.jsonneeds"type": "module".Terminal · in your app's foldernpm init -y # only for a new app npm pkg set type=module npm install express@4 meterdoor -
Protect a route
Save the code from the Express tab as
server.js. In an existing app, the import and thepaywall()block in front of your route are enough; behind a proxy, also addapp.set("trust proxy", 1).If you only want one payment path, leave out the other price: without
eurno Stripe key is needed, withoutusdcno wallet. -
Set environment variables and start
Example · .env file (do not commit)STRIPE_KEY=sk_test_… WALLET=0x… ACCESS_SECRET=…
STRIPE_KEY- Stripe test key (
sk_test_…orrk_test_…), for the euro path. WALLET- Your receiving address on Base Sepolia, for the USDC path.
ACCESS_SECRET- Long random string; signs the access tokens of the euro path.
PORT- Optional, default 3000.
Start with
node --env-file=.env server.js(Node 20.6 or newer; otherwise set the variables in your shell).Check:
curl -H "Accept: application/json" http://localhost:3000/api/report(in Windows PowerShell usecurl.exe) returns402with the payment requirements. In a browser, the same request redirects to Stripe Checkout in test mode; this needs a valid test key.
Is Meterdoor a fit for your endpoint?
The main limits before you integrate. Details are in the README in the repository.
Good fit
- Self-contained data responses and reports, e.g. JSON analyses (with x402, up to 1 MiB per response by default)
- Endpoints that people in browsers and programs both call
- Trials on the Base Sepolia testnet and in Stripe test mode
Not a fit
- Actions with side effects such as orders or sending e-mail: with x402, your route runs after verification but before final settlement. If settlement fails, the action has still happened.
- Streaming: with x402, the response is fully buffered and only sent after settlement.
- x402 schemes other than
exact(e.g.upto) and Permit2: onlyexactwith EIP-3009 (USDC) is accepted, in x402 version 1 and 2.
Good to know
- Storage: the default store lives in memory and is lost on restart, together with the responses stored for replays. The bundled file store (
fileStore) survives restarts; multiple processes on the same machine, no network drives. - Refunds: x402 does not refund automatically; the middleware reports open cases.
- Mainnet:
baseonly with the explicitallowMainnetoption.
Features and status
The core is free to use. Pro adds the parts you need in production and is in pre-sale.
Levels: tested locally (simulated) = automated tests with simulated counterparts pass; tested externally = test against the real test service passed (with date); planned = not available yet. Skipped tests do not count as passed. Status: 26 Oct 2026.
Availability: in the public core and tested against the real test service or in a browser, not yet with real money · experimental in the public core, tested only against simulated counterparts · pre-sale part of Pro, not shipped yet.
| Feature | Part and availability | Status | Local evidence |
|---|---|---|---|
| Euros via Stripe Checkout, time-limited access to one endpoint | Core | tested locally (simulated); Stripe test mode tested externally on 23 Oct 2026 (session creation, unpaid and unknown sessions rejected) | npm test, demo |
USDC per request via x402 version 1 (X-PAYMENT), Base Sepolia | Core | tested locally (simulated); real test payment (testnet, no value) against the public facilitator tested externally on 25 Oct 2026 | npm test, demo |
| One endpoint detects browser or agent | Core experimental | tested locally (simulated) | npm test, demo |
| Replay of the same proof without a second charge | Core experimental | tested locally (simulated) | npm test, demo |
| Resolving unclear settlements via the chain | Core experimental | tested locally (simulated) | npm test, demo |
| File store for restarts | Core experimental | tested locally (simulated) | npm test |
| Binding to parameters or body | Core experimental | tested locally (simulated) | npm test |
| Demo without keys | Core | tested locally in a browser | npm run test:demo |
USDC per request via x402 version 2 (PAYMENT-SIGNATURE), Base Sepolia | Core | tested locally (simulated); real test payment (testnet, no value) with the official client @x402/fetch tested externally on 25 Oct 2026 | npm test |
| Quotas and bundles (e.g. 100 requests) | Pro pre-sale | tested locally (simulated) in the pre-release; not shipped | pre-release tests, not public |
| Log of all payments on both paths as CSV | Pro pre-sale | tested locally (simulated) in the pre-release; not shipped | pre-release tests, not public |
| Reconciliation with Stripe webhooks | Pro pre-sale | tested locally with simulated webhook events; not shipped | pre-release tests, not public |
| Delivery of Pro, 12 months of updates and e-mail support | Pro pre-sale | planned: no later than 3 weeks after payment | – |
The commands run in the cloned repository without accounts and without keys. Tests against real test services live in integration/ and need your own test credentials; without them they are skipped.
Pro in detail
What Pro adds to the core and what its output looks like. Pro has not shipped yet; the output below comes from the pre-release version.
Quotas
Packages such as “100 calls” per account. A call is only deducted when your route has fully delivered a 200–299 response; errors, redirects and aborted connections do not count. When the balance is empty, the core paywall or a 402 response takes over.
Payment log
All payments from both paths and all quota bookings in one file, exported as CSV in three views: events, payments, movements per month. With protection against formulas in spreadsheet programs.
Webhook reconciliation
Credit package purchases from Stripe webhooks, reverse full refunds. Each event takes effect at most once, even if Stripe delivers it several times.
Example output: payment overview
Three payments: a person pays in the browser, an agent pays via x402 and sends the same proof twice, a customer buys a package of 100 calls, and Stripe delivers the purchase twice.
zahlung;weg;status;betrag;waehrung;einloesungen;wiederholungen;konto;einheiten stripe:cs_test_1;stripe;bestaetigt;0.50;EUR;1;0;; x402:base-sepolia:0x…ab:0x…01;x402;bestaetigt;0.50;USDC;0;1;; stripe:pi_beispiel;stripe;bestaetigt;19.00;EUR;0;0;kunde-42;100 # Totals per currency EUR paid 19.50 refunded 0.00 net 19.50 USDC paid 0.50 refunded 0.00 net 0.50 # Quota of kunde-42 after three calls available 97 · reserved 0 · used 3
Generated on 13 Nov 2026 with the Pro pre-release 0.1.0-vorab.4 and the simulated counterparts from the tests (simulation, example prices of the test setup, no real money); columns shortened, IDs abbreviated. Column names are German in the current version. The duplicate Stripe delivery creates no second credit, the repeated x402 proof no second payment.
More questions
Is there an online demo?
No. The demo runs on your machine, without accounts and without real payments; the steps are under Try it locally, no keys needed.
What does it cost to run besides the license?
Stripe charges its usual fees on your account. For x402, network or facilitator fees may apply, depending on the facilitator you choose. There are no recurring costs from us.