Credits
Twitter API billing: instant X API credit top-up
Charge a saved method for USD 10-500 in the Xquik dashboard. Handle authentication, declines, and checkout fallback without double billing or server errors.
- 200
- 400
- 401
- 429
POST
Twitter API billing: instant X API credit top-up
Add API credits from the Xquik dashboard with a saved payment method.
At USD 0.00015 per credit, a USD 25 quick top-up adds 166,666 credits, rounded down to whole credits.
Only
The request body is missing a numeric
Missing or invalid API key.
Too many requests. Wait for the
Add API credits with a saved payment method
Use quick top-up after the dashboard confirms an amount from USD 10 through 500. This route requires a same-origin Xquik session. External integrations must use the hosted top-up endpoint. Readoutcome before handling any other response field. charged means the
credits and new balance are ready. requires_action means the client must
complete payment authentication. declined means the saved method failed.
no_payment_method means the account has no reusable payment method.
Never print or persist clientSecret. Pass it directly to the payment
confirmation flow. Log only the outcome, added credits, and resulting balance
after a successful charge.
Quick top-up differs from standard checkout status. The status route polls a
hosted checkout session by session_id. This route returns its own immediate
payment outcome for the saved payment method.
Free - does not consume credits
Headers
string
required
Must be
application/json.Body
number
required
Amount in US dollars to charge. Minimum 500.
charged grants credits. Complete requires_action with clientSecret.
Use hosted checkout for declined or no_payment_method.
Response
200 Charged
Payment succeeded immediately. Credits added to your balance.string
Always
"charged".string
Updated credit balance after top-up (Bigint string).
string
Number of credits added (Bigint string).
200 Requires action
Payment requires additional authentication (e.g., 3D Secure). Use the returned client secret with the billing confirmation flow to complete the payment.string
Always
"requires_action".string
Payment client secret for completing the payment.
200 No payment method
No saved payment method on file. Redirect the user to add one via the billing portal, or use the standard top-up endpoint instead.string
Always
"no_payment_method".200 Declined
The saved method failed. Open hosted checkout so the user can choose another.string
Always
"declined".400 Invalid input
dollars value or includes too many decimal places.
401 Unauthenticated
429 Rate limited
Retry-After header before retrying.
Related. Top Up Credits · Get Top-Up Status · Get Credits · Billing Guide