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

# Usage & invoices

> See exactly what you spent, on what model, by which API key — and export it.

Every request — Playground or API — is metered the moment it completes. You can break that data down in the dashboard or pull it out via API for your own BI.

## Where to look

Settings → **Usage** has four views:

| View          | What it shows                                                                                                 |
| ------------- | ------------------------------------------------------------------------------------------------------------- |
| **Overview**  | Credits spent today, this week, this month vs. plan allowance                                                 |
| **By model**  | Spend grouped by model slug (sortable, filterable by date)                                                    |
| **By key**    | Spend grouped by API key — find which integration is heaviest                                                 |
| **By member** | Workspace member who initiated each request (Playground only — API calls attribute to the key, not the human) |

All charts respect the date range picker (last 24h, 7d, 30d, custom).

## Drilling into a single request

Click any row in **Recent requests** to see:

* Full timing: gateway in/out, provider in/out, total
* Token counts (`prompt_tokens`, `completion_tokens`, `total_tokens`)
* Credits used
* Whether a [fallback](/workspaces/fallback-chains) fired and which model actually served the call
* Request ID — paste this into a support ticket and we find the trace instantly

Prompts and outputs are **not** stored on API requests by default. Playground calls keep history per [retention rules](/playground/chats-and-projects).

## Per-request cost in the response

Every API response includes:

```
x-credits-used: 2
x-model-used: gpt-4o
x-fallback-from: (only when fallback fired)
x-request-id: req_01HK9X...
```

Streaming responses also emit a final SSE chunk:

```
data: {"choices":[],"usage":{...},"credits_used":2}
```

So you can attribute cost in your own logs without polling Usage.

## Exporting

**CSV export** (Settings → Usage → top-right): pick a date range, choose grouping, download. Columns include `timestamp`, `model`, `api_key_id`, `prompt_tokens`, `completion_tokens`, `credits_used`, `request_id`, `latency_ms`, `fallback_depth`.

**API**: `GET /v1/usage?start=...&end=...&group_by=model` returns the same data as JSON. Useful for nightly ingestion into your warehouse.

## Invoices

Settings → **Billing** → **History** lists every invoice — subscription renewals and topups. Each row links to:

* A PDF invoice (UK VAT applied where required)
* The Stripe receipt
* The exact credit pack delivered

Invoices are emailed to the **billing contact** on the workspace. Update it in Settings → Workspace → Billing contact.

## Reconciling with Stripe

Each Infery invoice references a Stripe `pi_...` (payment intent) and `in_...` (invoice) id. If you reconcile via Stripe export, match on `metadata.workspace_id` and `metadata.infery_invoice_id` — both are set on every charge.

## Anomaly alerts

Set in Settings → Workspace → **Budget alerts**: get an email when daily spend exceeds your normal range by more than X%. Catches runaway loops and leaked keys before the bill does. See [Budget alerts](/workspaces/budget-alerts).
