Amazon Bedrock makes it easy to put a foundation model behind an API call. The pricing looks simple too: a price per million input tokens and a price per million output tokens. In a demo that is all there is to it. In production, the bill is driven by things the pricing page never shows you: how often your code calls the model, how much context it sends each time, and who else can call it.
This post covers the cost risks that catch teams out after launch, with the math, and what to put in place so a bug or a stolen key does not become a five-figure invoice.
Risk 1: context grows every turn
Models are stateless. For a multi-turn conversation or an agent that calls tools, your code sends the whole history again on every turn. Input tokens do not grow linearly with the number of turns, they grow roughly with the square of it.
Here is an illustration with assumed prices of $3 per million input tokens and $15 per million output tokens (check the current Bedrock pricing page for your model; the structure is what matters). Say an agent adds about 2,000 tokens of context per turn and produces 500 output tokens per turn:
- A normal 10-turn run: input tokens across all turns = 2,000 x (1 + 2 + ... + 10) = 110,000, costing $0.33. Output is 5,000 tokens, costing $0.075. Total about $0.41 per run.
- A run that loops to 50 turns: input = 2,000 x 1,275 = 2,550,000 tokens, costing $7.65. Output is 25,000 tokens, costing $0.375. Total about $8.03 per run.
Five times the turns, about twenty times the cost. At 10,000 runs a day, normal runs cost about $4,050. If a bug, a bad prompt or a tool that keeps returning errors sends one run in ten into that 50-turn loop, the same traffic costs about $11,670 a day (9,000 x $0.405 plus 1,000 x $8.025), nearly three times as much, and nothing fails. The calls succeed. The agent is just busy.
Risk 2: output tokens cost several times more
For most models, output tokens are priced a multiple of input tokens (five times in the example above). Two consequences. Verbose prompts that ask for long explanations cost more than they look. And you are billed for tokens actually generated, not the max_tokens limit you set, so a high limit only matters when the model uses it. Ask for structured, short answers where you can.
Risk 3: retries multiply everything
Throttling, timeouts and validation failures trigger retries. A client that retries three times on every error turns one failed request into four billed ones if the failure happens after the model has already generated tokens. Cap retries, add backoff with jitter, and make sure a malformed-output retry loop has a hard limit.
Risk 4: RAG sends more than you think
Retrieval-augmented generation attaches retrieved chunks to every question. Pulling twenty chunks of 500 tokens each adds 10,000 input tokens to every request before the user has typed anything. Tune the number of chunks, keep chunks small, and for repeated static prefixes (long system prompts, shared documents) use prompt caching on the models that support it, which bills cached input at a reduced rate.
Risk 5: always-on capacity and fixed costs
On-demand Bedrock is pay per token, so idle costs nothing. Some features are not like that:
- Provisioned Throughput is billed per model unit per hour whether or not you send a single request, with optional commitment terms. A unit bought for a load test and forgotten keeps billing.
- Knowledge Bases need a vector store. If that is an OpenSearch Serverless collection, it has a baseline of compute units that bills around the clock, which at the default setup comes to a few hundred dollars a month before the first query.
- Guardrails are billed by the amount of text they evaluate, on inputs and outputs, so they add a cost to every call that uses them.
- Fine-tuned and custom models carry storage and hosting charges on top of inference.
Risk 6: anyone with invoke permission can spend your money
Bedrock cost is a function of who can call the model. A leaked access key with bedrock:InvokeModel is a direct line to your bill, and attackers know it. Security researchers have given the abuse of stolen cloud credentials to run large language models a name, LLMjacking, and estimated that victims can be billed tens of thousands of dollars a day. The attacker's calls look exactly like yours: valid API requests that succeed.
Two quick defences. Scope the permission to the specific model ARNs your application uses instead of bedrock:* on *. And if you only use Bedrock in one or two regions, use a service control policy to deny it everywhere else. Our post on AWS Organizations and the blast radius problem shows the pattern.
Risk 7: the bill arrives late and without detail
Cost Explorer shows Bedrock spend a day or more after it happens, grouped by model at best. It cannot tell you which team, feature or request caused a spike. By the time it shows up, a runaway loop has been running for a day.
What to put in place
- Watch tokens, not dollars. Bedrock publishes
InputTokenCountandOutputTokenCountper model to theAWS/BedrockCloudWatch namespace within minutes. Alarm on the sum per model against a baseline of your normal traffic. - Attribute usage. Use application inference profiles with cost allocation tags so spend maps to a team or feature rather than a single model line.
- Turn on model invocation logging to S3 or CloudWatch Logs so you can see who called what, with token counts, when you need to investigate.
- Hard-limit your agents. A maximum number of turns, a maximum total tokens per run, and a timeout. These are the cheapest cost controls you will ever write.
- Restrict invoke permission to named models and the roles that need them, and remove long-lived access keys from anything that can call Bedrock.
- Review provisioned throughput and vector stores monthly for anything left running after an experiment.
SpikeCatcher polls Bedrock token metrics for every model in your account every 10 minutes and alerts when input or output tokens jump well above their baseline, and its CloudTrail monitoring flags the unusual activity that often goes with a stolen key. That means a looping agent or an LLMjacking attempt surfaces within minutes instead of on tomorrow's cost report. 14-day free trial, 5-min setup, read-only IAM.
Related articles
Bought the wrong Savings Plan? You have a short window to return it
AWS lets you return a mistaken Savings Plan for a limited time. The exact rules, the calendar-month trap, and which plans cannot be returned.
Spot vs On-Demand: when the math works
Spot is cheaper per hour, not always per unit of finished work. The break-even math, where it holds, and the traps that erase the savings.
The access key nobody retired: how to find and kill stale AWS keys
A vendor key, never retired, found in their environment. Audit commands to find unused AWS access keys, check what they did, and retire them safely.
Protect your AWS account — 14-day free trial
Real-time threat and cost anomaly detection. Detects credential theft, cryptomining, and runaway costs in under 15 minutes. 5-minute setup via CloudFormation.
No credit card. Cancel anytime.