Prepaid

Refill a prepaid API key (x402 payment)

Adds credits to an existing prepaid API key via x402 USDC payment on Base.

Flow:

  1. POST with just apiKey in body (no PAYMENT header) → returns 402 with payment instructions
  2. Sign an EIP-3009 transferWithAuthorization using EIP-712 typed data with domain {name: "USD Coin", version: "2", chainId: 8453, verifyingContract: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}
  3. Base64-encode the JSON payload {from, to, value, validAfter, validBefore, nonce, v, r, s} and retry with PAYMENT header

500 credits per $1 USDC. Minimum payment: $0.01 USDC.

post/prepaid/refill

Headers

PAYMENTstring

Base64-encoded JSON with EIP-3009 transferWithAuthorization signature. Shape: { from: address, to: address, value: string (USDC smallest units, 6 decimals), validAfter: number, validBefore: number, nonce: bytes32, v: number, r: bytes32, s: bytes32 }

Request body

apiKeystring required

The prepaid API key to refill

Response

Credits added successfully

apiKeystring
creditsAddedinteger
totalCreditsinteger
usageinteger
remaininginteger
txHashstring

Changes

No recorded changes to this endpoint across all 1 revision of this API.