---
title: Usage metrics
sidebar_position: 7
description: Retrieve billing usage, spending and rate limits, le Chat activity, and Vibe Code analytics with the Admin API.
---

# Usage metrics with the Admin API

The Admin API exposes two kinds of consumption data:

- **Billing usage**: cost and consumption for your Organization over a billing period.
- **Product analytics**: le Chat activity and Vibe Code usage metrics over a time range.

:::info[Enterprise plans only]
The Admin API is available only on Enterprise plans, and access isn't self-serve. On other plans, you can't create an Admin API key, and a standard API key doesn't work with admin endpoints. To request access, contact your Mistral account team or [our sales team](https://mistral.ai/contact).
:::

<SectionTab as="h1" sectionId="before-you-start">Before you start</SectionTab>

You need an Admin API key created in the Admin Panel. Every request uses the base URL `https://api.mistral.ai/v1/admin` and the `x-api-key` header. See [Admin API authentication](/admin/admin-api/authentication).

<SectionTab as="h1" sectionId="billing-usage">Billing usage</SectionTab>

Retrieve cost and consumption for the Organization. The `month`, `year`, and `workspace_id` parameters are optional. `month` and `year` are whole numbers, so `5` and `05` both work.

```bash
curl "https://api.mistral.ai/v1/admin/usage?month=5&year=2026" \
  -H "x-api-key: $ADMIN_API_KEY"
```

The response breaks consumption down by category (`chat`, `completion`, `ocr`, `audio`, `connectors`, `libraries_api`, `fine_tuning`, and `vibe_usage`), together with the period (`start_date`, `end_date`) and the `currency`.

<SectionTab as="h1" sectionId="limits">Spending and rate limits</SectionTab>

Read the current Organization limits:

```bash
# Spend limits
curl https://api.mistral.ai/v1/admin/spend-limit \
  -H "x-api-key: $ADMIN_API_KEY"

# Rate limits (requests per second and per-model token limits)
curl https://api.mistral.ai/v1/admin/rate-limit \
  -H "x-api-key: $ADMIN_API_KEY"
```

Set the Organization's monthly spending limit:

```bash
curl -X POST https://api.mistral.ai/v1/admin/spend-limit \
  -H "Content-Type: application/json" \
  -H "x-api-key: $ADMIN_API_KEY" \
  -d '{"amount": 500, "no_monthly_limit": false}'
```

- `amount`: the monthly limit, as a whole number in your Organization's billing currency (`500` means 500, not 500 cents).
- `no_monthly_limit`: set to `true` to remove the cap.

See [Usage limits](/admin/billing-usage/usage-limits) for the concept.

<SectionTab as="h1" sectionId="lechat-analytics">le Chat analytics</SectionTab>

The `/analytics/lechat` endpoints report le Chat messaging activity. All of them take `start_time` and `end_time` as Unix timestamps in seconds.

<SectionTab as="h2" variant="secondary" sectionId="lechat-by-user">By user</SectionTab>

```bash
curl "https://api.mistral.ai/v1/admin/analytics/lechat/usage/by_user_stats?start_time=1704067200&end_time=1706745600" \
  -H "x-api-key: $ADMIN_API_KEY"
```

Returns, per user: message, file, image, and spreadsheet counts; unique conversations; unique agents; messages sent to agents; and the last message timestamp.

<SectionTab as="h2" variant="secondary" sectionId="lechat-by-agent">By agent</SectionTab>

```bash
curl "https://api.mistral.ai/v1/admin/analytics/lechat/usage/by_agent_stats?start_time=1704067200&end_time=1706745600" \
  -H "x-api-key: $ADMIN_API_KEY"
```

Returns the same activity counts grouped by agent, plus the number of unique users per agent.

<SectionTab as="h2" variant="secondary" sectionId="lechat-by-time">Over time</SectionTab>

Add `granularity` (`hour`, `day`, `week`, or `month`) to bucket the results.

```bash
curl "https://api.mistral.ai/v1/admin/analytics/lechat/usage/by_time_stats?start_time=1704067200&end_time=1706745600&granularity=day" \
  -H "x-api-key: $ADMIN_API_KEY"
```

Returns activity counts per time bucket, including unique users and unique agents.

<SectionTab as="h1" sectionId="vibe-code-analytics">Vibe Code analytics</SectionTab>

The `/analytics/vibe` endpoints report Vibe Code activity. They take `start_time` and `end_time` as Unix timestamps in seconds.

<SectionTab as="h2" variant="secondary" sectionId="vibe-by-workspace">By workspace</SectionTab>

Pass `workspace_id` to scope the report to a single workspace, or omit it for all workspaces.

```bash
curl "https://api.mistral.ai/v1/admin/analytics/vibe/usage/by_workspace?start_time=1704067200&end_time=1706745600" \
  -H "x-api-key: $ADMIN_API_KEY"
```

Returns daily series for sessions (CLI, ACP, programmatic), active users, consumed tokens (input, output, and cached, per model), tool calls, and session durations.

<SectionTab as="h2" variant="secondary" sectionId="vibe-by-organization">By Organization</SectionTab>

```bash
curl "https://api.mistral.ai/v1/admin/analytics/vibe/usage/by_organization?start_time=1704067200&end_time=1706745600" \
  -H "x-api-key: $ADMIN_API_KEY"
```

Returns daily series for next-edit suggestions (by outcome), next-edit active users, and modified lines of code.

{/* TODO: confirm the base host for the /analytics/* endpoints. They are generated from the datalake-api service (datalake-api/specs/openapi-admin.json); verify they are served from api.mistral.ai/v1/admin or a separate host. */}

<SectionTab as="h1" sectionId="next-steps">Next steps</SectionTab>

<UsefullLinkContainer>
  <LinkCard href="/admin/admin-api/user-provisioning" title="User provisioning" />
  <LinkCard href="/admin/billing-usage/usage-limits" title="Usage limits" />
</UsefullLinkContainer>