For the complete documentation index, see llms.txt. This page is also available as Markdown.

DeepSeek API

DeepSeek API 使用与 OpenAI 兼容的 API 格式。通过修改配置,您可以使用 OpenAI SDK 或者兼容 OpenAI API 的软件来访问 DeepSeek API。

PARAM
VALUE

api_url

从 emchub 获取 api_url

api_key

从 emchub 获取 api_key


调用 Chat API

一旦您获得了 API key,就可以使用以下示例脚本来访问 DeepSeek API。以下示例是非流式的,如果需要流式响应,可以将 stream 参数设置为 true

  • curl 示例:


curl <api_url> \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer <api_key>" \
 -d '{
       "model": "emchubSDK-chat",
       "messages": [
         {"role": "system", "content": "You are a helpful assistant."},
         {"role": "user", "content": "Hello!"}
       ],
       "stream": false
     }'

Last updated