Chapter 4: Working with the OpenAI API
Up to this point, everything we've done with GPT-3 has been through the Playground. While the Playground is a great place for learning and testing, when you're building applications that incorporate GPT-3, you'll also need to understand how to use the OpenAI API directly. So, in this chapter, we'll look at using the OpenAI API directly by making HTTP requests. We'll start with a general introduction to APIs and the HTTP protocol. Then we'll look at a couple of developer tools for working with API requests and the JSON data-interchange format.
The topics we'll cover are as follows:
- Understanding APIs
- Getting familiar with HTTP
- Reviewing the OpenAI API endpoints
- Introducing CURL and Postman
- Understanding API authentication
- Making an authenticated request to the OpenAI API
- Introducing JSON
- Using the Completions endpoint
- Using the Semantic Search endpoint