---
title: "Get agent consumption data"
method: POST
path: "/api/agent_builder/agents/{agent_id}/consumption"
tags: ["agent builder"]
---

# Get agent consumption data

`POST /api/agent_builder/agents/{agent_id}/consumption`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/agent_builder/agents/{agent_id}/consumption</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Returns paginated, per-conversation token consumption data for a given agent. Includes input/output token counts, round counts, LLM call counts, and warnings for conversations with high token usage. Requires the manageAgents privilege. To learn more about monitoring agent token usage, refer to the [monitor usage documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/monitor-usage).<br/><br/>[Required authorization] Route required privileges: agentBuilder:manageAgents.

## Path parameters

- `agent_id` string, required

## Headers

- `kbn-xsrf` string, required

## Request body

- object
  - `has_warnings` boolean — Filter to conversations with or without high-token warnings.
  - `search` string — Free-text search filter on conversation title.
  - `search_after` unknown[] — Cursor for pagination. Pass the search_after value from the previous response.
    - unknown
  - `size` number — Number of results per page.
  - `sort_field` 'updated_at' | 'total_tokens' | 'round_count' — Field to sort results by.
  - `sort_order` 'asc' | 'desc' — Sort direction.
  - `usernames` string[] — Filter results to conversations by these usernames.

## Response `200`

Indicates a successful response

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/revisions/deb2e8b751e7/schema)
