1. Learn
  2. /
  3. Courses
  4. /
  5. Working with DeepSeek in Python

Connected

Exercise

Building a DeepSeek request

Throughout the course, you'll write Python code to prompt DeepSeek models via the openai library. 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.

Please note that although base_url is set to "https://api.together.xyz/v1" , the official DeepSeek API, the requests in these exercises are actually being rerouted to together.ai's API.

Instructions

100 XP
  • Create an OpenAI API client (keep <TogetherAI API Key> unchanged).
  • create a request for the "deepseek-ai/DeepSeek-V3" model to the Chat Completions endpoint.