Reinkey documentation
Reinkey is payment infrastructure for APIs and AI agents on Stellar. It extends x402 with a payment channel scheme, so a payment is a signed voucher verified in about a millisecond instead of an on-chain transaction that takes five seconds.
There are three products. Use one, or all.
| Reinkey Meter | Reinkey Reins | |
|---|---|---|
| For | Sellers: APIs, data feeds, inference | Agent owners |
| Does | Charges per request, per token or per second | Gives an agent a spending account with on-chain limits |
| You install | @reinkey/meter | @reinkey/sdk |
| Start here | Meter quickstart | Reins quickstart |
Reinkey Float is the finance layer on top: a lending pool where agents work on uncollateralized credit, because funds in a Reins account handed to the pool cannot leave its policy. Read about Float.
Try it without installing anything
The testnet facilitator hosts a metered demo seller. An unpaid request returns the payment terms:
curl -i "$REINKEY_API/demo/book"HTTP/1.1 402 Payment Required
PAYMENT-REQUIRED: eyJ4NDAyVmVyc2lvbiI6Mi…The current testnet endpoint is https://reinkey.onrender.com. Examples in these docs refer to it as $REINKEY_API.
What runs where
- On-chain (Soroban contracts): the
channelcontract that holds deposits and pays sellers, and thereinkey-accountcontract that enforces an agent's policy in__check_auth. - Off-chain (the facilitator): verifies vouchers, keeps the highest accepted voucher per channel, and submits
claimtransactions. It never holds funds and cannot redirect them. - In your server:
meter()middleware. In your agent: the SDK.
Read How it works for the full picture.
Status
Testnet, unaudited. Everything here runs on Stellar testnet. The contracts have not been audited and the packages are pre-1.0. Interfaces may change.