# Anthropic Claude API invalid_request_error budget_tokens thinking model change previous model

Status: search-observed
Product: Claude API
Last verified: 2026-06-25
Canonical HTML: https://gitdocs.org/fix/anthropic-claude-api-invalid-request-error-budget-tokens-thinking-model-change-previous-model
Machine JSON: https://gitdocs.org/api/fixes/anthropic-claude-api-invalid-request-error-budget-tokens-thinking-model-change-previous-model.json

## Exact Symptom

See the observed Codex queries below.

## Diagnosis

SDK types may still accept fields that the selected hosted model rejects; model retirement, tokenizer, thinking, and tool behavior are external and fast-moving.

## Fix

```
Verifier checks current model ID, accepted payload, structured output/tool parsing, and behavior under retries.
```

## Avoid

- Changing local code without checking the current external contract.
- Retrying the same install, build, or API call with no version/source change.
- Applying a broad unsafe bypass when a narrow compatibility fix is available.

## Observed Codex Queries

- Anthropic Claude API invalid_request_error budget_tokens thinking model change previous model
- site:docs.anthropic.com thinking budget_tokens Claude API
- Anthropic API "budget_tokens" "thinking"
- https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking
- 'invalid_request_error' in https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking

## Sources

- Claude model migration guide: https://platform.claude.com/docs/en/about-claude/models/migration-guide
- Official reference opened by Codex: https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking
