What happened?
Uploading a PDF file to a conversation using the DeepSeek custom endpoint (deepseek-flash) produces:
400 .messages[1]: file must have a file_id or file_data
This occurs on a brand-new conversation with no prior history. The PDF is small and well under the container's Nginx body limit (client_max_body_size 25M, confirmed inside the container). It is not a request-size issue.
Expected behaviour: LibreChat should either:
- Use OCR to extract text from the PDF and send it as a text message, or
- Clearly reject the upload with a user-facing message explaining DeepSeek does not support direct PDF uploads.
Actual behaviour: The PDF is forwarded as a file block in the chat completion request. DeepSeek's Files API only accepts image formats (JPEG, PNG, GIF, WebP) and requires either a file_id (from an upload to https://api.deepseek.com/files) or file_data (base64-encoded image). A PDF cannot satisfy either requirement, so DeepSeek returns 400.
Precedent: Discussion #10988 already documents that DeepSeek requires the OCR workaround for file uploads.
Workaround in use: Switching to Gemini 3.8 Flash for PDF uploads works because Google's API supports PDFs natively.
Version Information
LibreChat v0.8.7
Deployment: Self-hosted Docker Compose (local)
Image: registry.librechat.ai/danny-avila/librechat-dev:latest
Reverse proxy: None (direct port 3080)
Custom endpoints: DeepSeek V4 Pro, DeepSeek Flash, Gemini, Qwen
Redis: redis:7-alpine (docker), USE_REDIS_STREAMS=true
Steps to Reproduce
-
Start a new conversation with the DeepSeek custom endpoint (deepseek-flash selected).
-
Upload any PDF file using the attachment button.
-
Ask a question about the file.
-
Observe the error:
400 .messages[1]: file must have a file_id or file_data
What browsers are you seeing the problem on?
Firefox, Chrome, Microsoft Edge
Relevant log output
2026-09-23 09:03:13 error: [api/server/controllers/agents/client.js #sendCompletion] Unhandled error type 400 .messages[1]: file must have a file_id or file_data
Screenshots
Code of Conduct
What happened?
Uploading a PDF file to a conversation using the DeepSeek custom endpoint (deepseek-flash) produces:
400 .messages[1]: file must have a file_id or file_data
This occurs on a brand-new conversation with no prior history. The PDF is small and well under the container's Nginx body limit (client_max_body_size 25M, confirmed inside the container). It is not a request-size issue.
Expected behaviour: LibreChat should either:
Actual behaviour: The PDF is forwarded as a
fileblock in the chat completion request. DeepSeek's Files API only accepts image formats (JPEG, PNG, GIF, WebP) and requires either afile_id(from an upload to https://api.deepseek.com/files) orfile_data(base64-encoded image). A PDF cannot satisfy either requirement, so DeepSeek returns 400.Precedent: Discussion #10988 already documents that DeepSeek requires the OCR workaround for file uploads.
Workaround in use: Switching to Gemini 3.8 Flash for PDF uploads works because Google's API supports PDFs natively.
Version Information
LibreChat v0.8.7
Deployment: Self-hosted Docker Compose (local)
Image: registry.librechat.ai/danny-avila/librechat-dev:latest
Reverse proxy: None (direct port 3080)
Custom endpoints: DeepSeek V4 Pro, DeepSeek Flash, Gemini, Qwen
Redis: redis:7-alpine (docker), USE_REDIS_STREAMS=true
Steps to Reproduce
Start a new conversation with the DeepSeek custom endpoint (deepseek-flash selected).
Upload any PDF file using the attachment button.
Ask a question about the file.
Observe the error:
400 .messages[1]: file must have a file_id or file_data
What browsers are you seeing the problem on?
Firefox, Chrome, Microsoft Edge
Relevant log output
2026-09-23 09:03:13 error: [api/server/controllers/agents/client.js #sendCompletion] Unhandled error type 400 .messages[1]: file must have a file_id or file_dataScreenshots
Code of Conduct