1. Learn
  2. /
  3. Courses
  4. /
  5. Working with the OpenAI API

Connected

Exercise

Building an OpenAI API request

Throughout the course, you'll write Python code to interact with the OpenAI API. Entering your own API key is not necessary to create requests and complete the exercises in this course.

The OpenAI class has already been imported for you from the openai library.

Instructions

100 XP
  • Create an OpenAI API client (keep <OPENAI_API_TOKEN> unchanged).
  • create a request to the Chat Completions endpoint.