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

# Limits and budgets

> Separate request limits, daily spending limits and monthly warnings.

## Learning credits and limits

These model-call limits are separate from your learning credit and monthly
learning limit. At \$0.00 in Atlaso credit, the AI clean-up of saved messages
waits, for Gateway calls and Plugin messages alike. Saving, recall, Ambient
Memory, Ask and own-key model calls keep working. A monthly learning limit
pauses the clean-up at 100%, for both, and only when you turn on its stop
switch. See [Credits and learning](https://docs.atlaso.ai/account/credits-and-learning.md).

## Daily limit per key

Set a daily spending limit on a key on the **API keys** page. Daily limits are
whole cents from $0.01 to $1,000,000.00. Once recorded catalog-priced spending reaches
it, new calls return `429 key_daily_limit` before the model is called. Raise the
limit or wait for the next UTC day. The error's `Retry-After` indicates the wait;
the dashboard shows times on your own clock.

Spend and settings are cached for at most 30 seconds. A raised limit or budget,
or turning off the monthly stop, takes effect within 30 seconds while the backend
is available. During an outage, the last valid context can be used for up to
300 seconds from its successful check.

This is not an exact billing ceiling. Calls already running, and recent calls
whose records have not arrived yet, or calls using cached spend, can overshoot it. Provider invoices may
differ from catalog-priced usage.

While a daily limit, a monthly budget stop, or a per-user limit (on calls that
send an app user id) is on, a model or tool Atlaso cannot price is refused with
400 `unsupported_parameter` before the provider is called. The refused call
costs \$0.00. Choose a model with stated prices, remove the tool, or use a key
with no limit.

## Daily limit for each user of your app

On the **API keys** page, in the create dialog or a key's drawer, set **Daily
limit for each user of your app (optional)**. Enter dollars and cents, for
example `5.00`, from $0.01 to $1,000,000.00. Empty means no limit.

On a key whose memory is yours, Atlaso reads `x-atlaso-user`, then
`safety_identifier`, then `user`; the first present id wins. While that key's
memory is on, `x-atlaso-user` is refused (403
[`memory_scope_owner`](https://docs.atlaso.ai/gateway/errors#memory_scope_owner)), so send
`safety_identifier` or `user` instead. A key set to **Each
user of my app** reads `x-atlaso-user` only, exactly as for its memory. The limit applies separately
to each hashed user label on that key, even when memory is off or belongs to
you. Sending an id does not change whose memory the key uses. **Calls with no
user id are not limited by this setting.** Keep sending a stable id for each
user; this is not an authentication boundary.

When recorded spend reaches the limit, Atlaso returns `429
user_daily_limit_reached` with `x-should-retry: false`. Nothing goes to the
provider and the refused call costs \$0.00. Other users are unaffected. Activity
shows **Stopped by your per-user limit** and **Not billed**, rather than a failure.
Raise or clear the limit, or wait for the next UTC day, the same reset as the
key's daily limit. The dashboard shows that reset on your own clock.

Like the key limit and budget stop, this uses catalog-priced spend and is not
an exact billing ceiling. Spend and settings for each app user are cached for at
most 30 seconds, like the key limit. During a backend outage, the last valid
context for that user can be used for up to 300 seconds from its check. Calls in
that window, concurrent calls and receipts waiting to arrive can overshoot the
limit. No-id calls do not count toward this per-user limit. A call that names a
user whose ID is not accepted (for example one that looks like an API key) is
refused with 400 `user_id_not_accepted`; it is never served without the limit.
The key's overall limit and account budget still apply.

## Monthly budget and stop

Set a monthly budget for your account under **Set budget** on the dashboard's
Overview. A budget is whole cents from $1.00 to $100,000.00. It covers own-key
spend across the account. Warnings appear at 80% (**Near your budget**) and 100%
(**Over budget**). The budget month follows the configured time zone. A warning
alone does not stop calls.

Atlaso also emails you at most once at 80% and once at 100% each budget month.
The check runs when your dashboard loads the budget, so no email is sent until
you next open the dashboard.

To stop calls at the budget, turn on **Stop calls when I reach my monthly budget**.
Once recorded monthly spend reaches the budget, new calls return
`429 monthly_budget_reached` before the model is called, with
`x-should-retry: false` and no `Retry-After`. Raise the budget, turn off the stop,
or wait for the next budget month. Like the daily limit, calls already running
and recent calls whose records have not arrived yet, or calls using cached spend,
can overshoot it.

## Request rate limits

Atlaso distinguishes per-key `rate_limited`, account-wide `account_rate_limited`,
and the provider's `provider_rate_limit`. Honor `Retry-After` when present and
reduce concurrency. Actual rate limits depend on the running service and your
provider account; there is no fixed public requests-per-minute promise here.
`rate_limited` and `account_rate_limited` refusals are not recorded, so they do
not appear in Activity. Use the reply's `x-request-id` instead.

`insufficient_quota` and `provider_spend_limit` need a provider billing change or
reset. Repeated immediate retries will not fix them. See [Errors](https://docs.atlaso.ai/gateway/errors.md).

## Stop runaway loops

Every key starts with **Stop runaway loops** on. Atlaso stops the tenth identical
request in ten minutes within the same session, or the same app user when there
is no session. Requests without either identity are not stopped by this check.
The request body is compared with its JSON keys sorted. Further identical
attempts are stopped until fewer than ten remain in the ten-minute window.
Counts are kept for each key, and stopped attempts count too, so steady retries
keep the stop in place until they slow down.

Your app names a session with the `x-atlaso-session-id` request header (up to
128 printable ASCII characters). Send the same value for one conversation.
Claude Code and Codex through the Gateway (coming soon) will send their own
session. Without a session, the app user id described above is used. If neither
is sent, repeats are measured but never stopped. The optional `x-atlaso-client`
header names your app in Activity (see [Tags](https://docs.atlaso.ai/gateway/tags.md)).

Atlaso also stops a conversation that ends in tool results when the last five
assistant turns with tool calls have the same tools, arguments and results. This
reads Chat Completions messages and Responses `function_call` and
`function_call_output` items alike. A Responses call that carries only tool
outputs (its earlier turns kept by OpenAI through `previous_response_id`) is
never stopped by this check. Changing arguments or results prevents this stop.

A stopped call returns HTTP 429 with `type: atlaso_loop_stop` and
`x-should-retry: false`. Nothing is sent to the provider and nothing is billed:
\$0.00. Activity shows **Stopped: same request repeated** or **Stopped: agent loop**,
with **Not billed**. These calls do not count as failures. Turn the switch off
on the **API keys** page for tests that repeat on purpose.

The repeat history stays only in the gateway's memory, for an hour. The call
record's `repeat_within_hour` measures whether that body was seen in the last
hour, using session, then app user, then key scope. This meter stays on when
stopping is off. Several gateway servers, restarts and eviction can undercount
repeats. Request fingerprints are never written to disk, to logs or to Atlaso's
database. Both checks apply to Chat Completions and Responses calls, including
models served by several hosts.

Calls priced at a true \$0.00 can continue after a monthly budget stop, daily limit or per-user daily limit; loop stops and rate limits still apply, and an unknown price is still treated as possibly costly.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.