maximum context length is 1048565 tokens. — Codex
Quick fix
Reduce PDF or message input. If the DeepSeek-compatible endpoint does not support PDF, stop uploading it, update CC Switch, and retry.
Symptom
Section titled “Symptom”CC Switch local proxy failed while handling Codex endpoint /responses.
Provider: DeepSeek;
model: deepseek-v4-flash;
upstream_status: HTTP 400;
cause: This model's maximum context length is 1048565 tokens.
However, you requested 1072032 tokens
(1072032 in the messages, 0 in the completion).
Please reduce the length of the messages or completion.When Codex called deepseek-v4-flash on DeepSeek through CC Switch, the request contained 1072032 tokens, exceeding the model's declared context limit of 1048565 tokens, so the upstream returned HTTP 400. The issue provides no evidence that CC Switch 3.16.2 automatically budgets, truncates, or compresses tokens in PDF content.
A comment states that DeepSeek's Anthropic-compatible endpoint does not support type="document" or type="container_upload", suggesting that PDF input is unsupported. However, another user reported that the same DeepSeek setup could process PDF files in Claude Code, so the reports conflict. The issue was ultimately closed due to inactivity, not a confirmed fix. The maintainer only stated that related functionality was substantially refactored in 4.0 and recommended updating and retrying.
Shorten the PDF or current message content so the request stays below the 1048565 tokens limit returned by deepseek-v4-flash.
If calling through DeepSeek's Anthropic-compatible endpoint, stop sending PDF files; the endpoint was reported not to support type="document" or type="container_upload".
Update CC Switch to the latest version and retest; the maintainer stated that related functionality was substantially refactored in 4.0.
If the problem persists after updating, submit the full CC Switch version, operating system, reproduction steps, and relevant logs or screenshots again.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
- Does CC Switch budget, truncate, or compress tokens in PDF content uploaded by Codex?
- The issue does not confirm that CC Switch 3.16.2 performs any of these operations. The actual request was sent upstream with 1072032 tokens and failed because it exceeded the 1048565 tokens limit.
- Is this an expected CC Switch limitation or a Codex and DeepSeek V4 integration problem?
- The thread reached no definitive conclusion. A comment states that DeepSeek's Anthropic-compatible endpoint does not support PDF, but another user reported that the same DeepSeek setup could process PDF files in Claude Code. The issue was ultimately closed due to inactivity.
- Why did all previous conversations disappear after switching API login while the project still exists?
- Other users in the thread reproduced this behavior, but no cause or confirmed fix was provided.
- What should I do if the problem remains after updating CC Switch?
- The maintainer recommended reopening the issue with the CC Switch version, operating system, complete reproduction steps, and relevant logs or screenshots.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.