from openai import OpenAI def send_messages(messages): response = client.chat.completions.create( model="deepseek-chat",//
modifying the configurationmessages=messages, tools=tools ) return response.choices[0].message client = OpenAI( api_key="", base_url="https://api.deepseek.com", //
modifying the configuration)
The DeepSeek API uses an API format compatible with OpenAI. By modifying the configuration, you can use the OpenAI SDK or softwares compatible with the OpenAI API to access the DeepSeek API.