#35061 [Bug]: Anthropic /v1/messages with max_tokens=1 fails for GPT-5.x models, breaking Claude Code /model
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
When using LiteLLM as an Anthropic Gateway for Claude Code, switching to GPT-5.x models via /model fails.
The root cause appears to be that Claude Code sends a probe request with max_tokens=1 to the Anthropic Messages API. LiteLLM forwards this request to OpenAI GPT-5.x, which returns:
Could not finish the message because max_tokens or model output limit was reached.
LiteLLM then converts this into a 400 BadRequestError, causing Claude Code to believe the model is unavailable.
The same model works correctly from OpenWebUI and OpenAI Chat Completions.
### Steps to Reproduce
Environment
* LiteLLM: v1.93.0 * Claude Code: v2.1.220 * Model: gpt-5.2 (same behavior with gpt-5.x) * Provider: OpenAI * Claude Code configured with: ``` ANTHROPIC_BASE_URL=http://<litellm>:4000 ANTHROPIC_API_KEY=<key> ```
### Relevant log output
```shell POST /v1/messages { "model": "gpt-5.2", "max_tokens": 1, "messages": [ { "role": "user", "content": "hello" } ] }
Response HTTP 400 { "error": { "message": "litellm.BadRequestE…