cannot call bedrock models with cross-region profile #84

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

Originally created by @tmokmss on GitHub (Jun 16, 2025).

Originally assigned to: @thdxr on GitHub.

Hi when I try to use Sonnet 4 from Amazon Bedrock, opencode throws the below error.

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 this
model.

Currently Bedrock supports Sonnet 4 model only with cross-region inference profile, so you need to add a prefix like us. to the model id (e.g., us.anthropic.claude-sonnet-4-20250514-v1:0). It would be great if opencode supports it 🙏

Originally created by @tmokmss on GitHub (Jun 16, 2025). Originally assigned to: @thdxr on GitHub. Hi when I try to use Sonnet 4 from Amazon Bedrock, opencode throws the below error. > 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 this model. Currently Bedrock supports Sonnet 4 model only with [cross-region inference profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html), so you need to add a prefix like `us.` to the model id (e.g., `us.anthropic.claude-sonnet-4-20250514-v1:0`). It would be great if opencode supports it 🙏
yindo closed this issue 2026-02-16 17:25:07 -05:00
Author
Owner

@thdxr commented on GitHub (Jun 16, 2025):

a workaround right now is i believe you can configure these models yourself

// opencode.json
{
  "providers": {
    "amazon": {
      "models": {
        "us.anthropic.claude-sonnet-4-20250514-v1:0": { // cost info }
      }
    }
  }
}

i'll think about how to do out of the box support

@thdxr commented on GitHub (Jun 16, 2025): a workaround right now is i believe you can configure these models yourself ``` // opencode.json { "providers": { "amazon": { "models": { "us.anthropic.claude-sonnet-4-20250514-v1:0": { // cost info } } } } } ``` i'll think about how to do out of the box support
Author
Owner

@tmokmss commented on GitHub (Jun 17, 2025):

Thanks! Hmm, it's still not working. I created an opencode.json in the repository root and selected the model with /model. However, whenever I send a message, it does not navigate to the chat screen.

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "amazon": {
      "models": {
        "us.anthropic.claude-sonnet-4-20250514-v1:0": {
          "name": "claude-sonnet-4 (US)",
          "cost": {
            "input": 10,
            "inputCached": 1,
            "output": 75,
            "outputCached": 1.2
          }
        }
      }
    }
  }
}
Image
@tmokmss commented on GitHub (Jun 17, 2025): Thanks! Hmm, it's still not working. I created an opencode.json in the repository root and selected the model with /model. However, whenever I send a message, it does not navigate to the chat screen. ```json { "$schema": "https://opencode.ai/config.json", "provider": { "amazon": { "models": { "us.anthropic.claude-sonnet-4-20250514-v1:0": { "name": "claude-sonnet-4 (US)", "cost": { "input": 10, "inputCached": 1, "output": 75, "outputCached": 1.2 } } } } } } ``` <img width="671" alt="Image" src="https://github.com/user-attachments/assets/8aa93956-1c02-4ca2-ab08-5bfb74df3a0c" />
Author
Owner

@thdxr commented on GitHub (Jun 20, 2025):

should be fixed in v0.1.110

@thdxr commented on GitHub (Jun 20, 2025): should be fixed in v0.1.110
Author
Owner

@openconstruct commented on GitHub (Jun 29, 2025):

So this is fixed, and I just fucked up IAM?
Getting "You don't have access to the model with the specified model ID"

@openconstruct commented on GitHub (Jun 29, 2025): So this is fixed, and I just fucked up IAM? Getting "You don't have access to the model with the specified model ID"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#84