DEV Community

Cover image for Predicting Your AI Agent's Cost
Laura Salinas for AWS

Posted on

Predicting Your AI Agent's Cost

I spent 2025 speaking at various developer/tech events around North America and out of all the feedback I received there was one thing that kept resurfacing:

Agents sounds interesting-- but how can I better predict the costs as I experiment?

Today I'm hoping to shed some light on how you can predict costs for agents you develop and deploy on AWS. The tools and methods I'll cover are specific to deploying agents using AWS services, so be sure to check pricing with any third-party tools, extensions etc to get a full picture of what your costs can be if you're using those within your applications as well.

Suffice it to say, estimating costs before you go to production is tricky because agent costs are emergent, basically they depend on how many steps the agent takes, how long the context grows, what tools it invokes, and how often it's called. I'll address the elements that we can control and share best practices for areas that are controlled/modified as you develop.

Pricing Out Your Agent

The cost of your agent is not simply the amount of input and output tokens consumed during user queries. What I've realized from speaking to developers of all levels, is there's a fundamental misunderstanding of what "counts" when you're pricing out an agent for a particular project. There are additional costs in the agent workflow that can include (amongst others):

1) System Prompts
2) Tool Schemas
3) Retrieved Context
4) Intermediate Reasoning Steps
5) Tool Call Results

Now this isn't a post about managing your context or contextual engineering, so if you want to take a side quest and learn more about managing context for your agents, I recommend checking out the blog "On Contextual Engineering" by an AWS Gen AI Specialist.

Alright with those primers out of the way, let's discuss how you can track and predict the cost of your agent proof of concept before you take it to production.

AWS Pricing Calculator

The first place to start with back of the napkin math is the AWS Pricing Calculator. As it relates to building and deploying agents on AWS, the recommended pathway as of this write up is to use Amazon Bedrock AgentCore. If you have not heard of AgentCore don't fret, it's still relatively new in the world of AWS having been generally released on October 13, 2025. If you want to brush up on essentials first I cover my first impressions with a simple demo in a previous post:

Within the calculator you can toggle various components AgentCore offers such as Runtime, Gateway, Memory, Identity, Observability, Browser Tools and Code Interpreter.

For a basic agent you can start calculating costs with Runtime for basic functionality, and perhaps toggle Memory if you're looking to add native short-term (STM) or long-term (LTM) memory to the agent.

⚠️ Note: This does not yet factor in LLM usage which would require adding Amazon Bedrock estimates to your calculation to get a full picture.

Here's a conservative example for a proof of concept I'm working on only with AgentCore Runtime costs factored in:

With this first pass you can start to understand month over month what your agent costs begin to look like. Of course this is not an exact science, as your agent grows over time and its use in the larger application stabilizes, your costs may look different than initial calculations in the calculator.

AWS Cost Explorer

Ok, so you have a basic idea of what it could cost. Now let's dive one step further (this requires your AWS account) and learn how to track & understand charges once you are building. My favorite way to do this natively with no extra 3rd party tooling is with the built in Cost Explorer tool in the AWS console.

Here's what you get from using Cost Explorer

  • Interactive graph visuals

  • Ability to drill down by service, region, API call and more

  • Review data 3yrs in the past and forecast ahead up to 1yr

  • Easily save reports and exports as CSVs

Tracking

The first thing I like to do when diving into my project costs is setting the appropriate filters in the Report parameters pane.

  1. Date Range: Specific periods I tested the agent
  2. Granularity: Daily
  3. Dimension: I rotate between these to see details about specific usage

a. Usage type

b. API Operation

Typically you won't see values trending negative, but I am demonstrating this in a Free Tier account so I am not being charged for any of this sample workload, the blue bars in these graphs are AWS credits applying to the account.

Forecasting

From the same Report parameters pane you can forecast by selecting how many months into the future you want the algorithm to run through. This can help paint a picture of what expected costs may look like if your agent utilization remains the same over time. Obviously with spikier workloads and high traffic scenarios this is a bit harder to predict over time but you can at the very least find a baseline usage model to grow/shrink from.

Bonus Round! 🤑

I know what you're thinking: isn't this all a little archaic to be doing manually...?

Well you can actually try out an MCP server built exclusively for AWS Pricing to enable your coding assistant to connect and use this information on your behalf.

I'm using the Kiro Agentic IDE and can one-click install the pricing MCP server for ease of use as I chat with the agent while I code.

Kiro gives me some detailed information on how I can think about pricing the agent:

And even takes it one step further to generates a sample pricing example that I can use to plug-and-play with my values:

Additional Resources 📚

Top comments (0)