MPP - Agentic Payments
Let an agent pay per request from its own wallet over MPP: no account, no API key, the same models and prices.
An agent can pay for inference itself, request by request, with no account and no API key. It pays over MPP, the open machine payments standard co-authored by Tempo and Stripe, from a Tempo wallet. Same models, same gateway, same per-token prices as the rate card. The overview is at boundless.network/mpp.
Real money: the MPP endpoint runs on Tempo mainnet (chain 4217) and takes USDC.e, MACH or OUSD, each priced 1:1 with USD.
The MPP endpoint#
| Route | Paid | What |
|---|---|---|
POST /mpp/v1/chat/completions |
yes | OpenAI Chat Completions |
POST /mpp/v1/responses |
yes | OpenAI Responses |
GET /mpp/v1/models |
no | The models sold over MPP, with prices in USD per 1M tokens |
GET /mpp/setup |
no | The setup guide every 402 links to, written for an agent to follow |
Supported client: Nanocode#
Right now the supported client is Nanocode, the coding agent, run with --gateway tempo: its model requests are paid over MPP from a Tempo wallet. A plain OpenAI client stops at the 402. It needs an MPP client to open the session and sign each request. nanocode --help documents the --gateway and --tempo-* flags.
Install the Tempo wallet, log in, and install Nanocode from source (needs a Rust toolchain; Nanocode's prebuilt release does not have --gateway tempo yet):
Fund the wallet with a few dollars of USDC.e, OUSD or MACH on Tempo mainnet (tempo wallet fund --mach). A wallet paying with MACH must also hold a few cents of USDC.e: MACH's transfer policy lets it move only to approved addresses, so it can't pay Tempo gas, and the channel open and each top-up pay their network fee (a fraction of a cent) in USDC.e. Keep it small: a session locks only its deposit, and the unspent part comes back when the session closes. If cargo can't fetch a pinned revision, set CARGO_NET_GIT_FETCH_WITH_CLI=true.
Run it against the MPP endpoint:
models after the flags lists the endpoint's models, exec runs one prompt without the terminal interface, and -m picks a model:
With --gateway tempo and --gateway-base-url set:
- The models are the ones the endpoint lists at
/mpp/v1/models;-mpicks one, and the first listed is the default. The Claude modelsnanocode modelsalso shows use your own Claude login, not the endpoint. - The chain comes from the endpoint's payment challenge, so on Tempo mainnet it pays USDC.e by default.
--tempo-network mainnetpins the chain. --tempo-currencypicks the token:usdc.e,machorousd.- The session deposit is 1 token by default.
--tempo-depositchanges it, in base units with 6 decimals. - Concurrent runs each pay from their own session.
--tempo-session <name>pays from a named one instead. NANOCODE_GATEWAY=tempoin the environment stands in for--gateway tempo, and every--tempo-*flag has aNANOCODE_TEMPO_*variable:NANOCODE_TEMPO_NETWORK,NANOCODE_TEMPO_CURRENCY,NANOCODE_TEMPO_DEPOSIT,NANOCODE_TEMPO_SESSION,NANOCODE_TEMPO_KEEP_SESSION.
Inside a session, /spend shows what each model cost.
How you are charged#
- An unpaid request gets
402 Payment Requiredwith aWWW-Authenticate: Paymentchallenge. - The client opens a payment channel with a small deposit (1 USDC.e suggested) and signs a voucher per request.
- Each request first holds its worst case: every body byte counted as an input token, plus the output limit.
- It is then charged the tokens the model actually used, at the listed prices. Cached input is charged at the cache rate.
- A request the model fails to answer is refunded.
- Closing the session refunds the unspent deposit to your wallet.
Wallets are screened against sanctions lists when they open a session.
Closing a session#
- Nanocode closes its session cooperatively on exit, and the unspent deposit comes back at once.
--tempo-keep-sessionkeeps the session open for the next run. - With the Tempo wallet,
tempo wallet sessions closesends an on-chain close request. If the session has unsettled spend, the endpoint answers with its own close within about 2 to 4 minutes, settling that spend and refunding the rest. With nothing unsettled, your wallet withdraws the deposit after the 900-second grace period.
Not supported over MPP#
These are refused before any payment:
norbest_ofabove 1previous_response_id,conversation, and stored prompts or items- Images or files by URL (send them inline as
data:URLs)
For anything MPP doesn't cover, use an API key and prepaid credits.