
#  Digging into the response

```
Exercise ID 1575282
```

##  Assignment 

One of the key skills required to work with APIs is manipulating the JSON response object to extract the desired information. In this exercise, you'll push your Python dictionary and list manipulation skills to the max to extract information from the API response.

You've been provided with a `response` object from the OpenAI API, where a request containing the prompt, **What is the goal of OpenAI?** was sent to the Completion endpoint. This `response` object has been printed for you so you can see and understand its structure.

##  Pre exercise code 

```
import pickle
import requests

### CODE USED TO CREATE PICKLE FILE
# import pickle
# import openai

# response = openai.Completion.create(
#   model="gpt-3.5-turbo-instruct",
#   prompt="What is the goal of OpenAI?",
#   max_tokens=100
# )

# with open("openai-goal-response.pkl", "wb") as f:
#     pickle.dump(response, f)

pickle_file = requests.get("https://assets.datacamp.com/production/repositories/6309/datasets/2f63cc21654aec338c8ddb90b0fbf45cca6e029f/openai-goal-response.pkl")    

response = pickle.loads(pickle_file.content)
print(response)
```



##  Solution 

No solution was found.


