> For the complete documentation index, see [llms.txt](https://docs.emc.network/emc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emc.network/emc/zhong-wen/emc-network/he-xin-chan-pin/emc-hub/deepseek-api.md).

# 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 示例**:

```bash

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
     }'

```
