Buy Credits (machine payment)
Buy credits for the account owning the API key, paid by the caller itself over the Machine Payments Protocol (MPP, https://mpp.dev). No checkout page and no card form.
The first call answers 402 Payment Required with a WWW-Authenticate header carrying two Payment challenges, one for USDC on Tempo (method "tempo") and one for card or Link via a Stripe shared payment token (method "stripe"). The client pays one of them and repeats the same request with the payment credential; any MPP client (mppx, the Stripe Link CLI) does this automatically. The repeated request answers 200 and the credits are on the balance at once.
Rules: $0.02 per credit, minimum 25 credits, maximum 50,000 per call. Card top-ups are capped at $100 per account per rolling 24 hours; over the cap the 402 offers USDC only, which is uncapped. A trial account moves to the Starter pay-as-you-go price table on its first top-up and no subscription is created. A payment credential never credits twice: a replay answers 200 with status "already_credited".
Pay from the command line with a USDC wallet (npx -y mppx@0.9.2 https://api.myotp.app/v1/topup -X POST -H "x-api-key: KEY" -H "content-type: application/json" -d '{"credits":100}') or with a Link agent wallet (npx -y @stripe/link-cli mpp pay https://api.myotp.app/v1/topup -X POST -d '{"credits":100}' -H "x-api-key: KEY" --context "Buying MyOTP.App credits to send one-time passcodes over SMS, WhatsApp and Telegram for phone verification in my app.").
Request
- Base URL: https://api.myotp.app
- URL: https://api.myotp.app/v1/topup
- Auth: none declared. Required headers: X-API-Key
Headers
API key for authentication. Credits go to the account owning this key.
The payment credential, sent by the MPP client on the retried request after paying one of the challenges from the 402. Absent on the first request.
Request body
Response
Payment accepted and credits applied. status is "credited" on the first settlement of a credential and "already_credited" when the same credential is replayed.
Changes
No recorded changes to this operation across all 1 revision of this API.