Skip to content

[BUG] max_tokens must be greater than thinking.budget_tokens #8756

@solace-rcampbell

Description

@solace-rcampbell

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Occasionally, when I'm running prompts, I get this error message:

  ⎿ API Error: 400 {"error":{"message":"{\"message\":\"`max_tokens` must be greater than `thinking.budget_tokens`. Please consult our
    documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking#max-tokens-and-context-window-size\"}.
    Received Model Group=bedrock-claude-4-5-sonnet\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}

Running the request a second time often resolves the problem.

What Should Happen?

I expect no errors.

Error Messages/Logs

Steps to Reproduce

I don't have a recipe for this. I've seen this maybe 4 times since upgrading to Claude v2.x. Some other people in my team have also seen this.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.0.2 (Claude Code)

Platform

AWS Bedrock

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions