Generate Images with Azure OpenAI DALL-E and Postman

In this Azure OpenAI DALL-E article, we will show you how to generate images with Azure OpenAI DALL-E and Postman.

Azure OpenAI DALL-E offers the latest text-to-image generation model, DALL-E 3. The model offers advanced capabilities.

The model deeply understands natural language and can generate images with very specific descriptions.

Using the model, we can generate images with high-definition resolution. Currently, the model is available in the following Azure regions:

  • EastUS
  • AustraliaEast
  • SwedenCentral

Deploy Resource and AI Model

First, you must deploy an Azure OpenAI resource and model to start with the model. For more details, please visit this post, Deploy DALL-E Resource and Model with Azure CLI.

After deploying the resource and service, copy the endpoint URL and API key for the deployment.

Generate Images with Azure OpenAI DALL-E and Postman

We need to create a POST request with the following details to generate an image from the DALL-E model.

POST URL -  {{END POINT URL}} /openai/deployments/dall-e-3/images/generations?api-version=2024-05-01-preview

The URL is shown below,

Add your API key to Postman’s Authorization tab.

POSTMAN

Add your API Key in the value text box.

In the request body, we give the model instructions on what image we want to generate. In our example, the body is shown below.

{
    "prompt":"Create and image for a blog about DALL-E",
    "n": 1,
    "size": "1024x1024",
    "quality": "hd",
    "response_format": "url",
    "style": "vivid"
}

We can customise the image size by using one of the following options:

  • 1792×1024
  • 1024×1024
  • 1024×1792

The above request will generate a high-definition image. However, you can change it by using the standard in the quality option.

The screenshot of the body is below.

DALL-E Postman Body POST Request

To see the result, send the request and review the returned URL.

To view the image, copy and paste the URL into a browser. The result is shown below.

It is important to note that the images will be available for download for 60 minutes only. After 60 minutes, the link will not work, and the image will get deleted.

For more AI articles, visit our sister blog AI articles category page.

2 thoughts on “Generate Images with Azure OpenAI DALL-E and Postman”

Leave a Comment