import openai

First, set your API key

openai.api_key = "YOUR_API_KEY"

Next, define the prompt

prompt = 'create a workout plan for someone who wants to lose weight'

Then, send the request to the GPT-3 API

response = openai.Completion.create(engine="text-davinci-002", prompt=prompt, max_tokens=1024)

And finally, print the response

print(response["choices"][0]["text"])