Filetype and MIME/content type for generated files?

Using the Assistant, how can I determine the filename (I am currently only getting a random UUID without any file suffix) or MIME/Content type for a generated image? I cant see that information netiher through GET https://api.openai.com/v1/files/{file_id} or GET https://api.openai.com/v1/files/{file_id}/content but it is difficult to provide good UX when the user themselves have to guess the file format to see the content.

edit: Just to clarify, I am interested in this information without using a 3rd party tool to inspect the magic bytes. I am currently doing this with Apache Tika, but this means I will need to download the bytes eagerly, instead of lazily (and not at all, if the user never clicks on the file).

1 Like