[BUG] : Cannot use AWS Bedrock with Claude Code. Getting API Error (429 Too many tokens)
Environment
Platform (select one):
Anthropic API
AWS Bedrock
Google Vertex AI
Other:
Claude CLI version: 1.0.3 (Claude Code)
Operating System: MacOS 15.5
Terminal: iTerm, Warp
Bug Description
When using claude cli with sonnet 4 bedrock model, it received API Error (429 Too many tokens, please wait before trying again.) message and never gets a response
Steps to Reproduce
Run DISABLE_TELEMETRY=1 ANTHROPIC_SMALL_FAST_MODEL=us.anthropic.claude-3-5-haiku-20241022-v1:0 AWS_REGION=us-east-1 CLAUDE_CODE_USE_BEDROCK=1 DISABLE_PROMPT_CACHING=1 claude --model us.anthropic.claude-sonnet-4-20250514-v1:0
I was trialing Claude Code to see if I should pursue Claude Max subscription. I wanted to do this trial with AWS Bedrock but the experience has been so bad that I am looking to turn away from Claude Code altogether. Can someone please resolve this 429 too many tokens error pls?
429 Comes back
Expected Behavior
Expect a response from the sonnet 4 model
Actual Behavior
429 too make tokens API error
Additional Context
If I run the exact same command but use sonnet 3-7, no problems.
I have access to the sonnet 4 in AWS in the regions I use in the CLI command. I have used that model with other tools without a problem.
13 Comments
I've been noticing this same problem too. It's so annoying that the Claude 4.0 models don't seems to be working with Bedrock. I ensured my user has claude 4.0 model access to all AWS regions in the cross-region reference. Setting my ~/.claude/settings.json to
{"env": {
"CLAUDE_CODE_USE_BEDROCK": "true",
"ANTHROPIC_MODEL": "us.anthropic.claude-opus-4-20250514-v1:0",
"DISABLE_PROMPT_CACHING": "false"
}
}
I get the
API Error: 429 Too many tokens, please wait before trying againeven for simple hello tests.Hi everyone!
I am having the same issue when I am using cli and also the console even for a simple hello in a prompt and as the previous users mentioned it shows me the:
too many tokens error
I also tried creating an inference profile on aws for using claude 4 because it does not work on demand.
(shows me:
)
So now I have the following code:
and the output is:
I would be very grateful if someone has resolved this and has any idea on what to do next :)
me too only Claude 3.5 is working and if I view Claude 4 in the Service qoutas its this:
!Image
!Image
A workaround is setting
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": 1024:https://github.com/anthropics/claude-code/issues/1293#issuecomment-2938480588
Did it help you? Unfortunately, it didn’t work for me…
I am having issues too. I switched to from opus 4 to sonnet 4 and things started working again
Having issues with sonnet 4 over here
Same issue happens when I make a
get_imagetool call through claude code subagents and run into 429 errors. Interestingly, the same issue does not happen when making mcp tool calls through the main thread.I'm using Bedrock, Opus 4.1 with CLAUDE_CODE_MAX_OUTPUT_TOKENS=32000, and there was no problem recently, but it's happening again when the context gets bigger. There is no problem with Sonnet4.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
I think I'm seeing it too. Should keep this ticket open.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.