Error trying to use Claude on AWS Bedrock #172

Closed
opened 2026-02-16 17:25:35 -05:00 by yindo · 2 comments
Owner

Originally created by @Dizzzmas on GitHub (Jun 20, 2025).

Originally assigned to: @thdxr on GitHub.

Problem

With proper AWS credentials and region set in my env I'm getting this error when prompting:

AI_APICallError: undefined: Invocation of model ID anthropic.claude-sonnet-4-20250514-v1:0 with on-demand throughput isn’t supported. Retry your request with the ID or ARN of an inference profile that contains model
Screenshot 2025-06-20 at 13 43 51

Using Claude models on Bedrock seems to require specifying the region in model ID
Screenshot 2025-06-20 at 13 45 14

Suggested Solution

https://github.com/sst/opencode/pull/241

Detect bedrock + claude being used and append the aws region prefix from env to model ID

Originally created by @Dizzzmas on GitHub (Jun 20, 2025). Originally assigned to: @thdxr on GitHub. ## Problem With proper AWS credentials and region set in my env I'm getting this error when prompting: ```bash AI_APICallError: undefined: Invocation of model ID anthropic.claude-sonnet-4-20250514-v1:0 with on-demand throughput isn’t supported. Retry your request with the ID or ARN of an inference profile that contains model ``` <img width="1205" alt="Screenshot 2025-06-20 at 13 43 51" src="https://github.com/user-attachments/assets/876b7ed0-d4a6-4435-9b9c-ccae56554599" /> Using Claude models on Bedrock seems to require specifying the region in model ID <img width="1917" alt="Screenshot 2025-06-20 at 13 45 14" src="https://github.com/user-attachments/assets/cc143b41-c93a-4dd9-9972-27e0f9d96779" /> ## Suggested Solution https://github.com/sst/opencode/pull/241 Detect bedrock + claude being used and append the aws region prefix from env to model ID
yindo closed this issue 2026-02-16 17:25:35 -05:00
Author
Owner

@alejandro-angulo commented on GitHub (Jun 24, 2025):

I think this might be resolved. I got it to work by specifying both AWS_PROFILE and AWS_REGION as environment variables.

(Glad I found this issue because it helped me realize my version of opencode was out-of-date.)

@alejandro-angulo commented on GitHub (Jun 24, 2025): I think this might be resolved. I got it to work by specifying both `AWS_PROFILE` and `AWS_REGION` as environment variables. (Glad I found this issue because it helped me realize my version of opencode was out-of-date.)
Author
Owner

@adamdotdevin commented on GitHub (Jun 24, 2025):

yeah, this was fixed in #243, closing

@adamdotdevin commented on GitHub (Jun 24, 2025): yeah, this was fixed in #243, closing
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#172