Unable to load xlsx files to code interpreter

I’m trying to upload an XLSX file to my assistant to use with Code Interpreter, but am getting the following error:

BadRequestError: Error code: 400 - {‘error’: {‘message’: ‘Failed to index file: Unsupported file file-rfFHcYJS7nyW1XcWIRYZeYKE type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: None}}

From the supported file types it looks like .xlsx files are supported and this is the mime type of my file:

The MIME type of the file is: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

I’ve been able to upload csv’s, but need to upload an xlsx file due to the file size constraints. Has anyone else run into this issue?


I have been unable to use CSV files with the same error. Did you do anything different for CSV files?

I don’t believe so - I used this code to read in the .csv file:

file_code_interpreter = client.files.create(
file=open(“test.csv”, “rb”),

Then this code to create the assistant:

assistant = client.beta.assistants.create(
name=“Code Assistant”,
instructions=“You are a coding assistant. Leverage your knowledge to help construct code to answer the user’s question.”,
tools=[{“type”: “code_interpreter”}],

That worked for me and I was able to extract the an output after asking a question on the csv data.