鉴权与连接
- Base URL
https://backend:8000- Authorization
Authorization: Bearer YOUR_API_KEY- Content-Type
application/json- 模型名 (model)
deepseek-v4-pro
接入协议
为什么选这个协议
适合已有 OpenAI SDK、Chat Completions 代码或统一网关接入的用户。
接口地址
POST/v1/chat/completions
Authorization: Bearer YOUR_API_KEYContent-Type: application/json请求 / 响应 JSON
// REQUEST
{
"model": "deepseek-v4-pro",
"messages": [
{
"content": "你好,世界",
"role": "user"
}
],
"system_instruction": "你是一个严谨的助手。",
"temperature": 1,
"top_p": 1,
"max_tokens": 4096,
"stop": [
"\n\n"
],
"stream": false,
"stream_options": {
"include_usage": true
},
"thinking": {
"reasoning_effort": "high",
"type": "enabled"
},
"response_format": {
"type": "json_object"
},
"tools": [],
"tool_choice": "auto",
"logprobs": false,
"top_logprobs": 5,
"user_id": "user_123"
}// RESPONSE
{
"output": {
"text": "你好,世界"
}
}请求字段 / 响应字段
// INPUT SCHEMA
| 字段 | 类型 | 必填 |
|---|---|---|
| messages | array | Y |
| system_instruction | string | N |
| temperature | number | N |
| top_p | number | N |
| max_tokens | integer | N |
| stop | array | N |
| stream | boolean | N |
| stream_options | object | N |
| thinking | object | N |
| response_format | object | N |
| tools | array | N |
| tool_choice | enum | N |
| logprobs | boolean | N |
| top_logprobs | integer | N |
| user_id | string | N |
// RESPONSE SCHEMA
| 字段 | 类型 | 必填 |
|---|---|---|
| output.text | string | N |
代码示例
cURLrequest.sh
curl -X POST "https://backend:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "deepseek-v4-pro",
"messages": [
{
"content": "你好,世界",
"role": "user"
}
],
"system_instruction": "你是一个严谨的助手。",
"temperature": 1,
"top_p": 1,
"max_tokens": 4096,
"stop": [
"\n\n"
],
"stream": false,
"stream_options": {
"include_usage": true
},
"thinking": {
"reasoning_effort": "high",
"type": "enabled"
},
"response_format": {
"type": "json_object"
},
"tools": [],
"tool_choice": "auto",
"logprobs": false,
"top_logprobs": 5,
"user_id": "user_123"
}'