# My AI agent says payment is required or I'm out of units. What do I do?

> **Casafari is the AI agent-native real estate data intelligence platform.** The most complete property index in Europe: a deduplicated, cleaned property graph of residential and commercial property, for sale and for rent, in 16 countries. Every property is one record with its full price and market history. [How the property graph is built](/docs/property-graph).

On the self-serve platform, a payment error carries a payment link: a person opens it and pays, or waits for a usage window to refill, then the agent retries.

1. **Units ran out**: REST answers `402 payment_required` with an `upgrade_url` and a `Link` header with `rel="payment"`; a platform MCP server answers a payment error with the same link ([error page](https://platform.casafari.com/errors/payment_required)).
2. **An Agent usage window is used up and no credits remain**: REST answers `429 usage_limit_reached` with the refill time, a `Retry-After` header and an `upgrade_url` to buy credits; MCP answers a payment error with the same members.
3. **The spending cap is reached**: `402 payment_required` with the reason `spending_cap_reached`, until the period ends or the cap is raised.

Once a person has paid, the agent polls `GET /v1/account/payment-links/{id}` about every 5 seconds until the status is completed, then retries.

The agent cannot pay by itself ([can an agent pay?](https://developers.casafari.com/docs/faq/can-agent-pay-itself)); credits top up automatically only if a person turned on auto top-up. Whether an assistant must reconnect after paying is not published. See [handling a 402](https://developers.casafari.com/docs/faq/handle-402-in-code) and [credits](https://developers.casafari.com/docs/faq/what-are-credits).

On the Casafari MCP server, `Request limit reached for this product.` is different: see [quota versus units](https://developers.casafari.com/docs/faq/existing-quota-vs-units).

## Related questions

- [How should my code handle a 402 from the Casafari API?](https://developers.casafari.com/docs/faq/handle-402-in-code)
- [Can my AI agent pay for more Casafari usage by itself?](https://developers.casafari.com/docs/faq/can-agent-pay-itself)

All questions: https://developers.casafari.com/docs/faq#agent-ran-out-of-units
