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

# Tags

> Group calls using your own labels.

Label calls with your own `key=value` tags, such as `feature=chat` or
`customer=cus_123`. Activity shows what each tag cost for the chosen period (in
the tag filter, a row's tag hover and the call drawer) and filters calls by tag.
Tags are separate from the user ID that selects
memory: never use a tag as an authentication or memory-isolation boundary. Use
[per-user identity](https://docs.atlaso.ai/gateway/memory.md#one-memory-for-each-app-user) for memory scope.

Send tags in the `x-atlaso-tags` header, comma-separated, or in the body as
`"atlaso": {"tags": {...}}`. Both at once is fine: a body tag replaces a header
tag with the same key.

* OpenAI Python SDK: `extra_headers={"x-atlaso-tags": "feature=chat"}` or
  `extra_body={"atlaso": {"tags": {"feature": "chat"}}}`.
* OpenAI Node SDK: pass `{ headers: { "x-atlaso-tags": "feature=chat" } }` as
  the second argument. The body form `atlaso: { tags: { feature: "chat" } }`
  works in JavaScript, but TypeScript rejects the unknown field unless you cast
  the params.

Keep the same `x-atlaso-user` on every call; omitting it skips per-user memory,
or returns `user_id_required` when the key requires memory.

```bash theme={null}
curl --fail-with-body "$ATLASO_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $ATLASO_KEY" \
  -H 'Content-Type: application/json' \
  -H 'x-atlaso-user: demo-user-42' \
  -H 'x-atlaso-tags: environment=test,customer=cus_123' \
  -d '{"model":"openai/gpt-4o","messages":[{"role":"user","content":"Say hello."}],"atlaso":{"tags":{"feature":"chat"}}}'
```

## Rules

* At most 10 tags a call. A key is lowercase letters, digits, `_` and `-`, up to
  32 characters (`Feature` is read as `feature`). A value is 1 to 64 printable
  ASCII characters.
* The `atlaso` field is removed from the body before the provider sees it.
  OpenAI's own `metadata` field is not a tag. It goes to the provider unchanged
  when the provider has such a field; otherwise it is left out and named in
  `x-atlaso-ignored-params`.
* A tag that breaks a rule, or looks like a secret, is dropped and never stored.
  The call still runs. The reply's `x-atlaso-tags-dropped` header names each
  dropped tag by key (or `#n`, its place) and reason, never its value. Reasons:
  `invalid_key`, `invalid_value`, `secret`, `duplicate`, `over_limit`,
  `malformed`, `too_long`. Items are separated by `; `: at most 10, then
  `+N more`. The label `x-atlaso-tags` or `atlaso.tags` means that whole header
  or body field was dropped, or the pairs past the first 50 sent in it. A header
  over 2,048 characters is not read.
* Tags are kept with the call record for 400 days. Do not put personal data or
  secrets in them: use your own IDs (`customer=cus_123`), not who the customer is.

## Cost for each user of your app

Activity's app user filter lists the 50 costliest app users for the chosen
period, each with its spend. **Cost by app user** on Memory's **each user of your
app** view shows the top 50 app users by cost over the last 30 days: a hashed
label, calls, cost, latest call and refused calls. Select a label to open its
detail drawer, or look up the id your app sends. Costs cover your account only,
across keys.
Unknown prices stay marked as unpriced; catalog costs may differ from invoices.

`GET /v1/usage/app-users` returns complete, paged usage for the key's account
and project. Its pages are ordered by app user label, not by cost. Send the
response's `next` cursor as `after` to read the next page.

On a key whose memory is yours, OpenAI's `user` or `safety_identifier` field works
with your existing client, with no SDK change, and never fails a call. OpenAI and
OpenAI-compatible hosts get the fields as you sent them and may apply their own
rules. Where Atlaso knows a provider does not take a field, it leaves the field
out of the provider request, names it in `x-atlaso-ignored-params`, and still uses
it to label the call:

* Claude models take `user` only.
* Amazon Bedrock's Converse models, MiniMax, Novita, Qwen and SiliconFlow take none of `user`, `safety_identifier` and `metadata`.
* Z.ai takes `user` only. Groq and xAI do not take `metadata`.
* Google models get `user` or `safety_identifier` as a label, which allows at most
  63 lowercase letters, digits, `_` or `-`. A value those rules do not allow is left
  out and named; it is never rewritten. If you send both fields with different
  values, `safety_identifier` is the label and `user` is left out and named.
  `metadata` is left out.

You can also send `x-atlaso-user`, except on a key whose memory is yours with
memory on: that key refuses it (403
[`memory_scope_owner`](https://docs.atlaso.ai/gateway/errors#memory_scope_owner)).
Precedence is the header, then `safety_identifier`, then `user`, taking the first
present value. A key set to **Each user of my app** reads `x-atlaso-user` only
(see [Memory](https://docs.atlaso.ai/gateway/memory.md)), and its labels are per project, or per key when
the key has no project. Atlaso
HMAC-hashes the id with its app-user secret and your account into a 12-character
hex label. Raw ids are not stored in call records or returned in cost results.
On keys whose memory is yours, the same id gets the same label across your
account; on per-user keys it gets one label per project, or per key when the key
has no project. Historical calls that did
not record a label cannot be attributed retroactively.

Every key records a valid supplied id, independently of its memory setting.
An owner-memory key continues to use your memory. To give each user separate
memories, explicitly select that memory scope. To limit their spending, set the
optional [daily limit per app user](https://docs.atlaso.ai/gateway/limits-and-budgets.md).

## Name your app and its sessions

Optional: send `x-atlaso-client: <your app name>` (up to 64 characters) to name
your app in Activity. Send `x-atlaso-session-id: <id>` (up to 128 characters) to
mark one conversation's calls as one session; the
[runaway loop stop](https://docs.atlaso.ai/gateway/limits-and-budgets.md#stop-runaway-loops) counts
repeats within that session. Both keep printable ASCII only.


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