跳转到主要内容
厂商: DeepSeek Model ID: deepseek-v4-flash 能力: 64K context · tool use · streaming · structured output 价格: 按 token,flash 档(实时价格 DeepSeek V4 Flash 拿 V4 基础往延迟方向调。在受限 prompt 上保留 V4 同 样的强代码生成,对短输入的等待时间只有 V4 Pro 的一半。适合内联代码 建议、lint 风格的修复,以及任何一两秒就敏感的 agent 步骤。

请求

curl https://llm.bytespike.ai/v1/chat/completions \
  -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [{"role": "user", "content": "Add type hints to this Python function."}]
  }'

Body 参数

字段类型是否必填默认说明
modelstringdeepseek-v4-flash
messagesarray
max_tokensintegermodel max最大:8192。
toolsarray支持 function calling。
response_formatobjectJSON / 结构化输出。
streambooleanfalseSSE 流式。

响应

{
  "id": "chatcmpl-…",
  "object": "chat.completion",
  "model": "deepseek-v4-flash",
  "choices": [{"index": 0, "message": {"role": "assistant", "content": "..."}, "finish_reason": "stop"}],
  "usage": {"prompt_tokens": 64, "completion_tokens": 142, "total_tokens": 206}
}

代码示例

curl https://llm.bytespike.ai/v1/chat/completions \
  -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
  -H "content-type: application/json" \
  -d '{"model": "deepseek-v4-flash", "messages": [{"role": "user", "content": "Add type hints."}]}'

流式 + 缓存

"stream": true 走 SSE。自动 prompt caching。

错误

Code触发是否计费
400 / 401 / 402 / 422 / 429标准
5xx上游否(自动重试)

何时使用

  • 内联代码建议、lint 风格修复、IDE 集成 agent。
  • 延迟敏感的代码路由。
  • 难题上要完整 V4 Pro 品质,见 DeepSeek V4 Pro
  • 上一代版本,见 DeepSeek V3.2

限制

限制
Context window64K tokens
Max output8192 tokens
支持 tool use
支持 vision
支持 streaming
支持 prompt caching自动