Buy credits over the Machine Payments Protocol (MPP): an agent pays with no checkout page
Changed onTwo requests, per MPP (https://mpp.dev). First send the body with your API key and no payment: the answer is 402 with one WWW-Authenticate: Payment ... challenge per way to pay (method="stripe": a Stripe Shared Payment Token from a card or Link wallet; method="tempo": USDC on Tempo, where offered). Pay one challenge and send the SAME request again with the credential in Payment-Authorization: Payment <credential> (your Authorization: Bearer key stays as it is). A challenge is signed by Orgo, bound to your account and this amount, and expires in 5 minutes; a credential is accepted once. MPP clients do this for you: npx mppx <url> -H "Authorization: Bearer $ORGO_API_KEY" -J '{"amount_usd":10}', or fetch patched by Mppx.create({ methods: [...] }) from mppx/client.
Credits are added to the account that owns the key, one dollar of credit per dollar paid. Account-wide keys and signed-in sessions only. Over the limit of 20 requests a minute per key the answer is 429.
Not every environment takes MPP: where it is off the answer is 503 mpp_off. A person can then buy credit from a Checkout link: POST /api/credits/checkout {"amount_cents": 1000} answers its url.
Request
- Base URLhttps://www.orgo.ai
- AuthHTTP bearer
Headers
The MPP credential for one of the 402 challenges: Payment <base64url>. Omit it to get the challenges.
Request body
Response
Paid and credited. The Payment-Receipt header carries the MPP receipt.
Changes
- info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status
- info
- info
endpoint added
- info