curl --request POST \
--url https://direct.evolink.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-v4-flash",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello, world"
}
]
}
'{
"id": "53ee6690-e14a-4e6b-890b-a135100d51c7",
"type": "message",
"role": "assistant",
"model": "deepseek-v4-flash",
"content": [
{
"type": "thinking",
"thinking": "用户问的是\"日本首都\",这是一个基础地理知识问题,答案就是东京,直接给出即可。",
"signature": "53ee6690-e14a-4e6b-890b-a135100d51c7"
},
{
"type": "text",
"text": "日本的首都是**东京**。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 7,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"output_tokens": 77,
"service_tier": "standard"
}
}DeepSeek V4 - Anthropic 兼容接口
- 使用 Anthropic Messages 协议调用 DeepSeek V4 模型
- 支持
deepseek-v4-flash/deepseek-v4-pro/deepseek-v4-flash-vision-exp - 请求 / 响应结构与 Anthropic API 对齐
- 图像理解:
deepseek-v4-flash-vision-exp支持imagecontent block(source.type可为base64或url) - 系统提示词:通过顶层
system传入 - 思考模式:
thinking对象开关;思考内容通过content[type=thinking]block 返回 - 流式输出:SSE 事件流
- 工具调用:兼容 Anthropic
tool_use/tool_result流程
⚠️ 重要:向
deepseek-v4-flash/deepseek-v4-pro发送imageblock 不会报错,但图片会被上游替换为[Unsupported Image]占位符——模型实际看不到图片内容,且请求照常计费。需要识图请务必将model指定为deepseek-v4-flash-vision-exp。
curl --request POST \
--url https://direct.evolink.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-v4-flash",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello, world"
}
]
}
'{
"id": "53ee6690-e14a-4e6b-890b-a135100d51c7",
"type": "message",
"role": "assistant",
"model": "deepseek-v4-flash",
"content": [
{
"type": "thinking",
"thinking": "用户问的是\"日本首都\",这是一个基础地理知识问题,答案就是东京,直接给出即可。",
"signature": "53ee6690-e14a-4e6b-890b-a135100d51c7"
},
{
"type": "text",
"text": "日本的首都是**东京**。"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 7,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"output_tokens": 77,
"service_tier": "standard"
}
}https://direct.evolink.ai,对文本模型支持更好,支持长连接;https://api.evolink.ai 是多模态主力地址,对文本模型作为备用地址使用。授权
##所有接口均需要使用 Bearer Token 进行认证##
获取 API Key:
访问 API Key 管理页面 获取您的 API Key
使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY
备注:虽然 Anthropic 原生 API 使用 x-api-key 头,EvoLink 对 /v1/messages 统一采用 Bearer Token 鉴权。
请求体
要调用的模型
deepseek-v4-flash:快速通用deepseek-v4-pro:深度推理deepseek-v4-flash-vision-exp:支持图像理解的实验性模型,文本能力、参数与计费均与 Flash 一致
提示:三个模型 均默认启用 thinking,响应中始终包含 type="thinking" content block;如需关闭请显式 thinking.type="disabled"。Claude 模型名自动映射:可直接传 Anthropic 官方模型名,上游按下表映射——claude-opus-* → deepseek-v4-pro;claude-sonnet-* / claude-haiku-* → deepseek-v4-flash。非 Claude 系列的未知模型名(如 gpt-4o)会返回 400。
⚠️ 使用 Claude Code 等工具直连而不改模型名时,实际执行与计费的模型由上述映射决定,opus 会落到单价更高的 deepseek-v4-pro。
识图必须指定 deepseek-v4-flash-vision-exp:其余两个模型收到 image block 时不会报错,但图片会被替换为 [Unsupported Image] 占位符而实际丢弃。
实验性说明:-exp 为上游标记的实验版本,模型名与可用性可能变动,建议做好降级预案。
deepseek-v4-flash, deepseek-v4-pro, deepseek-v4-flash-vision-exp "deepseek-v4-flash"
要生成的最大 token 数(必填)
说明:
- V4 系列最大可达 384,000
- thinking 产生的 token 也计入 max_tokens 上限
1 <= x <= 3840001024
对话消息列表,按轮次 user / assistant 交替
说明:
- 至少包含 1 条消息
- 最后一条消息通常为
role=user image内容类型仅deepseek-v4-flash-vision-exp支持;document暂不支持
1Show child attributes
Show child attributes
系统提示词,用于设定 AI 角色与行为
说明:
- 支持字符串或字符串数组
- 不同于 OpenAI 端点的
system消息,Anthropic 端点使用顶层system字段
"You are a helpful assistant."
采样温度
说明:
- 范围
[0.0, 2.0] - 默认 1;值越高越发散,越低越确定
0 <= x <= 21
核采样阈值
说明:
- 范围
[0, 1] - 建议不要同时调整 temperature 与 top_p
0 <= x <= 11
自定义停止序列
说明:
- 模型遇到任一字符串即停止生成
- 最多 4 条(遵循 Anthropic 规范)
4是否以 SSE 流式返回
true:Server-Sent Events 流式返回false:完整响应后一次性返回(默认)
false
思考模式控制(V4)
说明:
- 两个模型均默认启用(
type=enabled) - 启用后响应
content数组中会出现type="thinking"的推理过程 block(按输出 token 计费) - 注意:该接口会 忽略 Anthropic 原生的
budget_tokens字段,使用output_config.effort控制深度 - 多轮对话中把上一轮响应的 thinking block 原样放回 assistant
content数组即可(Anthropic 协议风格更宽松,不会因为缺失 thinking 而报错,但保留 signature 有助于上下文一致性)
Show child attributes
Show child attributes
输出配置(V4 扩展)
说明:Deepseek 仅支持 effort 字段
Show child attributes
Show child attributes
工具定义列表
说明:
- 遵循 Anthropic tool 定义规范
input_schema使用 JSON Schema 对象
Show child attributes
Show child attributes
控制工具调用行为
可选 type:
auto:模型自动决定(默认,当提供 tools 时)any:必须调用某个工具(不指定哪个)tool:必须调用指定的namenone:禁止调用工具
Show child attributes
Show child attributes
响应
消息对象
Anthropic 风格的消息响应
消息唯一 ID
响应对象类型
message assistant 实际使用的模型
"deepseek-v4-pro"
响应内容块列表
可能包含的 block type:
thinking:推理过程(仅启用 thinking 时)text:最终回答文本tool_use:模型发起的工具调用
Show child attributes
Show child attributes
停止原因
end_turn:自然结束max_tokens:达到 max_tokens 上限stop_sequence:命中 stop_sequencestool_use:模型触发工具调用
end_turn, max_tokens, stop_sequence, tool_use 当 stop_reason=stop_sequence 时命中的具体序列,否则 null
Token 使用统计(Anthropic 规范)
Show child attributes
Show child attributes