credits

Buy credits over the Machine Payments Protocol (MPP): an agent pays with no checkout page

Changed on

Two 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.

post/api/v1/credits

Request

  • Base URL
    https://www.orgo.ai
  • Auth
    HTTP bearer

Headers

Payment-Authorizationstring

The MPP credential for one of the 402 challenges: Payment <base64url>. Omit it to get the challenges.

Request body

amount_usdnumber required

Dollars of credit to buy, at most 2 decimals.

Response

Paid and credited. The Payment-Receipt header carries the MPP receipt.

credited_usdnumber required
balance_usdnumber nullable required

The account’s credit balance after this top-up.

duplicateboolean

True when this payment had already been credited. Nothing was added again.

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

      endpoint added