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(
prompt=“a white siamese cat”,
result = response.data.url