How-toOfficial

Amazon Bedrock 推理省钱的 4 个请求级参数

Four Amazon Bedrock inference choices that affect cost

Why we picked it

很多人调完提示词发现 Bedrock 账单还在涨,这篇讲的就是原因:缓存时长、service tier、推理力度和 maxTokens 这 4 个请求参数在偷偷决定你的费率。每个都附了测试和验证方法,接了 Bedrock 的开发者直接照着改就行。

AWS 官方博客指出,Amazon Bedrock 的推理账单在调优提示词和应用逻辑后仍可能持续上涨,原因在于 4 个请求级选择:缓存时长(cache duration)、服务层级(service tier)、推理力度(reasoning effort)和 maxTokens。这 4 个参数直接改变服务处理的 token 数量以及适用的费率。文章展示了作者逐一测试每个参数的方法,并说明如何验证每项改动对成本的实际效果。

Image · AWS Machine Learning Blog
Body

这篇属于实操型成本优化指南:cache duration 决定缓存 token 按多长的时长计费,service tier 决定请求使用的费率档位,reasoning effort 影响推理模型消耗的 token 量,maxTokens 则限制单次响应的输出上限。对已经把 Claude、Llama 等模型接入 Bedrock 的团队来说,这 4 个都是每次 API 请求就能改的参数,不需要重写应用。

Original · AWS Machine Learning Blog

Four Amazon Bedrock inference choices that affect cost

Your Amazon Bedrock inference bill can keep climbing even after you tune prompts and application logic. Four request-level choices (cache duration, service tier, reasoning effort, and maxTokens) change how many tokens the service processes and the rate applied. We show how we tested each and how to verify the effect.

Industry Coordinates & Source Verification

This report is categorized under AITOP's "How-to" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows and US-China foundation model benchmarks and commercialization comparison. Key entities and technical topics under continuous tracking include Amazon Bedrock, AWS, Claude, 提示词工程.

Primary source verification: published directly by AWS Machine Learning Blog with first-party authority.