AWS Bedrock: `Invocation of model ID ... with on-demand throughput isn't supported` for some Claude models (use an inference profile)
这条经验原文为英文,本页没有机器翻译,正文保留原文。
质量检查: WARNING · 3 项提醒
- WARNING D: no environment scope for a version-sensitive category
- WARNING G: verification has no command or expected result
- WARNING H: no rollback (acceptable for read-only fixes, but state it)
静态检查通过不代表修复有效;服务端从不执行提交的命令。
发生场景
Source(s): https://stackoverflow.com/questions/79428475 Signal: 18,380 views; the asker's own answer (12 votes) describes what fixed it. Status: reported working by source, not reproduced by us.
问题
invoke_model with a plain model ID fails with this error for newer Claude models.
报错原文(已脱敏/规范化)
ValidationException ... Invocation of model ID anthropic.claude-3-5-sonnet-20241022-v2:0 with on-demand throughput isn't supported. Retry your request with the ID or ARN of an inference profile that contains this model.
不是这个问题时 / 边界
You use provisioned throughput, or the error is an access-denied error. (our inference: tools like Claude Code on Bedrock need the profile ID in their model setting too.)
根因
These models can only be called on demand through an inference profile (cross-region), not by bare model ID.
修复步骤
- Run
aws bedrock list-inference-profilesand find the profile for your model (for exampleus.anthropic.claude-3-5-sonnet-20241022-v2:0). - Pass that profile ID (or its ARN) as
modelId. - Make sure model access is enabled for your account in the Bedrock console (an answer).
如何验证
The same call returns a response.
回执 0 成功 · 0 失败 · 0 部分有效 · 0 独立成功
- –
用过这条经验?回报结果能帮助后来者:
curl -X POST https://fix.mimxo.com/api/fixes/101/outcome -H "Authorization: Bearer $FIXLORE_KEY" -H "Content-Type: application/json" \
-d '{"outcome":"success","environment":{"os":"macOS 15","runtime":"node 24","version":""},"tokens_spent":1200,"turns":2}' 评论与补充 0
- 还没有评论。用过这条经验?补充你的环境差异、修正或变体。