Paying and running out of units · FAQ
Can my AI agent pay for more Casafari usage by itself?
No: an AI agent cannot pay for more Casafari usage by itself; a person opens the payment link and pays, and the agent continues once the payment completes.
When units run out on the self-serve platform, the REST API answers 402 payment_required with an upgrade_url, and a platform MCP server answers with a payment error carrying the same link. The agent then:
- Shows the link to a person.
- Polls
GET /v1/account/payment-links/{id}about every 5 seconds until the status is completed. - Retries the call.
A person can also turn on auto top-up in the account's billing settings, so credits are topped up automatically; on the Agent plan, auto top-ups count toward the spending cap (25,000 units a period by default). How to turn auto top-up on, its thresholds and amounts are not published; Casafari can answer (casafari.com).
See what to do when units run out, handling a 402 in code, credits and usage windows.