
Most small teams that started using AI coding assistants in 2024 or 2025 had the same experience. Everything looked fine for the first few weeks. Then someone opened a cloud invoice and found a line item for Amazon Bedrock that was three or four times what anyone expected. Nobody had set a budget, nobody had tagged the calls by developer or project, and the only person who could explain the spend was a contractor who had already left.
This is not a rare problem. Token-based pricing is easy to start and hard to reason about after the fact. A single agentic coding session that reads a large repository, retries failed tool calls, and re-sends a long context window can consume more tokens in ten minutes than a developer's entire previous week of manual prompting. Multiply that across five engineers, two CI pipelines, and a code review bot, and a team that budgeted a few hundred dollars a month can easily land in four figures without a single alarm going off.
This article is a practical guide to AI coding tool cost control on Amazon Bedrock for small teams, meaning roughly two to fifty people without a dedicated FinOps function. You will learn how Bedrock billing actually works, how to attribute spend to people and projects, how to set hard and soft caps, and how to choose between the tooling options available. The examples use approximate numbers that you should verify against current AWS pricing for your region and models, because rates change. The mechanics, however, stay the same.
Key Takeaways
- Bedrock bills by input and output tokens, and agentic coding tools often send far more input tokens than people expect, because they resend repository context on every turn.
- You cannot control what you cannot attribute. Tag every workload, create separate IAM roles or application profiles per developer or project, and turn on cost allocation tags before you do anything else.
- Use AWS Budgets with both forecasted and actual alerts, and treat alerts as a first line of defense rather than a cap, since budget actions are delayed relative to real usage.
- Real caps come from architecture: a gateway or proxy that enforces per-user token quotas, a model allowlist that routes routine work to cheaper models, and context limits in the tool itself.
- Review spend weekly for the first month, then monthly. Most teams find one or two runaway workflows in the first review that account for the majority of the bill.
- Write down a policy for who can enable which models and what happens when a budget is breached. A cap nobody owns will be quietly raised the first time it blocks a deadline.
How Amazon Bedrock Pricing Works for AI Coding Tools
Bedrock charges per model, per direction, per token. For most text models you pay one rate for input tokens and a higher rate for output tokens, and the rates differ substantially between model families and between tiers within a family. Some models also offer cache read and cache write pricing, which can cut costs sharply for repetitive context but adds its own accounting complexity.
The number that surprises people is input. A coding assistant rarely sends only your latest question. It sends system instructions, the files it has opened, tool definitions, the conversation so far, and often large chunks of the repository. Each turn in an agent loop can resend most of that. A session that makes 40 tool calls over a 60,000-token working context is sending roughly 2.4 million input tokens, even if the developer only typed three sentences.
Three things drive most of the cost:
- Context size per call. Large open files and long histories are the biggest multiplier.
- Number of calls per task. Agent loops, retries, and automated review passes multiply everything.
- Model tier. The most capable model can cost several times more per token than a smaller one, and tools often default to the largest.
A worked example
Suppose a five-person team uses an AI coding assistant backed by a mid-tier model. Each developer runs about 20 agentic tasks per working day. Each task averages 15 model calls, and each call averages 30,000 input tokens and 1,500 output tokens. Using illustrative rates of $3.00 per million input tokens and $15.00 per million output tokens:
- Input per task: 15 calls × 30,000 tokens = 450,000 tokens, or 0.45 million.
- Output per task: 15 calls × 1,500 tokens = 22,500 tokens, or 0.0225 million.
- Cost per task: (0.45 × $3.00) + (0.0225 × $15.00) = $1.35 + $0.34 = about $1.69.
- Per developer per day: 20 tasks × $1.69 = about $33.80.
- Team per month (five people, 21 working days): $33.80 × 5 × 21 = about $3,549.
Now suppose the team had budgeted $500 a month based on a single developer's rough experiments. The gap is not a rounding error. It is a planning failure, and it is exactly why attribution and caps need to be in place before wide rollout. Note also that the largest lever here is context size: trimming the average input from 30,000 to 12,000 tokens per call cuts the input portion by more than half without changing the model at all.
Step One: Make Every Token Attributable
Before you can cap spend, you need to know who and what is spending it. Attribution is the foundation of every other control in this article, and it is the step small teams skip most often.
There are three layers to get right:
Cost allocation tags
Activate cost allocation tags in the AWS Billing console for keys such as team, project, and developer. Tags only appear in Cost Explorer after they are activated and after a delay of about a day, so turn them on early. Apply tags to any resource that drives Bedrock usage: IAM roles, application profiles, and compute running the tooling.
Separate identities per user or service
Do not let five developers share one access key. Create an IAM role per developer or per service, and grant each only the Bedrock model access it needs. This gives you a clean dimension for spend and lets you revoke one person's access without breaking everyone else's workflow.
Application inference profiles
Bedrock supports application inference profiles, which let you associate tags with inference traffic so that usage shows up under your own labels. Create one profile per project or per team, tag it, and point your tools at the profile rather than the raw model identifier. This is the cleanest way to answer "which project spent what" without guessing from request logs.
- Decide on your tag keys. Keep them to three or four at most:
team,project,owner, and optionallyenvironment. - In the AWS Billing console, go to Cost allocation tags and activate each key.
- Create an IAM role per developer and one per automated pipeline. Tag each role with its owner.
- Create an application inference profile for each active project and tag it with the project name.
- Configure each developer's tool to use their own role and the relevant project profile.
- Wait 24 hours, then open Cost Explorer, group by the
ownerandprojecttags, and confirm the numbers reconcile with your expectations.
If the grouping shows large amounts under "untagged," something is calling Bedrock outside your managed paths. Find it before proceeding. An untagged bucket is almost always a script, a notebook, or a forgotten integration.
Step Two: Set Budgets That Actually Notify You in Time
AWS Budgets is the simplest starting point. Create a monthly cost budget scoped to Bedrock, filtered by your tags, with two kinds of alerts: an actual-spend alert at a threshold such as 80 percent, and a forecasted alert that fires when projected month-end spend crosses 100 percent of the budget.
The forecasted alert is the more valuable one. Actual-spend alerts tell you that you have already spent the money. Forecast alerts can tell you on day nine of the month that you are on pace to overshoot, which gives you time to act.
Budgets have a known limitation: cost data is delayed, typically by several hours and sometimes longer. A runaway agent loop can burn meaningful money between the time it starts and the time the alert arrives. Treat budget alerts as a smoke detector, not a sprinkler system. They tell you there is a fire. They do not stop it.
Budget actions
AWS Budgets can also apply actions when a threshold is hit, such as attaching a restrictive IAM policy to a role. This can stop further calls, but it is a blunt instrument. A team that wakes to find its entire CI pipeline locked out because of a budget action will not thank you. If you use budget actions, scope them to individual developer roles rather than shared pipelines, and make sure someone is notified the moment one fires.
Step Three: Enforce Real Caps Through Architecture
Alerts and budgets cover visibility. Hard caps need an enforcement point between the developer and the model. For small teams this usually means one of three approaches, and the right choice depends on how many tools you run and how much engineering time you can spare.
Comparing the main options
| Approach | Enforcement strength | Setup effort | Per-user quotas | Model routing | Best for |
|---|---|---|---|---|---|
| AWS Budgets alerts only | Weak (notification only) | Low (under an hour) | No | No | Teams just starting out |
| Budget actions with IAM | Medium (blunt lockout) | Low to medium | Partial, per role | No | Protecting individual roles |
| Self-hosted LLM gateway or proxy | Strong (token-level) | Medium to high | Yes | Yes | Teams with 5 to 50 developers and some infra skill |
| Managed AI gateway product | Strong | Low to medium | Yes | Yes | Teams that want quotas without building them |
| Tool-side settings only | Weak to medium (varies by tool) | Low | Sometimes | Sometimes | Single-tool setups with a single owner |
My own experience, after running a small team through two quarters of this, is that AWS Budgets plus tool-side settings get you about 70 percent of the way for the first month. The remaining 30 percent, the part that stops a bad week from becoming a bad quarter, requires a gateway. Teams that try to avoid building or buying one usually end up writing a spreadsheet they stop updating.








