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

# Usage and logs

> See what your organization spent on model calls, and open the record of every request.

Every model call through the LLM Gateway is one request with one record. Under **Platform > AI governance**, [Usage](https://platform.xpander.ai/governance/usage) shows spend and [Logs](https://platform.xpander.ai/governance/logs) shows the requests. Each person sees their own spend in **Settings > Usage**.

![Diagram](https://docs.xpander.ai/images/diagrams/run-llm-gateway-requests-and-costs-a89bec7e.svg)

## Usage

![Usage page with total cost, requests and tokens, a daily cost chart by person and a table by person](https://mintcdn.com/xpanderai-099931d1/65C_XNxucwf3Ltb_/images/llm-gateway/11-usage.png?fit=max\&auto=format\&n=65C_XNxucwf3Ltb_\&q=85\&s=7aaeda2821845d344c9286048920495e)

Usage grouped by person over the last 7 days. Shown with sample data.

Pick a range, then **Group by** person, group, API key, model, client, provider, account, agent or license model. **View requests** on a row opens Logs with the same filters, and **Export** downloads the table as CSV. Amounts switch between **Credits** and **\$**.

The top row shows **Total cost** and one tile per payer: **Subscription: xpander credits**, **Subscription: your provider keys** (or **Subscription: API key** / **Subscription: IAM assume role** when you use only one kind), and **Subscription: personal Claude and ChatGPT plans**.

Costs are estimated from token counts and xpander's model prices, including cache reads and writes. For calls on your own key, your provider's invoice is exact.

## Logs

![Logs page with a tokens over time chart and a list of calls](https://mintcdn.com/xpanderai-099931d1/wqIIXSsh0kqA2hZ_/images/verify/platform-logs.png?fit=max\&auto=format\&n=wqIIXSsh0kqA2hZ_\&q=85\&s=30e9417681d6effda888dcd637896816)

Platform > AI governance > Logs: tokens over time by model and every call. Shown with sample data.

Logs lists requests newest first, grouped into traces when they belong together, such as one agent run or one coding session. **Live** streams new requests. Each row shows who, what started it, the agent, model, tokens, cost (or **Not billed**), duration and status. A refused call shows the reason, such as **Budget reached**, **Model not allowed** or **No credential**.

**+ Filter** narrows by person, group, model, client, API key, agent, status, what started the run, license model, or xpander operation. Filters stay in the page address, so a filtered view can be shared as a link. To open one request, search its request or trace ID. Each request has its own link: `https://platform.xpander.ai/governance/logs/<request or trace ID>`.

**Export** downloads the filtered list as CSV, JSON or a table to paste. Exports never include prompt or response text.

### A trace or a request

![Trace header of one chat: person, agent and channel, Done, time range with time zone, turns, calls, credits and what paid for it](https://mintcdn.com/xpanderai-099931d1/H-WYYv839kjeMNSx/images/llm-gateway/13-request-detail.png?fit=max\&auto=format\&n=H-WYYv839kjeMNSx\&q=85\&s=4036041c2e93aa55b3c0f6a308af5272)

A trace shows who, the agent and channel, the time range, turns, calls, credits and what paid, then each turn with its calls. A running trace shows **Live**.

A request shows its model, latency, tokens and estimated cost, plus:

* **Routing**: the **Requested model**, the **Alias** it matched, what it **Resolves to**, **Fallbacks** and each of the **Attempts**.
* **Gateway decisions**: every check the call met (**Own plan**, **Credits**, **Budget**, **Limits**, **Request rate**, **Token rate**, **Parallel calls**) and its verdict.
* **Prompt and response**, when text is saved: the conversation and the raw request and answer.

Text is saved for everyone unless an admin turns off [Saved prompt text](https://docs.xpander.ai/run/llm-gateway/policies.md#prompt-and-response-text). Roles that may view usage can open it, and every opened request is recorded in the [Audit log](https://platform.xpander.ai/governance/audit). [Log destinations](https://docs.xpander.ai/run/llm-gateway/logs-export.md) never include it.

## Requests xpander makes for you

Some features call a model on your organization's behalf: conversation titles and summaries, building an API connector, generating an agent's details, checking custom function code, image generation and transcription in built-in skills, and bot replies. They appear in Logs like any other request, under the person who started the work (or `-`), with the operation's step as the source.

On xpander's own key they show **Not billed**, use no credits and count toward no budget. On your own provider key they show their cost, because your provider bills it, which is always the case on a self-hosted install. Operations charged in credits, such as scoring answers in evaluations, show their cost. To list only these requests, choose **System calls**.

## How long requests are kept

Set by **Keep requests for** in [Policies](https://docs.xpander.ai/run/llm-gateway/policies.md#retention). An older request opens as **No request or trace with this ID**. Requests live in your organization's own database: a dedicated database on xpander cloud, or your install's PostgreSQL when self-hosted.

On Hybrid, requests from agents on your install stay in your environment. If your browser can't reach it directly, Logs shows **Needs a direct connection to your environment**. Usage totals and the calls people's coding tools make through xpander cloud always show.

## Next steps

> **[Send requests to your own systems](https://docs.xpander.ai/run/llm-gateway/logs-export.md)**
>
> OpenTelemetry and storage buckets.

> **[Set retention and saved prompt text](https://docs.xpander.ai/run/llm-gateway/policies.md)**
>
> Retention and saved text.


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