Skip to main content
POST
Starts a prepaid credit top-up. This call never charges anything. It creates a PENDING top-up and returns a Stripe Checkout checkoutUrl that a signed-in human must open and pay; once checkout completes, the credits land automatically. The link expires unpaid after ~24 hours (expiresAt). Learn the outcome by polling GET /credits/top-ups/{topUpId} until the status is COMPLETED, then confirm the new balance with GET /credits. Requirements: payments:write scope + the public_api_credits feature + a claimed account (unclaimed accounts get 403 with details.reason: "account_claim_required" and a claimUrl).

Request

amountUsd
number
required
Top-up amount in US dollars. Minimum 10,maximum10, maximum 10,000. (amount is accepted as an alias.)

Response

Returns 201 — the top-up exists, but no money has moved until the human pays the checkout link.
topUpId
string
The top-up ID, for polling.
checkoutUrl
string
Stripe Checkout URL — show it to your human so they can complete the payment.
expiresAt
string | null
ISO timestamp when the unpaid checkout link lapses (~24h).
topUp
object
The full top-up record: {id, status: "PENDING", amountCents, createdAt, completedAt, expiresAt} — same shape as GET /credits/top-ups/{topUpId}.
message
string
Explains the human-payment handoff.

Errors