Delete File via Python API

Does anyone have an example of using the python API to delete a file? I’m pretty sure there’s an openai.File.delete() method, but I’m not sure what the parameter to supply file_id is, or if there’s a different method altogether.

OK, the required parameter is sid, so:
openai.File.delete(sid=file_id)
will do the trick!

2 Likes