Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

Your First API Call

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.

PARAMVALUE
base_url*       https://api.deepseek.com
api_keyapply for anAPI key

* To be compatible with OpenAI, you can also usehttps://api.deepseek.com/v1 as thebase_url. But note that thev1 here has NO relationship with the model's version.

*Thedeepseek-chat anddeepseek-reasoner correspond to the model version DeepSeek-V3.2 (128K context limit), which differs from the APP/WEB version.deepseek-chat is thenon-thinking mode of DeepSeek-V3.2 anddeepseek-reasoner is thethinking mode of DeepSeek-V3.2.

Invoke The Chat API

Once you have obtained an API key, you can access the DeepSeek API using the following example scripts. This is a non-stream example, you can set thestream parameter totrue to get stream response.

  • curl
  • python
  • nodejs
curl https://api.deepseek.com/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DEEPSEEK_API_KEY}" \
-d '{
"model": "deepseek-chat",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"stream": false
}'

[8]ページ先頭

©2009-2026 Movatter.jp