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

# Usage analytics

> Chart the credits, audio and sessions your organization used, per product and per API key, with concurrency and latency, and download the data as CSV.

The **Usage analytics** page in [Gradium Studio](https://studio.gradium.ai/)
charts what your organization used over a time window you pick: credits, audio
and sessions, by product and by API key, plus concurrent requests and API
latency. Each chart downloads as CSV for billing or your own reporting.

To open it, select **Usage** under **Platform** in the sidebar. To see
individual sessions, use the **Sessions** page instead.

![The Studio sidebar, with Usage under Platform outlined](https://mintcdn.com/gradium/GBDUlAVFN5YmsKpJ/images/guides/usage-analytics/open-usage.png?fit=max\&auto=format\&n=GBDUlAVFN5YmsKpJ\&q=85\&s=ef56d9d8517ce357769ec3941efb1478)

## Pick a time window

1. Click the date control at the top of the page.
2. Pick a preset, or set a **Start** and **End** and click **Apply**.

![The date control open, with the trigger and the Last 7 days preset numbered 1 and 2](https://mintcdn.com/gradium/GBDUlAVFN5YmsKpJ/images/guides/usage-analytics/time-window.png?fit=max\&auto=format\&n=GBDUlAVFN5YmsKpJ\&q=85\&s=c88d7e5b79431fc323eb5602d66be45e)

The presets are **Last hour**, **Last 6 hours**, **Last 12 hours**,
**Last 24 hours**, **Today**, **Last 7 days**, **Last 14 days**,
**Last 30 days** and **Last 90 days**. The hour presets are rolling windows that
end now. A preset applies as soon as you click it.

A custom range takes a date and a time of day for each end, so you can cut a
window at, say, 09:00. Dates picked on the calendar run from 00:00 on the
start day to 23:59 on the end day, and the end minute is included.

Usage data goes back 92 days. If a custom range starts earlier, the older days
are not shown, and a note under the charts says so.

## Choose what the charts show

The bar at the top of the page stays in view as you scroll. Besides the date
control, it has three settings. On a phone, the product stays a set of tabs,
and metric and aggregation become dropdowns next to the date control.

| Setting | Options | What it changes |
| - | - | - |
| Metric | Credits, Audio, Sessions | Usage by product, Consumption by API key, and the credits, audio and sessions figures |
| Product | All, Text-to-Speech, Speech-to-Text, Translation | The same charts and figures as the metric |
| Aggregation | Hourly, Daily, Weekly | The width of the bars and points in every chart |

Metric and product do not change **Concurrent requests**, **API latency**,
**Average concurrency** or **Latency p50**. Those are measured for your whole
organization, across products.

Which aggregations you can pick depends on the length of the window:

| Aggregation | Available for | Selected by default for |
| - | - | - |
| Hourly | Windows of 7 days or less | Windows under 7 days |
| Daily | Windows longer than 1 day | Windows of 7 to 89 days |
| Weekly | Windows of 14 days or more | Windows of 90 days or more |

Picking a new window resets the aggregation to its default, and you can change
it after. Days are calendar days in your browser's time zone, and weeks start
on Monday. In a rolling window, the first and last bars usually cover part of a
day or a week.

Concurrent requests and API latency are measured in 3-hour windows, so with
**Hourly** selected they show one point every 3 hours.

## Read the top metrics

Five figures sum up the window:

| Figure | What it shows |
| - | - |
| Credits consumed | Credits used in the window |
| Audio processed | Audio sent to Gradium plus audio returned, in minutes, or in hours from 60 minutes |
| Sessions | Sessions started in the window |
| Average concurrency | The average of each 3-hour window's peak of sessions open at once. Windows with no sessions are left out, so quiet periods do not pull it down |
| Latency p50 | The median latency, in milliseconds, with the p90 next to it. See [API latency](#api-latency) for how it is measured |

A dash means the data is still loading or there is none for the window.

Every figure except latency shows a trend: the change against the previous
window of the same length, ending where the current window starts. For
**Last 7 days**, that is the 7 days before. Green with an up arrow is an
increase, red with a down arrow a decrease. Hover over or focus the trend to
see the previous period's dates and value. The trend is hidden when:

* The previous window has no usage to compare with.
* The previous window would start more than 92 days ago, before the data
  begins. **Last 90 days** never has a trend.

## Read the charts

### Usage by product

Stacked bars of the selected metric, one color per product: Text-to-Speech,
Speech-to-Text and Translation. Usage whose product was not recorded is in a
grey **Other** stack. When more than one product is shown, a dashed grey line
traces the total. The legend above the chart gives each product's total for the
window.

### Consumption by API key

Stacked bars of the selected metric per API key. The six keys with the most
usage get their own color, and the rest are grouped as **Other keys**.

The table under the chart is its legend. It lists each key with its status,
sessions, credits, audio minutes and share of the total. **Other keys** is one
row, with the keys it groups listed under it.

* **Studio (no API key)** is usage from Studio itself, such as the playground,
  which runs without an API key.
* A **revoked** key keeps its name and its past usage.
* A **deleted** key shows as **Deleted key** followed by its ID.

### Concurrent requests

The most sessions open at the same time in each period, across your
organization. Each point is the peak of a 3-hour window. Over a day or a week,
the chart shows the highest peak of that period. The dashed line is your plan's
concurrency limit. See [Limits](https://docs.gradium.ai/guides/limits.md#concurrency) for the limits
per plan.

### API latency

Lines for the minimum, p50, p90 and p95 latency in each period. p50 is the
median: half the sessions were faster. p95 is slower than 95% of the sessions.

Latency is measured per session, from the moment the client connects to the
first bytes the API sends back. Those bytes are audio for Text-to-Speech and
Translation, and text for Speech-to-Text. Time the client takes before it
sends its first input is left out, so a client that connects early and waits
does not inflate the figure.

Latency is measured in 3-hour windows. Over a day or a week, the chart
averages the windows' percentiles, weighted by the number of sessions in each.
This is close to the true percentile, but not exact.

The info icon next to each chart title repeats how it is measured.

## Download the data

Each chart has a **Download** button in its heading. Files are CSV.

![The Consumption by API key chart, with Download and Daily, per key numbered 1 and 2](https://mintcdn.com/gradium/GBDUlAVFN5YmsKpJ/images/guides/usage-analytics/download.png?fit=max\&auto=format\&n=GBDUlAVFN5YmsKpJ\&q=85\&s=4efe299affd3ad381e7b8654ce003721)

| Chart | File name | Columns |
| - | - | - |
| Usage by product | `gradium-usage-{from}-to-{to}-{aggregation}.csv` | `period_start`, `period_end`, `product`, `sessions`, `credits`, `audio_input_minutes`, `audio_output_minutes` |
| Consumption by API key | `gradium-usage-by-api-key-{from}-to-{to}-{product}-{granularity}.csv` | `period_start`, `period_end`, `api_key_name`, `api_key_prefix`, `api_key_uid`, `key_status`, `product`, `sessions`, `credits`, `audio_input_minutes`, `audio_output_minutes` |
| Concurrent requests | `gradium-concurrency-{from}-to-{to}-{aggregation}.csv` | `period_start`, `period_end`, `peak_concurrent_sessions`, `plan_limit` |
| API latency | `gradium-latency-{from}-to-{to}-{aggregation}.csv` | `period_start`, `period_end`, `min_ms`, `p50_ms`, `p90_ms`, `p95_ms` |

**Usage by product** follows the product setting and the aggregation: one row
per period and product.

**Consumption by API key** opens a menu, **CSV for this range**, where you
pick the rows: **Totals per key**, **Weekly, per key**, **Daily, per key** or
**Hourly, per key**. This choice is independent of the aggregation on the page.
The file has one row per key, product and period, for the selected product.
Keys with no usage in a period are left out. Rows are sorted by period, then by
credits.

**Concurrent requests** and **API latency** write what the chart shows. With
**Hourly** selected, their periods are 3 hours long.

What to know when you reconcile these files:

* **Times are UTC**, in ISO 8601. Each row covers `period_start` up to, but not
  including, `period_end`.
* **A session counts in the hour it started**, in the usage files. In the
  concurrency and latency files, it counts in the 3-hour window in which it
  ended.
* **Column names and values are fixed**, in English, whatever the Studio
  language. Numbers are not formatted, so scripts can read them as they are.
* **`product`** is `tts` for Text-to-Speech, `asr` for Speech-to-Text, `s2s`
  for Translation, or `unknown` when the product was not recorded.
* **`key_status`** is `active`, `revoked`, `deleted`, or `studio` for usage
  without an API key.
* **The `{from}` and `{to}` dates** in the file name are the days you picked,
  in your browser's time zone.

### Data up to

Usage per product and per API key is computed every hour, and the most recent
hour may not be ready yet. The note under the charts, **Data up to …**, gives
the end of the last computed hour. Later hours show as a gap in the charts,
not as zero, and are left out of the downloads. Download again later to get
them.


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