Here is a simple guide on how to generate images using Azure OpenAI DALL-E via Postman.
Before starting off, I am assuming you will already have a Azure OpenAI subscription that is ready to be used.
Azure OpenAI Studio
- Go to Azure OpenAI Studio : https://oai.azure.com/
-
Click on DALL-E under the Playground section
-
Click on ‘View Code’
- Select ‘json’ from the dropdown, and copy the OAI API Key (hidden text).
Postman
-
Create a new POST Request with the following values:
- Query Params
api-version : 2023-06-01-preview
-
Request Headers
api-key : {Paste the OAI API Key copied previously)
-
Body
Paste this JSON as the Request Body and edit as needed:
1 2 3 4 5
{ "prompt": {Add Your Image Prompt here}, "n": 1, "size": "1024x1024" }
- Query Params
-
On response, you might get a
"status": "notRunning"
as response. This is normal. -
Open the Response Headers tab and copy the URL from operation-location header
- Make another request, this time a GET (instead of a POST) request with the URL copied from Step 3.
- Response returned should return the generated image URL
More references on generating images using Azure OpenAI DALL-E:
- https://learn.microsoft.com/en-us/training/modules/generate-images-azure-openai/4-dall-e-rest-api