﻿---
title: Monitor usage and costs for Elastic Agent Builder
description: Understand how Agent Builder calculates token usage, monitor conversation costs, and learn how execution-based billing works on Elastic Cloud.
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/explore-analyze/ai-features/agent-builder/monitor-usage
products:
  - Elastic Cloud Hosted
  - Elastic Cloud Serverless
  - Elastic Documentation
  - Elastic Observability
  - Elastic Security
  - Elasticsearch
  - Kibana
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available since 9.3, Preview in 9.2
---

# Monitor usage and costs for Elastic Agent Builder
This page covers how to monitor token usage in Elastic Agent Builder and understand how usage translates to costs across different deployment types.
For observability beyond token counts, Elastic Agent Builder can also collect detailed execution traces into your Elasticsearch deployment. To turn on trace collection and explore or alert on the data, refer to [Collect agent traces](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/explore-analyze/ai-features/agent-builder/collect-traces).

## Token usage

When working with Elastic Agent Builder, total token usage typically exceeds the visible conversation text. Because Elastic Agent Builder uses an agentic framework, a single user request often triggers multiple model calls to process reasoning steps, run tools, and interpret results.
<applies-to>Elastic Stack: Generally available since 9.5</applies-to> <applies-to>Elastic Cloud Serverless: Generally available</applies-to> To keep this efficient, Elastic Agent Builder automatically routes some of these low-effort operations to a faster, lower-cost model. For details, refer to [Fast model routing](/elastic/docs-content/pull/9507/explore-analyze/ai-features/agent-builder/models#fast-model).
Token counts include:
- **Input tokens:** These are tokens **sent** to the model, which accumulate throughout the session. They include the user's current query, the conversation history from previous rounds, system prompts, and the results returned from any tools used during execution.
- **Output tokens:** These are tokens **generated** by the model. These include the final response visible to the user, as well as all internal reasoning steps, tool calls, and intermediate results generated by the model.

<applies-to>Elastic Stack: Planned</applies-to> <applies-to>Elastic Cloud Serverless: Generally available</applies-to> When a model reports thinking tokens as a separate count, those tokens are included in the output total.
<note>
  Each conversation round includes all previous rounds as context. This means token usage at each step depends on the entire conversation size, not only the current message.
</note>

For more information on billing and token costs, refer to [Elastic pricing](https://www.elastic.co/pricing).

### Retrieve token consumption with the API

<applies-to>
  - Elastic Stack: Preview in 9.4
</applies-to>

To retrieve per-conversation token usage data for a specific agent across users, use the [token consumption API](https://www.elastic.co/docs/api/doc/kibana/operation/operation-post-agent-builder-agents-agent-id-consumption). For quick examples, refer to [Token consumption](/elastic/docs-content/pull/9507/explore-analyze/ai-features/agent-builder/kibana-api#token-consumption).
This API complements the UI by returning token totals, round counts, LLM call counts, and warning indicators without exposing message content or tool results.
<note>
  This API provides visibility into token usage but does not support setting token limits or quotas for users or agents.
</note>


### View token usage in the UI

Where you find token usage for a response, and how much detail it shows, depends on your version.
<applies-switch>
  <applies-item title="{ stack: ga 9.6+, serverless: ga }" applies-to="Elastic Cloud Serverless: Generally available, Elastic Stack: Planned">
    To view timing and token usage for a response:
    1. After the agent responds, click the execution time. The control shows a clock icon `clock` and a duration such as 12s.
       The details list **Execution time**, **Tokens sent**, and **Tokens received**.
    2. To view the complete response data, click **View response JSON**. A flyout titled **Raw response** opens.
       The JSON includes `conversation_id`, `agent_id`, and an `execution` object. The following screenshot shows the top of the **Raw response** flyout:
       ![Raw response flyout showing conversation_id, agent_id, and execution fields](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/explore-analyze/ai-features/agent-builder/images/token-usage-raw-response-9.6.png)
    The details can also show these counts, each included in the total it appears under:

    | Count                | Appears under       | When                                                         |
    |----------------------|---------------------|--------------------------------------------------------------|
    | **Cache hit tokens** | **Tokens sent**     | The model reports them, including a reported zero            |
    | **Reasoning tokens** | **Tokens received** | The model reports thinking tokens, including a reported zero |
    When the response uses two or more connectors, the details include two tabs:
    - **Total**: Shows usage for the whole response. The details open on this tab.
    - **By model**: Splits that usage by connector.
    For example, [fast model routing](/elastic/docs-content/pull/9507/explore-analyze/ai-features/agent-builder/models#fast-model) can use the model you selected and a fast model in the same response.A response that uses one connector shows only the summary. A response created before per-model usage was available also shows only the summary.The following screenshot shows the **Total** tab, with cache hit tokens under **Tokens sent** and reasoning tokens under **Tokens received**:
    ![Screenshot of the Total tab showing execution time, tokens sent with cache hit tokens, and tokens received with reasoning tokens](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/explore-analyze/ai-features/agent-builder/images/token-usage-total.png)
    The **By model** table starts with an **All models** row, followed by one row per connector. It has these columns:
    - **Model**: The connector name. When the name starts with the model creator, that prefix is omitted. Hover over a model name to see the full connector name.
    - **LLM calls**: The number of times that connector was called.
    - **Tokens sent**: Input tokens. When the response reported cache hits, the column heading adds **(cached)** and each row shows the cached count in parentheses.
    - **Tokens received**: Output tokens. When the response reported thinking tokens, the column heading adds **(reasoning)** and each row shows the reasoning count in parentheses.
    If the connector can't be found, for example because it was deleted, the **Model** column shows the model identifier instead. If there is no model identifier, it shows the connector identifier.The main values in **LLM calls**, **Tokens sent**, and **Tokens received** are always numbers. A dash appears only inside the parentheses, where it means that connector didn't report the cached or reasoning count. Its tooltip says **Not reported by this model**.The following screenshot shows the **By model** tab for a response that used the selected model and a fast model. The fast model row shows a dash for the values it didn't report:
    ![Screenshot of the By model tab with an All models row and one row each for the selected model and the fast model, including a dash for values the fast model did not report](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/explore-analyze/ai-features/agent-builder/images/token-usage-by-model.png)
  </applies-item>

  <applies-item title="stack: ga =9.5" applies-to="Elastic Stack: Generally available in 9.5">
    To view timing and token usage for a response:
    1. After the agent responds, click the execution time. The control shows a clock icon `clock` and a duration such as 12s.
       The details list **Execution**, **Tokens sent**, and **Tokens received**.
    2. To view the complete response data, click **View response JSON**. A flyout titled **Raw response** opens.
  </applies-item>

  <applies-item title="stack: ga 9.3-9.4" applies-to="Elastic Stack: Generally available from 9.3 to 9.4">
    Token usage is shown only for rounds that have steps. Click **Completed reasoning** to open the reasoning panel. Token totals are at the bottom of that panel:
    - `sort_up`: Input tokens.
    - `sort_down`: Output tokens.
    - The clock beside them: How long the agent reasoned before it started its answer, in seconds. Its tooltip says **Total reasoning time**.
    The following screenshot shows the input and output token totals at the bottom of the reasoning panel:
    ![Screenshot of token totals at the bottom of the reasoning panel, with input and output token counts](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/explore-analyze/ai-features/agent-builder/images/token-usage.png)
    To view the complete response data, click **View JSON**. A flyout titled **Raw response** opens. The following screenshot shows the **Raw response** flyout with the response data in JSON format:
    ![Screenshot of the Raw response flyout](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/explore-analyze/ai-features/agent-builder/images/token-usage-json-raw-response.png)
  </applies-item>

  <applies-item title="stack: preview =9.2" applies-to="Elastic Stack: Preview in 9.2">
    Elastic Agent Builder doesn't record or show token usage for a conversation round. The raw response, available from **Thinking completed** → **View raw response**, doesn't include token counts.
  </applies-item>
</applies-switch>

<applies-to>Elastic Stack: Generally available since 9.5</applies-to> <applies-to>Elastic Cloud Serverless: Generally available</applies-to> These counts are specific to each Elastic Agent Builder response. To monitor aggregate token usage across all AI features in Kibana, turn on token usage tracking and use the managed dashboard. Refer to [Track token usage across AI features](/elastic/docs-content/pull/9507/explore-analyze/ai-features/manage-access-to-ai-assistant#track-token-usage-across-ai-features).

## Execution-based billing

How Elastic Agent Builder usage is billed depends on your deployment type.

### Elastic Cloud Serverless

On Elastic Cloud Serverless, Elastic Agent Builder usage is billed based on **executions**. An execution is measured by each completed interaction with an AI agent (a chat input and output). More complex interactions, measured by the number of input tokens used, are metered for additional executions. Each unit of 50,000 input tokens counts as one additional execution. If the agent encounters an error and does not return a response, no executions are metered.
Every Serverless project includes a free monthly allocation of agent executions, and volume tier discounts apply at higher usage levels. If your usage stays within the free allocation, there is no impact to your bill.
**Example:** A conversation round that uses 91,613 input tokens counts as two Elastic Agent Builder executions: one base execution, plus one additional execution for the second block of 50,000 input tokens.
When an agent triggers a [workflow](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/explore-analyze/workflows) as part of its response, the workflow execution is metered separately. Each Serverless project also includes a free monthly allocation of workflow executions.
For detailed rates, free allocations, and tier breakpoints, refer to the billing dimensions page for your solution:
- [Elasticsearch Serverless billing dimensions](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/deploy-manage/cloud-organization/billing/elasticsearch-billing-dimensions)
- [Elastic Observability Serverless billing dimensions](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/deploy-manage/cloud-organization/billing/elastic-observability-billing-dimensions)
- [Elastic Security Serverless billing dimensions](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/deploy-manage/cloud-organization/billing/security-billing-dimensions)

For general pricing information, refer to [Elastic pricing](https://www.elastic.co/pricing).

### Elastic Cloud Hosted

<applies-to>
  - Elastic Stack: Generally available since 9.5
</applies-to>

On Elastic Cloud Hosted, Elastic Agent Builder usage is billed based on executions. Each completed interaction with an agent counts as at least one execution. Interactions that use more than 50,000 input tokens count as additional executions in 50,000-token increments. If the agent encounters an error and does not return a response, no executions are metered.
The first 10,000 Elastic Agent Builder executions across the Elastic Cloud Hosted deployments in an Elastic Cloud organization each month are included. Additional executions are billed according to the published amounts.
When an agent invokes a [workflow](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/explore-analyze/workflows), the workflow execution is metered separately. Refer to the [Hosted add-ons pricing table](https://cloud.elastic.co/cloud-pricing-table?productType=stack_hosted&group=addons&dimension=executions) for current billing amounts.
This billing model doesn't apply to Elastic Cloud Hosted [FedRAMP authorized Cloud offerings](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/deploy-manage/deploy/elastic-cloud/fedramp), which remain under promotional pricing.

### Self-managed, Elastic Cloud on Kubernetes, and Elastic Cloud Enterprise

Elastic Agent Builder and [workflows](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9507/explore-analyze/workflows) on self-managed deployments are currently under promotional pricing and available at no additional charge. Elastic Agent Builder is included with the Enterprise license tier.