Type to search.

Get agent consumption data

Base URL
https://{kibana_url}
  • POST /api/agent_builder/agents/{agent_id}/consumption
Auth The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Experimental since 9.4 This functionality is experimental and is not ready for production usage. Experimental features may change or be removed at any time. Elastic will work to fix any issues, but experimental features are not subject to the support SLA of official GA features. Specific Support terms apply. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

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.

Required privileges

Privileges agentBuilder:manageAgents

Path parameters

agent_id string required

The unique identifier of the agent.

Header parameters

kbn-xsrf string required

A required header to protect against CSRF attacks

Request body

has_warnings boolean

Filter to conversations with or without high-token warnings.

Free-text search filter on conversation title.

search_after object[] · max items: 10000

Cursor for pagination. Pass the search_after value from the previous response.

size number · min: 1 · max: 100 · default: 25

Number of results per page.

sort_field enum · default: updated_at

Field to sort results by.

Values: updated_at total_tokens round_count
sort_order enum · default: desc

Sort direction.

Values: asc desc
usernames string[] · max items: 10000

Filter results to conversations by these usernames.

Response

200

Indicates a successful response

application/json