File output logic via API - Manipulating DOCX-Documents

When asking ChatGPT / MS Copilot to modify a docx file I upload, they modify the file and return the modified docx doument. However, when trying to accomplish the same through the API, I can upload the docx file, but I don’t find documentation explaining how I can receive back the modified docx file. I managed to get the modified content back in text form, but did not manage to receive an actual file back in the API response. Could someone please point me in the right direction? Is there a difference between files in the API response in the OpenAI API vs. Azure OpenAI API or do both offer the same features when it comes to docx file manipulation?

Many thanks in advance for your help

The only way that an API model can manipulate a file like you experienced:

https://platform.openai.com/docs/guides/tools-code-interpreter

You will then also have to get the output of annotation metadata that the AI has produced for the user out of the response object in order to retrieve or offer the file product, which only lasts as long as the 20 minute timeout after container inactivity.