In V5 i can set up
AWS_BEARER_TOKEN_BEDROCK and AWS_REGION
then import the bedrock provider and use a model with the proper prefix for instance
model: “us.anthropic.claude-sonnet-4-20250514-v1:0“
This works just fine
However if i migrate to ai gateway, which it’s properly configured as i tried it with novita and worked just fine i’m completely unable to use bedrock
I set the api key in 3 different formats:
- just the bearer key
- A json with {“region”: “us-east-1”,“accessKeyId”: “xxxx”,“secretAccessKey”: “yyyyy”}
- A json with the same config that works in local {“region”:”us-east-1”, “bearerTokenBedrock”: ““yyyy”}
None of them work
if i do:
bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0 → Model not found
bedrock/anthropic.claude-sonnet-4-20250514-v1:0 → :"Free credits temporarily have restricted access due to abuse. We are working on a resolution. Paid …
This is really frustrating there are no traces anywhere to find out what is failing i think it would be required to
- gateway AI to use the exactly same model convention without the prefix (direct provider) or with the profix (ai gateway)
- If there is an issue with an api key, explain it in the ai gateway dashboard in some sort of logs
- If the keys work in an specific format in the .env with the provider, enable that format as well in the gateway
Anyone that managed to make this work could tell me how they did it?
Note: Adding console.log(JSON.stringify(await result.providerMetadata, null, 2)); throws no error about the bedrock connection just the error about the disabled free credits which i don’t want to use
Thanks!!