Uploading Files to OpenAI /files endpoint

I had this same issue and found that the only way to make it work was to not use the included OpenAI query and instead, use a REST API query to make a POST request to the /files endpoint, setting the content type as Form Data, and including the body's purpose and file.

It seems like the OpenAI query that Retool provides has the content type as JSON where purpose and file is expected to be a string. I tried a bunch of different methods but I couldn't get the API to accept the file as any kind of string - it needs to be a file object and Form Data (in a REST API query) seems to be the only way to have purpose as a string and file as a file object.