Hidden Variables of Inference Costs: Options After Model Selection
Users of Amazon Bedrock may overlook the fact that four request-level settings continue to affect costs even after model selection and prompt tuning. According to empirical tests published by the AWS Machine Learning Blog, four parameters—Cache Duration, Service Tier, Reasoning Effort, and MaxTokens—simultaneously change token throughput and applicable rates. This article summarizes how each option is reflected in the bill, how to verify it with response metadata, logs, and billing data, and establishes decision-making criteria that can be immediately applied in practice.
"Request-level options can still change the number of tokens processed by the service and the applicable rates. Each option varies depending on the model and workload." — AWS Machine Learning Blog
Prompt Cache: Rate and Break-Even Point Calculation by Duration
Bedrock stores repeated system instructions, tool definitions, and reference contexts using Explicit Caching for reuse. The supported TTL (Time-To-Live) for each model is as follows.
| Model Group | Supported TTL | Notes |
|---|---|---|
| Anthropic Claude Sonnet 5 / Opus 5 | 5 minutes, 1 hour | Uses `cache_control.ttl` field |
| OpenAI GPT-5.6 Series | Minimum 30 minutes | Minimum TTL of 30 minutes enforced |
Cache write and read rates are priced as multiples of the input token rate (based on Claude Sonnet 5 and Opus 5).
| Cache Operation | Rate Multiple | Description |
|---|---|---|
| 5-minute write | 1.25× | 1.25 times the input token rate |
| 1-hour write | 2.00× | 2 times the input token rate |
| Cache read | 0.10× | 0.1 times the input token rate |
This rate structure varies the optimal TTL based on reuse intervals.
- 5-minute cache: If the same prefix request occurs again within 5 minutes, the break-even point is reached from the first reuse. If the interval exceeds 5 minutes, a 1.25× write cost is incurred for each request.
- 1-hour cache: If the second request comes within 1 hour, profit begins from then. Requests must occur more than three times per hour to have an advantage over no cache.
In empirical tests, when a 1-hour checkpoint was set on Claude Sonnet 5 and the system prompt and tool definitions were changed once each, it was confirmed that 0 cache reads and new writes occurred. This is because changes at the front invalidate the back cache according to the checkpoint evaluation order (tool → system → message).
Cache Isolation in Multi-Tenant Environments
AWS specifies that cache entries are scoped at the account and region level. To enforce data boundaries between tenants, a tenant-specific SHA-256 hash should be prefixed to cacheable prefixes for partitioning. If hard boundaries are needed, such as for regulated workloads, separate AWS accounts for each tenant are recommended.
Service Tier: Conditional Half-Price Effect of Flex Tier
Batch jobs, evaluation harnesses, nightly summaries, backfills, and other latency-tolerant workloads can reduce costs by choosing the Flex tier instead of the basic (Standard) tier. Specify `serviceTier: "flex"` when making requests, and if a request is made to an unsupported model, a `ValidationException` is returned, resulting in failure without implicit fallback.
| Model | Flex Support |
|---|---|
| Amazon Nova 2 Lite | Supported |
| OpenAI gpt-oss-120b | Supported |
| Anthropic Claude Sonnet 5 | Not Supported |
| Anthropic Claude Opus 5 | Not Supported |
In Nova 2 Lite (us-west-2, at the time of writing), the Flex rate is posted at 50% of the standard rate, and in a cross-request test of 200 standard and 200 flex requests, the input and output token counts were the same, with median latency differences at noise levels. Billing data also confirmed the half-price charge.
| Standard | 100 |
| Flex | 50 |
Operational guidelines are as follows.
- Latency-sensitive traffic should maintain `default` (standard)
- Set application-level deadlines for flex requests
- Validate the actual applied tier with the `ResolvedServiceTier` CloudWatch metric
- Allow only one retry when catching unsupported model exceptions (the same exception occurs for incorrect requests)
Adaptive Reasoning Effort: Cost Surge Due to Default High Effort
Claude Sonnet 5 and Opus 5 perform high adaptive reasoning by default when the `thinking` field is not specified. Inference tokens are billed as output token rates, so applications migrated from Claude Sonnet 4.6 will incur new reasoning token costs without code changes. Claude Haiku 5.5 has a default of medium.
All three models support three levels: `low`, `medium`, and `high`, and the sum of reasoning tokens and response text tokens shares the `maxTokens` limit. Therefore, if `maxTokens` is set low, the depth of reasoning is forcibly limited, which may degrade quality.
Empirical Points
- The number of reasoning tokens can be checked via the `usage.reasoning_tokens` field in response metadata
- It is recommended to specify the budget in the form of `thinking: { type: "enabled", budget_tokens: N }`
- Ensure a buffer in `maxTokens` so that reasoning tokens do not encroach on output token limits
Max Tokens Setting: Implications of Combined Limits on Reasoning and Response
The `maxTokens` parameter limits the sum of reasoning tokens and final response tokens. In existing models, only the response length was controlled, but in reasoning function models, the reasoning budget compresses the response space. For example, if `maxTokens: 4000` is set and 3,500 tokens are used for reasoning, only 500 tokens remain for the response.
The cost management workshop sample code (in the `01-low-effort` folder) demonstrates a pattern for controlling costs with a low-effort mode and appropriate `maxTokens` combinations. Model-specific IDs and inference parameters must be adjusted to match the actual calling model.
Verification Pipeline: Triple Check with Metadata, Logs, and Billing
AWS recommends cross-verifying the following three sources.
1. Response Metadata: `usage.input_tokens`, `usage.output_tokens`, `usage.cache_read_input_tokens`, `usage.cache_write_input_tokens`, `usage.reasoning_tokens` 2. CloudWatch Logs: `ResolvedServiceTier`, cache hits/misses, latency distribution 3. Cost Explorer and Billing: Line items by model, tier, and cache type
Two sample notebooks are provided for immediate testing.
- Mixed TTL Caching: Multiple TTL mixed scenarios
- Tenant Isolation with Prompt Caching: Tenant hash partitioning pattern
Model-specific regional availability can be found on the "Models at a glance" page, while higher-level strategies such as batch inference, routing, and distillation can be referenced in the document "Effective cost optimization strategies for Amazon Bedrock."
Practical Checklist: 5 Steps to Apply from Tomorrow's Deployment
- [ ] Reset Cache TTL: Measure the reuse interval for the same prefix → If within 5 minutes, set 5-minute TTL; if frequent between 5 minutes and 1 hour, set 1-hour TTL
- [ ] Separate Flex Tier: Apply `serviceTier: flex` to endpoints dedicated to batch and backfill workloads, handle unsupported model exceptions
- [ ] Specify Reasoning Effort: Mandatory specification of `thinking.budget_tokens` for production Claude 5 series calls, review `low`/`medium` defaults
- [ ] Max Tokens Buffer: Recalculate `maxTokens` with reasoning token budget + expected response length + 20% margin
- [ ] Build Observability: Add `ResolvedServiceTier`, cache read/write tokens, and inference token metrics to the CloudWatch dashboard
These four options can be immediately applied without changing models, and each change can be tracked down to the metadata level in how it reflects on the bill. Cost optimization does not end with model selection but is completed through request parameter governance.