[PR #241] [MERGED] fix(#243): claude on aws bedrock #9567

Closed
opened 2026-02-16 18:13:46 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/241
Author: @Dizzzmas
Created: 6/20/2025
Status: Merged
Merged: 6/20/2025
Merged by: @thdxr

Base: devHead: fix/bedrock-claude


📝 Commits (3)

📊 Changes

3 files changed (+103 additions, -25 deletions)

View changed files

📝 bun.lock (+47 -0)
📝 packages/opencode/package.json (+3 -2)
📝 packages/opencode/src/provider/provider.ts (+53 -23)

📄 Description

Problem

https://github.com/sst/opencode/issues/243
It's nice to have model expenses be part of the AWS bill & currently opencode doesn't work for me with Claude on Bedrock

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

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

Tested it & worked well:
Screenshot 2025-06-20 at 13 49 02


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/241 **Author:** [@Dizzzmas](https://github.com/Dizzzmas) **Created:** 6/20/2025 **Status:** ✅ Merged **Merged:** 6/20/2025 **Merged by:** [@thdxr](https://github.com/thdxr) **Base:** `dev` ← **Head:** `fix/bedrock-claude` --- ### 📝 Commits (3) - [`7a856e5`](https://github.com/anomalyco/opencode/commit/7a856e5a0c5667fb1df4361dd609f9f852fcdd6b) fix: bedrock claude - [`cfe0513`](https://github.com/anomalyco/opencode/commit/cfe05136836ba86798cb537da183eb9a38ba31f7) no need for async - [`0db3151`](https://github.com/anomalyco/opencode/commit/0db3151491e3173cb8a1b0ba9c0931b07fcfdc12) add getModel function per provider ### 📊 Changes **3 files changed** (+103 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `bun.lock` (+47 -0) 📝 `packages/opencode/package.json` (+3 -2) 📝 `packages/opencode/src/provider/provider.ts` (+53 -23) </details> ### 📄 Description ## Problem https://github.com/sst/opencode/issues/243 It's nice to have model expenses be part of the AWS bill & currently opencode doesn't work for me with Claude on Bedrock 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 Detect bedrock + claude being used and append the aws region prefix from env to model ID Tested it & worked well: <img width="940" alt="Screenshot 2025-06-20 at 13 49 02" src="https://github.com/user-attachments/assets/2f6c7d11-70c3-4fbf-aca3-b197c449f70f" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:13:46 -05:00
yindo closed this issue 2026-02-16 18:13:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9567