DeepSeek V4 Flash Vision Exp API
https://api.hiapi.ai /v1/responses 该模型推荐使用兼容 OpenAI 的 Responses 接口,并继续保留 /v1/chat/completions 兼容入口。同一个 HiAPI API Key 可调用账户分组内已开放模型;图片、视频或音频模型使用 /v1/tasks 及对应请求结构。
模型概览
| 模型 ID | deepseek-v4-flash-vision-exp |
|---|---|
| 输入 / 输出 | 文本与图片 → 文本 |
| 上下文窗口 | 1,048,576 tokens |
| HiAPI 输出上限 | 262,144 tokens |
| 能力 | 流式、推理、JSON、函数工具 |
| Token 价格 | HiAPI 实时价格 |
DeepSeek V4 Flash Vision Exp 为实验版 V4 Flash 增加图片理解能力,适合文档与图表阅读、视觉问答及图文工作流,可通过 Responses 或 Chat Completions 调用。
生产建议
- 在用户输入中使用公开 HTTPS 图片 URL 或 base64 data URL。Responses 使用 input_image,Chat Completions 使用 image_url 内容块。
- 使用 store:false,并在 input 中重发相关对话。函数工具由应用执行。
- 同一个 HiAPI API Key 可调用已开放模型。图片、视频、音频生成使用独立的 /v1/tasks 协议。
适用场景
理解可见细节、文档和图表。
input将图片理解与 JSON、函数调用结合。
text.formattools请求参数
model string 必填 使用此完整公共模型 ID。
input string | array 必填 文本或包含 input_text、input_image 的消息数组。
instructions string 可选 本次响应的系统指令。
store boolean 可选 示例使用 false,并在 input 中重发所需对话上下文。
stream boolean 可选 设为 true 时返回语义化 SSE 事件。
max_output_tokens integer 可选 输出预算包含推理 Token,最多 262144;输入和输出总量须在上下文窗口内。
reasoning object 可选 示例和 Playground 默认 high。
effort enum 可选 none 关闭推理;low、medium、high 指定推理强度,用量和延迟随任务变化。
text.format object 可选 使用 json_object 返回 JSON 输出。
tools array 可选 函数工具定义。由应用执行函数并回传结果。
tool_choice string | object 可选 选择自动调用或指定函数。
API 接入示例
调用示例
显式设置 none。
{
"model": "deepseek-v4-flash-vision-exp",
"input": [
{
"type": "message",
"role": "user",
"content": [
{
"type": "input_text",
"text": "描述图片主体和两个可见细节。"
},
{
"type": "input_image",
"image_url": "https://static.hiapi.ai/example/subject-1.jpg",
"detail": "low"
}
]
}
],
"store": false,
"reasoning": {
"effort": "none"
},
"max_output_tokens": 1024,
"stream": false
}将 high 推理与 JSON 模式结合。
{
"model": "deepseek-v4-flash-vision-exp",
"input": "Return a JSON object with ok set to true.",
"store": false,
"reasoning": {
"effort": "high",
"VISION_EXP_DEFAULT_OUTPUT_TOKENS": 1024
},
"max_output_tokens": 1024,
"stream": false,
"text": {
"format": {
"type": "json_object"
}
}
}在应用中执行 report,再回传原 function_call 项以及 call_id 匹配的 function_call_output 项。
{
"model": "deepseek-v4-flash-vision-exp",
"input": "Call report with value OK.",
"store": false,
"reasoning": {
"effort": "high",
"VISION_EXP_DEFAULT_OUTPUT_TOKENS": 1024
},
"max_output_tokens": 1024,
"stream": false,
"tools": [
{
"type": "function",
"name": "report",
"description": "Report a value",
"parameters": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
},
"required": [
"value"
],
"additionalProperties": false
}
}
],
"tool_choice": {
"type": "function",
"name": "report"
}
}读取语义化 SSE 事件。
{
"model": "deepseek-v4-flash-vision-exp",
"input": [
{
"type": "message",
"role": "user",
"content": [
{
"type": "input_text",
"text": "描述图片主体和两个可见细节。"
},
{
"type": "input_image",
"image_url": "https://static.hiapi.ai/example/subject-1.jpg",
"detail": "low"
}
]
}
],
"store": false,
"reasoning": {
"effort": "high",
"VISION_EXP_DEFAULT_OUTPUT_TOKENS": 1024
},
"max_output_tokens": 1024,
"stream": true
}响应结构
非流式响应从 output 中读取 output_text;流式响应按事件类型处理。计费明细以 usage 为准。
{
"id": "resp_example",
"object": "response",
"status": "completed",
"model": "deepseek-v4-flash-vision-exp",
"output": [
{
"id": "msg_example",
"type": "message",
"role": "assistant",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "稀疏注意力只计算部分关键 Token 之间的关联。"
}
]
}
],
"usage": {
"input_tokens": 24,
"output_tokens": 18,
"total_tokens": 42,
"input_tokens_details": {
"cached_tokens": 0
}
}
} - Responses 文本位于 output 消息的 output_text 内容;Chat 文本位于 choices[0].message.content。
- 流式时拼接 response.output_text.delta,结束后读取终态 usage。
常见问题
这个模型可以生成图片吗?
它接受文本和图片输入,返回文本。适合图片描述、文档与图表理解、视觉问答,以及结合图片进行推理;生成或编辑图片需要选择对应的图像模型。
应该使用哪个模型 ID 和接口?
model 填写 deepseek-v4-flash-vision-exp。推荐 POST /v1/responses,使用 input 传入内容;也可使用 POST /v1/chat/completions,通过 messages 传入内容。两个接口的图片格式不同,请使用对应示例。
图片怎么上传?支持多张图片吗?
Playground 支持上传或粘贴 JPEG、PNG、WebP、GIF,每条消息最多 4 张、每张不超过 10 MB。API 可使用公开 HTTPS 图片 URL 或 base64 data URL:Responses 使用 input_image,Chat Completions 使用 image_url 内容块。上述上传数量和大小是 Playground 限制。
如何选择或关闭推理?
Responses 使用 reasoning.effort,页面提供 none、low、medium、high,默认 high。none 关闭推理;其他档位用于推理任务,实际耗时和 Token 用量取决于问题。Chat Completions 关闭推理时使用 reasoning.enabled=false。
上下文和输出长度是多少?为什么回答会被截断?
本页上下文窗口为 1,048,576 Token,输出预算上限为 262,144 Token;Playground 和默认示例使用 1,024。输出预算包含推理 Token,较复杂的问题可能在生成正文前消耗较多预算。遇到截断时可提高 max_output_tokens,或关闭推理后重试;输入与输出总量仍需满足上下文限制。
图片、推理和缓存 Token 如何计费?
图片 Token 计入输入,推理 Token 计入输出,缓存命中的输入按缓存输入单价结算。输入、输出与缓存单价查看本页实时价格区。Responses 的 usage.input_tokens、usage.output_tokens 和 input_tokens_details.cached_tokens 可用于对照调用日志;缓存命中不等于整次请求免费。
多轮对话需要重新发送历史吗?
本页示例使用 store:false,每轮在 input 中重新传入需要保留的上下文。服务端不会仅凭上一轮返回的文本自动记住整段对话;使用 Chat Completions 时,把所需历史放入 messages。
支持 JSON 输出和函数调用吗?
支持。Responses 可用 text.format.type=json_object 请求 JSON,用 tools 和 tool_choice 声明及选择函数。模型返回函数调用后,由你的应用执行函数,再回传 call_id 匹配的 function_call_output。模型不会代替应用执行本地代码;完整请求见 API 文档示例。
流式响应怎么判断结束?
Responses 用 response.output_text.delta 接收正文增量,在 response.completed 中读取最终 usage;也要处理 response.incomplete 和 response.failed。不要等待 Responses 返回 Chat Completions 的 [DONE] 标记,后者只用于 Chat Completions 流。
现有 HiAPI API Key 可以直接用吗?
可以,前提是 Key 有该模型的调用权限且账户余额充足。OpenAI SDK 的 base_url 使用 https://api.hiapi.ai/v1,并选择 responses.create 或 chat.completions.create。网页 Playground 使用登录态,无需粘贴 API Key。