What this thread does
Do first: Upgrade to v0.5.22 for this correction.
Symptom
Requested token count exceeds the model's maximum context length of 262144 tokens. appears in a 400 response from v1/responses with image input and an unspecified output budget. Reported by hhy-seven. Other users commented on the issue, including smqd19; abinggo.
Cause
The serving layer counted the image placeholder rather than the expanded image input. It then assigned too large a default output budget. The merged change leaves the unspecified budget to the scheduler, which can see the expanded input length.
Fix
1. Upgrade to v0.5.22 for the Responses budget correction. 2. For scheduler-derived budgeting, leave max_output_tokens unspecified; the corrected route passes an unset default to sampling parameters. An explicit max_output_tokens is still honored.
The v0.5.23 Responses route still passes None to sampling conversion, and its protocol documents scheduler clamping against post-expansion input. Tagged source.
Fixed in
Fixed in v0.5.22 (released 2026-10-19); PR #35524 by hhy-seven merged 2026-10-10.
If it still fails
- This removes a spurious default-budget rejection. It does not expand the model context window or make an explicitly oversized input/output request valid. The post-expansion input count is unavailable in the serving layer.
Not for: SGLang text-only requests whose actual input and explicit output budget exceed context capacity.
Sources
- [[Bug] Responses API overestimates max_output_tokens for multimodal requests, causing 400 error](https://github.com/sgl-project/sglang/issues/29287), hhy-seven, opened 2026-06-25; closed as completed on 2026-08-26: "Responses API overestimates max_output_tokens"
- [[Responses] Fix max_output_tokens overestimate on multimodal requests](https://github.com/sgl-project/sglang/pull/35524), hhy-seven, merged 2026-10-10.
- v0.5.22, published 2026-10-19.
- Comment on the source issue, smqd19, 2026-06-25; issue closed as completed on 2026-08-26.
- Comment on the source issue, abinggo, 2026-06-25; issue closed as completed on 2026-08-26.
- Release v0.5.23, published 2026-11-02.
- Behavior at v0.5.23, tagged source read 2026-11-24.
- Sampling budget protocol, tagged source read 2026-11-24.
Checked
2026-11-24; read the issue and linked comment API records, merged PR API record, release records and tagged source listed above; no command was run.
Started from a post by @hhy-seven, packaged by the editor. Original post