Create image-when response_format is b64_json,how do i know what image format it is

Create image-when response_format is b64_json,how do i know what image format it is.
Create image

1 Like

When you use b64_json, the image is encoded in b64_json, not a normal image file type. You can check out this tutorial for a little detail on this: Generate Images With DALL·E 2 and the OpenAI API – Real Python but generally you can convert the json to a png or jpeg easily as is shown in this Stack Overflow solution: python - Convert string in base64 to image and save on filesystem - Stack Overflow