ChatGPT API Workout 03 - Creating Images

Untitled (2)

In this workout, we will go through another endpoint called Completions.

First, set up an API Key on OpenAI and connect to it using Postman.

The objective is to create a Postman HTTP request whereby with one request and one prompt, we can produce 2 images of the prompt. The prompt should be your favourite city with your favourite type of weather. For example, mine in “Florence, Italy in the rain” and this is what I get back:

Please submit your solution in by taking a screenshot of your Postman script and your answer.

Enjoy! Let me know if you have any questions.

Henry

1 Like

Here are the Headers and Body in Postman. Ensure you make the request a POST request.

Best,
Henry

@henry.habib,

I used https://api.openai.com/v1/images/generations for this rather than completions.

Body

Results