Endpoint
Description
This function generates an image using OpenAI’s DALL-E 3 model based on a text prompt, then downloads and uploads the generated image to Azure Blob Storage for persistent storage.Request body
The text description of the image to generate. This prompt is passed directly to DALL-E 3 to create the image.
Response
Returns “Image uploaded successfully” when the image has been generated and stored.
Behavior
- Receives a text prompt from the request body
- Calls OpenAI’s DALL-E 3 API to generate a 1024x1024 image
- Downloads the generated image as an array buffer
- Generates a SAS token for Azure Blob Storage authentication
- Uploads the image to the “images” container with a filename format:
{prompt}_{timestamp}.png - Returns a success message