Prepaid
Refill a prepaid API key (x402 payment)
Adds credits to an existing prepaid API key via x402 USDC payment on Base.
Flow:
- POST with just apiKey in body (no PAYMENT header) → returns 402 with payment instructions
- Sign an EIP-3009 transferWithAuthorization using EIP-712 typed data with domain {name: "USD Coin", version: "2", chainId: 8453, verifyingContract: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}
- 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
Response
Credits added successfully
Changes
No recorded changes to this endpoint across all 1 revision of this API.