Skip to content

AWS Bedrock not working on regions outside us-east-1 #467

Closed

Description

@bchilcott

It doesn't seem like AWS Bedrock models work in regions outside of us-east-1. If I don't set the AWS_REGION I get the following error:

You don't have access to the model with the specified model ID. callback error

I guess that is to be expected. However, if I set my AWS_REGION to a region where I do have access to the model, I get the following output:

opencode run hi --model amazon-bedrock/anthropic.claude-3-sonnet-20240229-v1:0 --print-logs

INFO  2025-06-27T15:18:22 +0ms service=bus type=message.part.updated subscribing
INFO  2025-06-27T15:18:22 +1ms service=session session=ses_84e081b3affer687bDcbeaV641 chatting
INFO  2025-06-27T15:18:22 +0ms service=app name=provider registering service
INFO  2025-06-27T15:18:22 +1ms service=models.dev refreshing
INFO  2025-06-27T15:18:22 +1ms service=provider init
INFO  2025-06-27T15:18:22 +44ms service=provider providerID=amazon-bedrock found
INFO  2025-06-27T15:18:22 +0ms service=provider providerID=amazon-bedrock modelID=anthropic.claude-3-sonnet-20240229-v1:0 getModel
INFO  2025-06-27T15:18:22 +1ms service=provider status=started providerID=amazon-bedrock getSDK
INFO  2025-06-27T15:18:22 +15ms service=provider status=completed duration=15 providerID=amazon-bedrock getSDK
INFO  2025-06-27T15:18:22 +1ms service=provider providerID=amazon-bedrock modelID=anthropic.claude-3-sonnet-20240229-v1:0 found
INFO  2025-06-27T15:18:22 +0ms service=session sessionID=ses_84e081b3affer687bDcbeaV641 locking
INFO  2025-06-27T15:18:22 +6ms service=bus type=storage.write publishing
INFO  2025-06-27T15:18:22 +0ms service=bus type=message.updated publishing
INFO  2025-06-27T15:18:22 +1ms service=bus type=storage.write publishing
INFO  2025-06-27T15:18:22 +0ms service=bus type=message.updated publishing
INFO  2025-06-27T15:18:22 +1ms service=app name=mcp registering service
ERROR 2025-06-27T15:18:23 +400ms service=session error=AI_APICallError: undefined: The provided model identifier is invalid. callback error
INFO  2025-06-27T15:18:23 +0ms service=bus type=session.error publishing
INFO  2025-06-27T15:18:23 +1ms service=session session=ses_84e081b3affer687bDcbeaV641 type=error part
INFO  2025-06-27T15:18:23 +0ms service=session session=ses_84e081b3affer687bDcbeaV641 type=error unhandled
INFO  2025-06-27T15:18:23 +3ms service=bus type=storage.write publishing
INFO  2025-06-27T15:18:23 +0ms service=bus type=message.updated publishing
INFO  2025-06-27T15:18:23 +0ms service=session sessionID=ses_84e081b3affer687bDcbeaV641 unlocking
INFO  2025-06-27T15:18:23 +51ms service=app name=session shutdown
INFO  2025-06-27T15:18:23 +0ms service=app name=mcp shutdown

The highlight here being:

AI_APICallError: undefined: The provided model identifier is invalid. callback error

Using models from the eu-west-2 marketplace is required in my organization.

Activity

  1. thdxr commented on Jun 27, 2025

    @thdxr
    Member

    can you set AWS_REGION ?

  2. bchilcott commented on Jun 27, 2025

    @bchilcott
    Author

    If I set AWS_REGION to the region where I have the model (eu-west-2 in my case), I get the error which I pasted in full above.

    AWS_REGION=eu-west-2 opencode run hi --model amazon-bedrock/anthropic.claude-3-sonnet-20240229-v1:0 --print-logs
    
    AI_APICallError: undefined: The provided model identifier is invalid. callback error
    
  3. Dizzzmas commented on Jun 27, 2025

    @Dizzzmas
    Contributor

    ahh, annoying

    seems like this is an exception for eu-west-2 where it doesn't have & doesn't require a regional model ID

    Image

    e.g. in

    Europe (Ireland),
    Europe (Paris),
    Europe (Frankfurt)
    

    current setup would work fine

    my bad for not taking this into account when doing this PR: #241

    i guess the fix would be having more detailed region checks for bedrock provider and transforming model id only in regions that require regional model IDs

  4. Dizzzmas commented on Jun 27, 2025

    @Dizzzmas
    Contributor

    PR: #482

  5. added a commit that references this issue on Jun 27, 2025
  6. self-assigned this
    on Jun 30, 2025
  7. added a commit that references this issue on Jun 30, 2025
  8. assigned and unassigned on Jun 30, 2025
  9. naviniitk commented on Aug 14, 2025

    @naviniitk

    I am still getting this error AI_APICallError: undefined: You don't have access to the model with the specified model ID.
    I am not sure if it's a problem with my setup but I did get access to the models in bedrock console

  10. added a commit that references this issue on Jun 10, 2026
  11. added a commit that references this issue on Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions