Bedrock Runtime: InvokeModel, https response error StatusCode: 404, RequestID: 2...

2026年07月20日 11:33 17.77 秒 success

错误信息

InvokeModel: operation error Bedrock Runtime: InvokeModel, https response error StatusCode: 404, RequestID: 26cf3ab7-fc76-4db8-93fc-baf40f1f54f4, ResourceNotFoundException: Model use case details have not been submitted for this account. Fill out the Anthropic use case details form before using the model. If you have already filled out the form, try again in 15 minutes.

AI 解决方案

🔍 报错分析

1. 🌐 错误翻译


原文:Model use case details have not been submitted for this account. Fill out the Anthropic use case details form before using the model. If you have already filled out the form, try again in 15 minutes.
译文:该账户尚未提交模型使用场景详情。在使用模型前,请先填写Anthropic使用场景详情表单。如果您已填写表单,请等待15分钟后重试。

2. 🎯 原因分析


  • 根本原因:AWS Bedrock服务未完成Anthropic模型的使用权限申请流程,导致资源未被授权

  • 具体位置:在调用Bedrock Runtime服务的InvokeModel接口时,因权限校验不通过触发404错误

  • 上下文场景:账户未提交Anthropic模型的使用场景表单,无法获得调用权限
  • 3. 💡 解决方案


  • 操作步骤

  • 登录AWS控制台,进入Bedrock服务

  • 在模型访问权限页面,找到Anthropic相关模型,点击"申请访问"

  • 填写完整使用场景详情表单,提交申请

  • 等待15分钟让系统完成权限同步后,重新执行代码
  • 4. 🛡️ 预防措施


  • 在使用AWS Bedrock新模型前,务必在控制台完成对应模型的权限申请和审批流程

  • 建议通过AWS CLI或控制台提前验证模型调用权限状态,避免运行时错误:

  •   aws bedrock list-foundation-models --query 'modelSummaries[?contains(modelId, \'anthropic\')]'
      

  • 对于生产环境,在代码中增加权限校验和错误处理逻辑,当出现ResourceNotFoundException时,引导用户先完成表单申请