OpenAI API · api · fg-0144

Uploaded PDF rejected: Expected a file with an application/pdf MIME type, but got unsupported MIME type 'None'

If you see Invalid file data: 'file_id'. Expected a file with an application/pdf MIME type, but got unsupported MIME type 'None', the cause and the fix for OpenAI API are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
Invalid file data: 'file_id'. Expected a file with an application/pdf MIME type, but got unsupported MIME type 'None'.Upload succeeds but the file id fails when used as input_file
Cause
Uploading raw bytes without a filename or content type stores the file with no MIME type, and the model input path refuses it.
Fix
Upload with a filename and content type tuple and purpose user_data, then use the new file id.
Apply
f = client.files.create(file=("document.pdf", pdf_bytes, "application/pdf"), purpose="user_data")
Affected
openai-python and other SDKs uploading bytes for PDF inputs, confirmed by maintainers 2026-09-10
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun