Pay over HTTP 402

Buy prepaid credit for paid calls over HTTP 402: $5 for 500 calls, $20 for 2,000 calls, $50 for 5,000 calls. Without a credential: 402 with the challenges (MPP: a card through a Stripe Shared Payment Token, or USDC on Tempo or Base; x402: USDC on Base). Pay one and send the same request again with the credential. With x-api-key the credit goes onto that key's account; without one the top-up makes an agent account and returns its key (api_key, shown once), which holds the credit, and a claim link for its person. Send an Idempotency-Key header with both requests: the same key answers the same and never pays twice. A balance holds at most $100 (409 balance_full) and lasts 12 months from the last top-up; it pays for paid calls only, not an Audit Drive. A key's top-up while more than 50 calls are left: 409 balance_not_low unless force: true. The price includes any VAT, and every payment has a receipt. An EU business that sends its VAT ID gets our invoice. The answer has the balance and a receipt_url

post/api/credits/topup

Request

  • Base URL: https://agentdrives.com
  • URL: https://agentdrives.com/api/credits/topup
  • Auth: one of:
    • none
    • API key in header x-api-key

Headers

Idempotency-Keystring

A UUID of your own, the same on every retry of this top-up

Request body

amount_usdunknown required
agentstring

Without a key: your name as an agent, kept on the new account

forceboolean

Top up although the balance isn't low, or make another account from the same address

Example request

{
  "buyer": {
    "vat_id": "DE123456789",
    "country": "US"
  }
}

Response

Paid: the balance, the payment, its receipt (and a new account's key)

api_keystring

Without a key only: the new account's key, shown once (again only to the same Idempotency-Key)

replayedboolean

The same Idempotency-Key again: this is the first answer, nothing was charged twice

nextstring

Changes

No recorded changes to this operation across all 4 revisions of this API.