Skip to main content
POST
Top Up Guest Wallet Credits for X API Reads
Add credits to an existing guest wallet. The wallet keeps the same paid_reads key. This endpoint creates a one-use hosted checkout only after the user confirms the amount. It does not charge the user.
Never call this endpoint automatically after a 402. Show the available option and amount, then wait for explicit user confirmation.
Keep the current guest key and store the new Idempotency-Key as a secret. Give only checkout_url to the user. After payment, poll status_url every poll_after_seconds with the same key. Stop when latest_purchase.status is no longer pending. Use usable to decide whether paid reads can run.

Headers

string
required
Send the guest key as Bearer xq_your_guest_key_here.
string
required
Must be application/json.
string
required
A new cryptographically random UUID v4. Reuse it only for an exact retry of this top-up request.

Body

integer
required
Confirmed USD amount in cents. Minimum 1000 and maximum 25000.
string
required
Must be usd.

Response

boolean
Always false.
object
Confirmed amount in minor units and usd currency.
string
One-use hosted checkout URL for the user to open.
string
Credits to grant after verified payment.
string
Pending checkout expiry.
string
Required user interaction and polling guidance.
string
Guest purchase ID.
string
Guest wallet status URL.
integer
Minimum polling delay. Always 2 while pending.
boolean
Always true.
string
Initial top-up status. Normally pending.
string
Existing guest wallet ID.
This response never returns a new API key.
The response sends Cache-Control: no-store, private. An exact replay also sends Idempotent-Replayed: true.