How to create file with open ai api

This is an example of what I want to achieve in my program where I use openai api and

Code Interpreter with Assistants API can do it, I believe.

But for completions endpoint, you’ll need to have the LLM generate the data then turn it into a CSV file on your own.