Now that Uncle Sam (Altman) has given us access to DALL-E 3 via API, I’m sure lots of Makers will be rushing to implement this into their Scenarios. This is exactly what I am trying to do but currently running into a problem.
When I run the sample code from the OpenAI documentation in Replit, it works as expected and returns an image URL:
But when I try to run the same code in the Run Python Code
module from 0CodeKit, I receive this error:
This is the code I am using. What am I doing wrong?
from openai import OpenAI
client = OpenAI(api_key=‘use-your-api-key-here’)
response = client.images.generate(
model=“dall-e-3”,
prompt=“a white siamese cat”,
size=“1024x1024”,
quality=“standard”,
n=1,
)result = response.data[0].url