API / set-auto-top-up-on-xai-console

API

Set auto top-up on the xAI Console

Turn on auto top-up so the xAI Console buys more prepaid API credits when the team balance drops below a threshold you choose, instead of waiting for someone to notice empty keys during peak traffic. Official Manage Billing recommends enabling auto top-up to avoid service interruptions and documents the three knobs: the balance that triggers a purchase, the credit amount to buy (minimum $5), and the maximum total value of top-ups allowed per month. You can disable the feature at any time from the same billing surface. Start at console.x.ai with the team that owns production spend selected in the picker.

What you need

Admin-level ability to change billing on that team, a payment method already on file from a prior purchase or from Billing → Billing details → Add Payment Information, and numbers that match your real burn rate so a quiet weekend does not fire surprise charges. Prepaid purchases still go through the Guest Checkout path described in billing docs when you buy manually; auto top-up uses the saved payment method once the balance crosses your threshold. Pair this with a one-time purchase when the balance is already low via Purchase prepaid credits on the xAI Console, and monitor the pool programmatically with Check prepaid credit balance via the xAI Management API. Warnings on the API spend management card appear when you have used about 80% of the total monthly limit you set. More API jobs live on the API hub.

Configure the three auto top-up fields

  1. Sign in to console.x.ai and confirm the team picker shows the team whose prepaid pool should refill automatically.
  2. Open Billing → API spend management (the same area where you purchase credits and view balance) and enable auto top-up.
  3. Set the credit balance that must be reached before a top-up fires, picking a floor that leaves enough runway for overnight jobs and retries rather than a value so low that in-flight traffic dies before the charge settles.
  4. Set the top-up amount of credits to purchase on each trigger; official docs require a minimum of $5 for that amount.
  5. Set the maximum total value of top-ups allowed per month so a runaway loop or unexpected traffic spike cannot keep charging without a ceiling.
  6. Save the configuration and leave a payment method on file, because without a usable default method the automatic purchase cannot complete.

Disable auto top-up from the same card whenever you want purchases to stop until someone buys manually again.

Keep spend limits honest

Auto top-up only refills prepaid credits. It does not raise an invoiced billing limit by itself. When the invoiced billing limit stays at the default $0 on Billing → API Credits, the team still runs on prepaid only, and requests reject after prepaid is empty if a top-up fails. If you raise the invoiced billing limit for enterprise monthly billing, prepaid is still consumed first and the remainder charges the default payment method at month end. Watch the 80% monthly-limit warning on the API spend management card and adjust either the monthly top-up cap or the invoiced limit before you hit a hard stop.

Pitfalls

Setting the trigger balance at zero leaves no buffer while the charge processes, and setting the monthly maximum below a single top-up amount blocks the feature from ever buying. Leaving no payment method on file makes the enable toggle look successful until the first threshold crossing fails. Configuring auto top-up on a staging team while production keys bill a different team never protects the keys you care about. Confusing the auto top-up monthly maximum with the separate invoiced billing limit causes you to raise the wrong ceiling when traffic grows.