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.
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.
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.
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.
For more information on billing and token costs, refer to Elastic pricing.
To retrieve per-conversation token usage data for a specific agent across users, use the token consumption API. For quick examples, refer to 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.
This API provides visibility into token usage but does not support setting token limits or quotas for users or agents.
Where you find token usage for a response, and how much detail it shows, depends on your version.
To view timing and token usage for a response:
After the agent responds, click the execution time. The control shows a clock icon and a duration such as 12s.
The details list Execution time, Tokens sent, and Tokens received.
To view the complete response data, click View response JSON. A flyout titled Raw response opens.
The JSON includes
conversation_id,agent_id, and anexecutionobject. The following screenshot shows the top of the Raw response flyout:
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 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:
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:
To view timing and token usage for a response:
After the agent responds, click the execution time. The control shows a clock icon and a duration such as 12s.
The details list Execution, Tokens sent, and Tokens received.
To view the complete response data, click View response JSON. A flyout titled Raw response opens.
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:
- : Input tokens.
- : 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:
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:
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.
How Elastic Agent Builder usage is billed depends on your deployment type.
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 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
- Elastic Observability Serverless billing dimensions
- Elastic Security Serverless billing dimensions
For general pricing information, refer to Elastic pricing.
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, the workflow execution is metered separately. Refer to the Hosted add-ons pricing table for current billing amounts.
This billing model doesn't apply to Elastic Cloud Hosted FedRAMP authorized Cloud offerings, which remain under promotional pricing.
Elastic Agent Builder and 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.