curl --request POST \
--url https://direct.evolink.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-v4-flash",
"input": "用一句话介绍杭州。"
}
'{
"id": "resp_9f2c1a4b8e7d",
"object": "response",
"created_at": 1755000000,
"status": "completed",
"model": "deepseek-v4-flash",
"output": [
{
"id": "rs_2b7f",
"type": "reasoning",
"summary": [],
"content": [
{
"type": "reasoning_text",
"text": "用户想要一句话介绍,需要覆盖地理与人文两个要点。"
}
]
},
{
"id": "msg_5d1a",
"type": "message",
"role": "assistant",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "杭州是浙江省省会,以西湖山水与数字经济闻名。",
"annotations": []
}
]
}
],
"error": null,
"incomplete_details": null,
"usage": {
"input_tokens": 694,
"input_tokens_details": {
"cached_tokens": 640
},
"output_tokens": 20,
"output_tokens_details": {
"reasoning_tokens": 10
},
"total_tokens": 714
}
}{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid authentication credentials",
"type": "authentication_error"
}
}{
"error": {
"code": 402,
"message": "Insufficient quota",
"type": "insufficient_quota"
}
}{
"error": {
"code": 403,
"message": "Model access denied",
"type": "permission_error"
}
}{
"error": {
"code": 404,
"message": "Model not found",
"type": "not_found_error"
}
}{
"error": {
"code": 413,
"message": "Request entity too large",
"type": "invalid_request_error"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}{
"error": {
"code": 500,
"message": "Internal server error",
"type": "server_error"
}
}{
"error": {
"code": 502,
"message": "Bad gateway",
"type": "server_error"
}
}{
"error": {
"code": 503,
"message": "Service temporarily unavailable",
"type": "server_error"
}
}DeepSeek V4 - Responses 接口
- 使用 OpenAI Responses 协议调用 DeepSeek V4 模型
- 支持
deepseek-v4-flash(快速通用)、deepseek-v4-pro(深度推理)和deepseek-v4-flash-vision-exp(图像理解)三个模型 - 输入形态:
input可以是一段纯文本,也可以是输入项数组(消息、函数调用、函数结果、思考、搜索记录) - 图像理解:
deepseek-v4-flash-vision-exp支持在content中传入input_image内容块,支持多图 - 系统指令:通过
instructions下达,等价于首条 system 消息 - 思考模式:通过
reasoning.effort控制推理强度,思考内容以reasoning输出项返回 - 流式输出:支持语义化 SSE 事件,以
response.completed结束,不发送[DONE] - 工具调用:支持 Function Calling 与内置
web_search联网搜索 - 结构化输出:通过
text.format启用 JSON 对象或 JSON Schema - 上下文缓存:相同前缀请求自动命中缓存,大幅降低输入成本
流式事件:response.created、response.output_item.added、response.reasoning_text.delta、response.output_text.delta,终止事件为 response.completed / response.incomplete / response.failed。每个事件都带 sequence_number 用于排序。
不生效的字段:以下 OpenAI 字段可以照常传入,不会报错,但不会产生实际效果。
| 字段 | 行为 |
|---|---|
store | 恒为 false,不保存响应 |
previous_response_id | 恒为 null,不支持续接会话 |
conversation | 不支持 |
background / metadata / include | 忽略 |
prompt / truncation / service_tier | 忽略 |
safety_identifier / context_management | 忽略 |
stream_options | 忽略 |
prompt_cache_key / prompt_cache_retention | 忽略 |
parallel_tool_calls | 忽略,并行工具调用恒为开启 |
max_tool_calls | 忽略 |
file_search / code_interpreter / mcp 工具 | 忽略 |
其他限制:
- 自定义工具(
type: custom)仅支持apply_patch web_search工具会忽略search_context_size与user_location- 文件内容块会被转换为占位符;图片仅
deepseek-v4-flash-vision-exp支持,传给另外两个模型时同样会被转成占位符 - 图片只能出现在
role: user的消息中,放进system或assistant会返回 400 - 输入超过上下文窗口直接返回 400,不做自动截断
curl --request POST \
--url https://direct.evolink.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-v4-flash",
"input": "用一句话介绍杭州。"
}
'{
"id": "resp_9f2c1a4b8e7d",
"object": "response",
"created_at": 1755000000,
"status": "completed",
"model": "deepseek-v4-flash",
"output": [
{
"id": "rs_2b7f",
"type": "reasoning",
"summary": [],
"content": [
{
"type": "reasoning_text",
"text": "用户想要一句话介绍,需要覆盖地理与人文两个要点。"
}
]
},
{
"id": "msg_5d1a",
"type": "message",
"role": "assistant",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "杭州是浙江省省会,以西湖山水与数字经济闻名。",
"annotations": []
}
]
}
],
"error": null,
"incomplete_details": null,
"usage": {
"input_tokens": 694,
"input_tokens_details": {
"cached_tokens": 640
},
"output_tokens": 20,
"output_tokens_details": {
"reasoning_tokens": 10
},
"total_tokens": 714
}
}{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid authentication credentials",
"type": "authentication_error"
}
}{
"error": {
"code": 402,
"message": "Insufficient quota",
"type": "insufficient_quota"
}
}{
"error": {
"code": 403,
"message": "Model access denied",
"type": "permission_error"
}
}{
"error": {
"code": 404,
"message": "Model not found",
"type": "not_found_error"
}
}{
"error": {
"code": 413,
"message": "Request entity too large",
"type": "invalid_request_error"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}{
"error": {
"code": 500,
"message": "Internal server error",
"type": "server_error"
}
}{
"error": {
"code": 502,
"message": "Bad gateway",
"type": "server_error"
}
}{
"error": {
"code": 503,
"message": "Service temporarily unavailable",
"type": "server_error"
}
}https://direct.evolink.ai,对文本模型支持更好,支持长连接;https://api.evolink.ai 是多模态主力地址,对文本模型作为备用地址使用。授权
##所有接口均需要使用 Bearer Token 进行认证##
获取 API Key:
访问 API Key 管理页面 获取您的 API Key
使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
模型 ID
deepseek-v4-flash:快速通用,适合日常对话、摘要、抽取deepseek-v4-pro:深度推理,适合复杂数学、代码与多步规划deepseek-v4-flash-vision-exp:支持图像理解的实验性模型,文本能力、参数与计费均与 Flash 一致
识图必须指定 deepseek-v4-flash-vision-exp:其余两个模型收到 input_image 时不会报错,但图片会被替换为占位文本而实际丢弃,请求照常计费。
实验性说明:-exp 为上游标记的实验版本,模型名与可用性可能变动,建议做好降级预案。
deepseek-v4-flash, deepseek-v4-pro, deepseek-v4-flash-vision-exp "deepseek-v4-flash"
模型输入。input 与 instructions 至少提供一个。
- 字符串形态:整段文本按一条
user消息处理 - 数组形态:输入项列表,支持
message、function_call、function_call_output、reasoning、web_search_call五种类型
图像输入:使用 deepseek-v4-flash-vision-exp 时,可在 message 项的 content 数组里混合 input_text 与 input_image 块。
多轮对话:接口无状态,续接对话必须把完整历史放进数组。
"用一句话介绍杭州。"
系统级指令,等价于插入在最前面的一条 system 消息,用于设定角色、语气与输出约束。
"你是一位严谨的技术文档工程师,回答保持简洁。"
是否流式返回
false(默认):一次性返回完整响应对象true:以语义化 SSE 事件推送,末尾事件为response.completed/response.incomplete/response.failed,不会发送[DONE]
false
本次生成的最大输出 token 数(含思考 token)。取值范围 1 ~ 393216(384K)。留空则由模型自行决定。
1 <= x <= 3932164096
采样温度,越高输出越随机。思考模式下不生效。
0 <= x <= 21
核采样阈值,与 temperature 建议只调其一。思考模式下不生效。
x <= 11
返回每个位置概率最高的若干候选 token 及其对数概率。
0 <= x <= 200
思考模式配置。DeepSeek V4 默认开启思考,思考内容以 reasoning 输出项返回,其 token 计入输出并按输出价计费。
Show child attributes
Show child attributes
文本输出格式配置。
Show child attributes
Show child attributes
可供模型调用的工具列表。函数工具由客户端执行并把结果以 function_call_output 回传;web_search 由服务端直接执行,无需客户端参与。
Show child attributes
Show child attributes
工具调用策略
none:禁止调用工具auto(默认):由模型决定required:必须至少调用一个工具{"type": "function", "name": "get_weather"}:强制调用指定函数{"type": "web_search"}:强制执行联网搜索
"auto"
响应
生成成功
Responses 接口的响应对象。
本次响应的唯一标识
"resp_9f2c1a4b8e7d"
对象类型,固定为 response
"response"
创建时间,Unix 时间戳(秒)
1755000000
响应状态
completed:正常完成in_progress:生成中incomplete:因长度等原因被截断,详见incomplete_detailsfailed:生成失败,详见error
in_progress, completed, incomplete, failed "completed"
实际生成本次响应的模型 ID
"deepseek-v4-flash"
输出项列表,按生成顺序排列。各类型的字段:
reasoning:思考过程,含id、status、content(reasoning_text块列表)、summarymessage:最终回答,含id、status、role、content(output_text块列表)function_call:模型发起的函数调用,含id、status、call_id、name、arguments,需客户端执行后以function_call_output回传web_search_call:服务端执行的联网搜索记录,含id、status、action(描述本次搜索动作)
失败原因,成功时为 null
截断原因,未截断时为 null
Token 使用统计信息(含缓存与推理分项)
Show child attributes
Show child attributes