> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autosage.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Rate limits & credits

> How request rate limits and credit consumption work, and how to build a resilient integration around them.

Two independent controls govern how much work your integration can do: a per-key **request rate limit** and your tenant's **credit balance**. This page explains both and the behavior to expect when you reach either one.

## Request rate limits

Each API key is rate limited to roughly **100 requests per second**. The limit is applied per key, so scoping separate keys to separate workloads gives each workload its own budget.

When you exceed the limit, requests are rejected with an HTTP `429` status and a JSON message. This is a temporary, expected signal — not an error in your integration. The correct response is to **back off briefly and retry**.

```json theme={null}
{
  "error": "rate_limited",
  "message": "Too many requests. Retry after a short delay."
}
```

<Tip>
  Implement **exponential backoff with jitter** on `429` responses: wait a short interval, then double it on each retry (for example 250 ms, 500 ms, 1 s) up to a sensible ceiling. Adding a small random jitter prevents many clients from retrying in lockstep. Most HTTP client libraries offer this as a built-in retry policy.
</Tip>

## Credits

Every message your integration runs consumes **credits** from the tenant's balance. Credits cover the model usage behind chats and agent runs.

When a tenant's balance is exhausted, AutoSage protects you from unexpected partial work with predictable behavior:

* The next message is **refused with a clear error** rather than running with an incomplete result.
* **Scheduled agent runs are skipped** while the balance is empty.

Topping up the tenant's credits immediately restores normal operation — new messages succeed and scheduled runs resume on their next trigger.

```json theme={null}
{
  "error": "insufficient_credits",
  "message": "This tenant has no remaining credits. Top up to resume."
}
```

<Tip>
  **Monitor your credit balance proactively** instead of waiting for a refusal. Poll the [billing endpoints](/developers/api/billing) on a schedule and alert your team when a tenant approaches a low-balance threshold, so top-ups happen before any message is refused or a scheduled run is skipped.
</Tip>

<Info>
  Rate limits and credits are independent. A request can succeed under the rate limit and still be refused if the tenant is out of credits, and vice versa. Handle both signals in your client.
</Info>

## Next steps

<CardGroup cols={2}>
  <Card title="Billing API" icon="wallet" href="/developers/api/billing">
    Read balances and usage to monitor credits programmatically.
  </Card>

  <Card title="Best practices" icon="shield-check" href="/developers/guides/best-practices">
    Reliability, security, and multi-tenant patterns for production.
  </Card>
</CardGroup>
