- 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