Artificial Intelligence1 min read

Four Amazon Bedrock inference choices that affect cost

By · Published by Everything Blog

In short

Amazon Bedrock costs depend heavily on factors including cache duration, reasoning tokens, and service tiers, all tracked via metadata in API responses. Prompt caching duration alters spending based on request frequency, where five-minute and one-hour writes cost 1.25 and two times standard input rates for models like Anthropic Claude Sonnet 5. Additionally, checkpoints are processed sequentially through tools, system instructions, and messages, meaning any early modification invalidates later segments and prompts billable rewrites.

Key points

  • Setting appropriate prompt cache durations prevents unnecessary expenses when requests ar…: Setting appropriate prompt cache durations prevents unnecessary expenses when requests arrive more than five minutes apart.
  • Restructuring prompts to avoid early modifications protects downstream checkpoints from p…: Restructuring prompts to avoid early modifications protects downstream checkpoints from paid rewrites caused by cache invalidation.
  • Multi-tenant architectures should prepend tenant-specific SHA-256 hashes to isolate share…: Multi-tenant architectures should prepend tenant-specific SHA-256 hashes to isolate shared prompt data scoped across accounts and regions.

Sources checked by our analysis pipeline: 1

Artificial Intelligence

Four Amazon Bedrock inference choices that affect cost

Your Amazon Bedrock inference bill can keep climbing after you tune prompts and application logic. Request-level choices can still change how many tokens the service processes and the rate applied to them. Cache duration, service tier, reasoning effort, and maxTokens

can affect cost without changing your model or prompt.

Each choice depends on the model and workload. This post shows how we tested each choice and how to verify its effect from response metadata, logs, and billing data.

To try these settings yourself, start with the Amazon Bedrock Samples notebooks Mixed TTL Caching and Tenant Isolation with Prompt Caching. For maxTokens

and reasoning effort, see the 01-low-effort folder of the sample-code-for-genai-cost-management-workshop GitHub repo. Each sample sets its own model ID, so change it, and the inference parameters, to match the model you call. For model availability by AWS Region, refer to Models at a glance. For broader decisions such as model selection, batch inference, routing, and distillation, see Effective cost optimization strategies for Amazon Bedrock.

Where inference cost comes from

Artificial Intelligence