OpenAI API · api · fg-0144
Uploaded PDF rejected: Expected a file with an application/pdf MIME type, but got unsupported MIME type 'None'
Invalid file data: 'file_id'. Expected a file with an application/pdf MIME type, but got unsupported MIME type 'None'.
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
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")Affects: openai-python and other SDKs uploading bytes for PDF inputs, confirmed by maintainers 2026-09-10
Sources
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp