> ## 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.

# Keys

> Your app uses an Atlaso key. Atlaso uses your saved provider keys.

## API keys

Create an Atlaso key on the **API keys** page. Choose a name, a project or **No project**,
and a memory mode. New keys whose memory is for **Me** start on **Use and learn**,
so they learn from calls the way the Atlaso Plugin does: see
[Learning from calls](https://docs.atlaso.ai/gateway/memory.md#learning-from-calls). Keys for **Each user
of my app** start on **Use only**. The secret starts with `sk-at-` and is shown
once. Save it securely before closing the dialog.

Send it as `Authorization: Bearer $ATLASO_KEY`. Do not send an `x-atlaso-key`
header: a request that carries it is refused with 401 `invalid_api_key`, even
when `Authorization` holds a valid key. Use keys on your server,
not in a browser or a mobile app bundle. The chat route answers browser CORS
requests (bearer keys only, no cookies) so a browser can read the reply headers,
but anyone who loads a page that holds your key can copy it.

A key can have a [daily spending limit](https://docs.atlaso.ai/gateway/limits-and-budgets.md). Revoked
keys, and old secrets after rotation, return `invalid_api_key`. An account can
hold up to 20 active keys; revoke one to create another.

## Rotate a key

To give a key a new secret, open it on the **API keys** page and choose **Rotate key** under
**More actions**. The key keeps its name, project, memory settings, limits, tags
and call history. The new secret is shown once.

Choose when the old secret stops working:

* **Old secret stops within 30 seconds** (the default). Rotating this way also ends any earlier
  24-hour overlap.
* **Old secret keeps working for 24 hours**, so you can update your apps first.

Calls that were already accepted can finish. Rotated, revoked or leaked secrets
stop working within 30 seconds while the backend is available. During a backend
outage, a context that was valid at its last successful check can keep working
for up to 300 seconds from that check. A secret revoked during the outage may
therefore keep working until that window ends. Calls that began up to 30
seconds after a secret stopped are still recorded in Activity and count toward
your limits and budget. Calls that began later than that, which can happen only
during a backend outage, still reach your provider but are not recorded in
Activity and do not count toward your limits or budget.

If GitHub finds an old secret in public code, its overlap ends at once. The
current secret keeps working. The key's drawer shows the report date on your
own clock and the old secret's last four when available. If GitHub finds the
current secret, the key is revoked.

## Revoke a key

To stop a key for good, open it on the **API keys** page and choose **Revoke key**
under **More actions**. This cannot be undone; you can create a new key. The
secret stops working within 30 seconds while the backend is available, or up to
300 seconds during a backend outage, as for a rotation.

## Memory mode and scope

Mode controls what memory does: **Use only**, **Use and learn**, or **Off**.
With **Use and learn**, a **Me** key saves the newest user message of each
successful call, as the Plugin does. With **Use only**, it recalls and saves
nothing from calls. [Memory](https://docs.atlaso.ai/gateway/memory.md) explains the behavior and the
separate setting for what happens if memory cannot be reached.

The **Memory for** setting offers **Me** or **Each user of my app**. The latter
keeps app users separate within your account and the key's project. Choose it
explicitly for a shared app. New keys use **Me** (owner memory). A **Me** key
whose memory is on refuses a call that names an app user in `x-atlaso-user`
(403 [`memory_scope_owner`](https://docs.atlaso.ai/gateway/errors#memory_scope_owner)), on chat, Responses and
Messages calls as on the Memory API, so your own memories never reach your app's
users. Nothing is sent to the provider and the call costs \$0.00. With memory **Off**
the user ID is allowed and only labels usage for each app user.

Owner memory uses the key's project plus personal facts. A key with no project
uses personal facts. Per-user scope uses the app user's own store, without
falling back to the owner's facts. Keys in the same account and project using
the same app user ID share that app user's memory.

A **Me** key can read, add, edit and delete your memories from code with the
[Memory API](https://docs.atlaso.ai/gateway/memory-api.md#your-own-memory), never all of them at once. To
stop that, set the key's memory to **Off** or revoke the key. Every change
appears as a row on the dashboard's Activity and Memory pages: rows from the SDK
show an "SDK" tag and direct web requests show "API".

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. See [Credits and learning](https://docs.atlaso.ai/account/credits-and-learning.md).

## Provider keys

Save your provider credential on the **Provider keys** page. It is on as soon as
it is saved; you can switch it off there. A model needs a saved key for its provider and access to that model on your
provider account. An Atlaso key alone does not grant model access.

If a saved credential is rejected, replace it on the **Provider keys** page. If its provider needs a
workspace ID, save that alongside the key. The gateway uses the saved credential;
model calls on your own keys never use Atlaso credit, whether they succeed or fail.

See [Privacy and security](https://docs.atlaso.ai/gateway/privacy-and-security.md) for key storage and
[Models](https://docs.atlaso.ai/gateway/models.md) for names and availability.


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