Challenge - 5 Problems
DALL-E API Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this DALL-E API call?
Given the following Python code snippet using the DALL-E API, what will be the type of the variable
response after execution?Prompt Engineering / GenAI
import openai response = openai.Image.create( prompt="a red apple on a wooden table", n=1, size="256x256" )
Attempts:
2 left
💡 Hint
Think about what the API returns when you request images.
✗ Incorrect
The DALL-E API returns a dictionary with keys like 'created' and 'data'. The 'data' key holds a list of dictionaries each containing a URL to the generated image.
❓ Model Choice
intermediate1:30remaining
Which DALL-E model size option produces the highest resolution images?
You want to generate the largest and most detailed images using the DALL-E API. Which
size parameter should you choose?Attempts:
2 left
💡 Hint
Higher numbers mean bigger images.
✗ Incorrect
The '1024x1024' size option produces the highest resolution images currently supported by the DALL-E API.
❓ Hyperparameter
advanced2:00remaining
How does changing the
n parameter affect the DALL-E API response?If you set
n=3 in the DALL-E API call, what will be the effect on the response?Attempts:
2 left
💡 Hint
The parameter
n controls how many images you want.✗ Incorrect
Setting
n=3 tells the API to generate 3 unique images, each with its own URL in the response.🔧 Debug
advanced2:30remaining
Why does this DALL-E API call raise an error?
Consider this code snippet:
import openai
response = openai.Image.create(
prompt=12345,
n=1,
size="256x256"
)
Why does this code raise an error?
Attempts:
2 left
💡 Hint
Check the data type of the prompt parameter.
✗ Incorrect
The prompt parameter must be a text string describing the image. Passing an integer causes a type error.
🧠 Conceptual
expert3:00remaining
What is the main ethical consideration when using DALL-E generated images?
When generating images with DALL-E, what is a key ethical concern to keep in mind?
Attempts:
2 left
💡 Hint
Think about how images might affect others or violate rules.
✗ Incorrect
Ethical use involves avoiding generating images that violate copyrights, promote misinformation, or create harmful or offensive content.