Downloading images generated by code interpreter

I’m using the recent assistant API along with the code retriever to make some graphs. When I try to download them, I get the content as bytes. I tried utf-8 encoding as well as base64 encoding when saving to a png file but I can’t seem to open the png file to see what the code interpreter created. Has anyone experienced this before?

content = client.files.retrieve_content(

Update to the latest python SDK version and you can download the outputted PNG files like so:

image_file_id = "file-abc-123"
image_file = openai.files.content(image_file_id)
with open("plot.png", "wb") as f:

Any update node sdk?

"openai": "^4.21.0"