I’ve got a little utility that does not download URLs, it receives via response format.
dall-e-2:
dall-e-3:
gpt-image-1:
Log of API call parameters passed (showing as Python streamable):
{'model': 'dall-e-2', 'size': '1024x1024', 'prompt': 'Two cartoon carrots are having a conversation in a garden.', 'response_format': 'b64_json', 'timeout': 40}
{'model': 'dall-e-3', 'size': '1024x1024', 'prompt': 'Two cartoon carrots are having a conversation in a garden.', 'response_format': 'b64_json', 'timeout': 40}
{'model': 'gpt-image-1', 'size': '1024x1024', 'prompt': 'Two cartoon carrots are having a conversation in a garden.', 'timeout': 60, 'background': None, 'moderation': None, 'output_compression': None, 'output_format': 'png', 'quality': 'medium', 'user': 'dalle-edit-user'}
before this snippet with the Python SDK:
if PRINT_API_CALLS:
print(image_params)
response = await self.client.images.edit(**image_params)
b64_data = response.data[0].b64_json
image_data = base64.b64decode(b64_data)
image_file = BytesIO(image_data)
Note how the response_format is NOT sent for the image-1
model, per API Reference.
There’s someone here that also could not resolve an issue with dall-e-2
on their organization - while their script ran fine for me.
So check that you are making the same call as were successful before, and then discover if it is your org that has gone wrong, if a new project, new API key, using that API key without sending organization or project headers can resolve the issue, on an innocent-sounding prompt.