x402 on Stellar settles every payment on-chain: five seconds and one ledger entry per call. Reinkey adds the missing piece, a session. Your agent, or any AI assistant over MCP, pays per request, per second or per token with signed vouchers at HTTP speed; the seller settles thousands of them in one transaction. The session's budget lives in the agent's own account on Stellar, not on a server.
Live on Stellar testnet. No custody, no sign-up, no API keys.
468 payments, 3 chain transactions
Budget enforced by the account, on-chain
Paid tool calls for any MCP client
agent-01 → demo-seller · stellar:testnetExample run
…channel.openwaiting for ledger…≈5 s
Vouchers
0
Transactions
0
Channel: spent / deposit
0.0000 / 1.0000
Paid
0.0000 USDC
Same work with exact
0 tx · ~0s
Built on
Stellar
Soroban
x402
USDC
Products
One rail, three products.
Reinkey solves all three sides: the seller charges for exactly what was used, the agent spends from an account whose limits are written on-chain, and capital lends to an account it can't escape from. Use one, or all.
For sellers
Reinkey Meter
Bill per request, per token or per second. One line.
Request, token or second: you pick the unit
Vouchers verify off-chain: median under 1 ms
Thousands of payments settle in one transaction
bash
# Pre-release: not on npm yet — until then build from https://github.com/devbugra/Reinkeynpm i @reinkey/meter
Open a channel, make calls, stream a response token by token. Watch the voucher count climb while the transaction count barely moves. Then push the cap: the rejection comes from the account, not from a server.
Vouchers
0
Transactions
0
Paid
0.0000 USDC
Same work with exact
0 tx · ~0s
agent-01 · stellar:testnet
On-chain
Pay the seller
Stream
The response will stream here token by token. One voucher every 50 tokens.
Simulation: runs in your browser and makes no network requests. Rules, prices and reason codes match the product; on-chain steps are shown as ≈5 s instead of actually waiting.
Account rules
Daily cap
5.0000
Per-transaction cap
1.0000
Allowed payee
demo-seller
Daily cap0.0000 / 5.0000
Channel: spent / depositNo channel
Request and response trace
No requests yet. Pick an action and each line shows up here with its source and timing.
The difference
A payment doesn't have to be a transaction.
Today · x402 exact
~5 s per payment · one transaction each
01Sign for every call
02Submit the transaction
03Wait for the ledger (~5 s)
04Repeat on the next call
1,000 calls = 1,000 tx ≈ 83 min
Paying per token isn't practical. The agent's spending limit is either missing or lives on a server.
Reinkey · x402 channel
~2 ms per payment · signed voucher, no chain
01Open the channel once
02Sign a voucher per call (milliseconds)
03The seller settles in one transaction
1,000 calls = 2 tx
Pay per token or per second. The limit lives on-chain.
Measured on testnet; ledger ~5 s.
The problem
Agents are spending money. The rails aren't ready.
Today's x402 flow turns every payment into its own transaction. Too slow for fast calls, too costly for tiny amounts, too blunt for permissions.
Every payment is a transaction
A ledger closes in about 5 seconds. Pay per call, and every request waits those 5 seconds.
Micropayments don't pencil out
Sending a separate transaction for a 0.00002 USDC per-token fee makes no sense.
Keys are all or nothing
Hand the agent your wallet and it can spend everything. Don't, and it can't do anything.
The owner sets up a Reinkey Account: a daily cap, a per-transaction cap and a list of allowed sellers. The rules are written on-chain.
channel.open ≈5 s · ledger
deposit1.0000 USDC
payeedemo-seller
expires+24h
daily_cap1.0000 / 5.0000
02
Open the channel
The agent opens a channel with the seller in one transaction and locks a deposit. The deposit counts against the daily cap, so a channel can't break the limit.
OKvoucher #9980.4990~2 ms
OKvoucher #9990.4995~2 ms
OKvoucher #10000.5000~2 ms
channel.claim1000 → 1 tx
refund → agent0.5000 USDC
03
Pay, stream, settle
Every request carries a signed, cumulative voucher that the seller checks in milliseconds. It all settles in one transaction, and whatever is left goes back to the agent.
Architecture
The facilitator can't touch the money.
Anyone can verify a voucher, and anyone can trigger settlement. Funds only ever go to the channel's seller.
Reinkey Account
Soroban smart account, __check_auth
Holds the funds and enforces the daily cap, the per-transaction cap and the allowed payees. A transfer that breaks the rules is rejected on-chain.
The agent can't send funds to itself or to an unapproved address
Channel contract
Deposit, vouchers, settlement
Locks the deposit, verifies the cumulative voucher, settles and refunds. Because vouchers are cumulative, double spending is structurally impossible.
open · top_up · claim · close
Facilitator
x402 channel scheme
Verifies vouchers, triggers settlement automatically before the session expires, and pays the settlement fee. It has no authority to withdraw funds.
exact is not enabled on the hosted facilitator
meter() middleware
One line in the seller's API
Prices an endpoint per call, per token or per second. Without payment it answers 402; with a valid voucher the request goes through.
app.get("/api", rk.meter({ price, unit }), handler)
Why Stellar: custom account auth (__check_auth), fee sponsorship, and transactions that cost a fraction of a cent.
Add meter() to an endpoint and 402 responses, voucher checks and settlement come built in. No subscriptions, invoices or dashboard setup.
Per token, second or call
The seller picks the unit. Payment keeps up mid-stream.
Non-custodial
Funds sit either in the agent's account or in the channel contract. The facilitator never holds them.
Caps enforced on-chain
daily_cap5.0000
per_tx_cap1.0000
payees[demo-seller]
__check_auth✓
The daily cap, per-transaction cap and allowed payees are written into the Reinkey Account and enforced by __check_auth. The limit holds even if a server goes down or gets compromised.
No XLM needed
The agent key holds no XLM. A relayer account you fund pays the agent's transaction fees; the facilitator pays for settlement.
Self-describing service
OpenAPI, llms.txt, MCP and the Bazaar catalog: an agent can discover and call the service without reading the docs. A paid endpoint lists itself after its first verified payment.
Honest limits
What this isn't, up front.
Channels take the payments in between off the chain; they don't make the chain itself faster. Opening a channel and settling it are still transactions, and a ledger still closes in about 5 seconds.
Opening and settling are on-chain transactions (~5 s); the payments in between are not
Channels are one-way: from agent to seller
The seller must settle before the channel expires; the facilitator does this automatically
Runs on Stellar testnet, not mainnet
The contracts haven't been audited yet
Who it's for
Anyone selling calls, tokens or seconds.
01
API and data sellers
Charge per call or per token, without subscriptions or invoices.
02
LLM and inference providers
Get paid for exactly the tokens you generate, with a budget that can stop mid-stream.
03
Agent developers
Give an agent spending power without handing over the wallet. The cap lives on-chain.
04
Platforms
Products that want to set a separate limit for each of their users' agents.
Pricing
Free on testnet. Volume-based after that.
Everything runs on testnet today, at no cost. Pricing for the hosted service isn't set yet; the contracts and middleware are open source.
No made-up numbers here: prices will show up once they're set.
Example seller prices
The example seller's endpoints are protected by meter(): the first request returns 402 with the terms, and a request carrying a voucher gets the response.
GET /demo/book0.0005USDC / call
POST /demo/chat0.00002USDC / token
Testnet USDC. Settlement fees are paid by the facilitator.
FAQ
Frequently asked
Do I have to trust the facilitator?
No. Vouchers are verified by the channel contract, and funds only go to the session's seller. The facilitator verifies, triggers settlement and pays the settlement fee; it can't withdraw anything.
What if the channel closes before the seller settles?
The agent can only close the channel after it expires and a grace period passes. The facilitator settles automatically before that happens.
Can the agent spend more than its deposit?
No. A voucher above the deposit is rejected by both the facilitator and the chain (CHANNEL_EXHAUSTED), and the stream stops mid-sentence.
Can the agent move funds to its own wallet?
No. The Reinkey Account only pays allowed payees, and the chain enforces it (PAYEE_NOT_ALLOWED).
Does the agent need to hold XLM?
The agent key doesn't. Opening a session is a Stellar transaction, paid by a relayer account you fund (friendbot on testnet). Every payment after that is off-chain, and settlement is paid by the facilitator.
Why Stellar?
Custom account auth (__check_auth), fee sponsorship and very low transaction costs. Together they make on-chain spending limits and cheap channel opens and settlements possible.
Is this a DEX?
No. It's a payment rail with spending permissions. Agents use it to pay whatever service they need.
Which version of x402?
channel is a new x402 scheme with the same headers as x402 v2. The exact scheme is not enabled on the hosted facilitator.
The endpoint is live. Call it.
Call it with your own agent. The first request returns 402 with the terms; sign a voucher if you have a channel, or open one if you don't.