Machine Payments Protocol (mpp.dev)

Your AI agent can fund the account by itself

No checkout page, no human in the loop. The agent asks for credit, receives an HTTP 402 payment challenge, pays it from an agent wallet and keeps working. The credit is added the moment the payment clears.

POST https://cloudlinux.ro/api/v1/billing/topup

Credit in seconds

The paid request returns the new balance in the same response, together with a signed receipt. The agent can order a server right after.

Transparent fee

The challenge is for the credit plus an online payment processing fee of 3.4% + €0.25. The credit added is exactly the amount requested.

Owner stays in control

Only verified accounts whose holder accepted the current terms. The agent pays with a Shared Payment Token the owner's wallet issues for this exact amount and merchant.

How it works

The endpoint follows the Machine Payments Protocol, an open standard co-authored by Stripe and Tempo. Any MPP-capable client works; the Link CLI handles the whole loop in one command.

  1. The agent calls POST /api/v1/billing/topup with the amount of credit it wants, using the account's API key as bearer token.
  2. The answer is 402 Payment Required. The WWW-Authenticate: Payment header holds the challenge: method stripe, the total in cents, our Stripe profile id and a five-minute expiry. The JSON body repeats credit, fee and total.
  3. The agent pays the challenge from its wallet, which issues a one-time Shared Payment Token (spt_…) scoped to this merchant and amount, and repeats the request with the credential in the Payment-Authorization header.
  4. We charge the token, add exactly the requested credit, issue the invoice (credit plus fee) and return 200 with the balance and a Payment-Receipt header.

Examples

First call, no credential yet: the server answers with the challenge.

curl -i -X POST https://cloudlinux.ro/api/v1/billing/topup \
  -H "Authorization: Bearer cl_your_token" \
  -H "Content-Type: application/json" \
  -d '{"amount": 20}'

HTTP/2 402
WWW-Authenticate: Payment id="…", realm="www.cloudlinux.ro", method="stripe",
  intent="charge", request="…", expires="…", header="Payment-Authorization", opaque="…"

{"error":"payment_required","credit":20,"fee":0.97,"total":20.97,"currency":"EUR", …}

Second call, credential attached: the server charges and credits.

curl -i -X POST https://cloudlinux.ro/api/v1/billing/topup \
  -H "Authorization: Bearer cl_your_token" \
  -H "Payment-Authorization: Payment <base64url credential with your spt_… token>" \
  -H "Content-Type: application/json" \
  -d '{"amount": 20}'

HTTP/2 200
Payment-Receipt: <base64url receipt>

{"data":{"credit_added":20,"fee":0.97,"charged":20.97,"currency":"EUR","balance":…,"payment":"pi_…"}}

With Stripe's Link CLI the two calls and the wallet payment are a single command:

npx @stripe/link-cli auth login
npx @stripe/link-cli mpp pay https://cloudlinux.ro/api/v1/billing/topup -X POST \
  -H "Authorization: Bearer cl_your_token" \
  -d '{"amount": 20}' --context "cloudlinux.ro credit top-up"

What it costs

The online payment processing fee is 3.4% of the total plus €0.25, grossed up so that after the payment provider's cut exactly the requested credit remains. Example: €20.00 of credit costs €20.97, of which €0.97 is the fee. The fee is invoiced together with the credit. Bank transfer deposits made by the account holder carry no fee.

Rules

  • Verified accounts only. The first deposit is always made by the account holder in the console; machine payments are never an account's first money in.
  • The account holder must have accepted the current Terms and Conditions in the console. Otherwise the endpoint answers 403 with a link to the terms.
  • Amounts from €5 to €5,000 per call. Challenges expire after five minutes and are bound to the account and amount; a changed amount or another account's token gets a fresh challenge, never a charge.
  • Any API key of the account works; no extra permission is needed because the agent is paying in, not spending. Spending the credit afterwards still goes through the key's permissions and spend limit.

Payment methods we accept

Agents pay today with cards through Shared Payment Tokens (Link agent wallet). Stablecoin payments over the same protocol are planned. People add credit on the payment page with the methods below.

  • Visa, Mastercard and other cards
  • Apple Pay
  • Google Pay
  • Link
  • PayPal
  • Revolut Pay
  • Bank transfer (proforma invoice)
  • AI agent payments (Machine Payments Protocol)