---
title: "Export consumption analytics"
method: POST
path: "/api/v1/w/{wId}/analytics/consumption/export"
tags: ["Analytics"]
---

# Export consumption analytics

`POST /api/v1/w/{wId}/analytics/consumption/export`

Export per-call consumption analytics for the workspace identified by {wId}.
Each row represents one unit of billed credit consumption (an LLM call or a tool call).
The export can be filtered by various dimensions (agents, users, API keys, groups, models, tools, skills, sources, tags).
The export is limited to a maximum of 30 days per request and times out after 10 seconds: reduce the time range
or apply filters to reduce the number of rows if you encounter a timeout.
Results are streamed, if an error occurs, an error message is appended and the stream is closed.

## Path parameters

- `wId` string, required

## Request body

- object
  - `startDate` string, date-time, required — Start of the time range (inclusive), ISO 8601 datetime
  - `endDate` string, date-time, required — End of the time range (exclusive), ISO 8601 datetime. Must be after startDate, at most 30 days apart.
  - `format` 'csv' | 'ndjson' — Output format (defaults to csv)
  - `filter` object — Optional dimension filters. Each key maps to an array of string identifiers to include. Each value must be at most 256 characters. The total number of values across all dimensions must not exceed 500.
    - `agents` string[] — Agent sIds to filter on
    - `users` string[] — User IDs to filter on
    - `api_keys` string[] — API key names to filter on
    - `groups` string[] — Group IDs to filter on
    - `models` string[] — Model IDs to filter on
    - `tools` string[] — Tool server names to filter on
    - `skills` string[] — Skill IDs to filter on
    - `sources` string[] — Context origins to filter on (e.g. "web", "slack", "api")
    - `tags` string[] — Agent tag IDs to filter on

## Response `200`

The consumption data in CSV or NDJSON format

## Other responses

- `400` — Invalid request body (missing fields, invalid dates, range exceeds 30 days)
- `403` — Requires an API key with admin scope
- `500` — Internal Server Error

## Changes

- **2026-09-11** `cb11972229f2` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/dust-tt/apis/dust-api-documentation/changes/api/v1/w/:wId/analytics/consumption/export/post.md)

---

[API](https://skmtc.dev/dust-tt/apis/dust-api-documentation.md) · [All operations](https://skmtc.dev/dust-tt/apis/dust-api-documentation/llms.txt) · [OpenAPI document](https://skmtc.dev/dust-tt/apis/dust-api-documentation/revisions/acd9e7f27b34?raw)
