AGTCloud API Docs
文档指南API Reference集成与资源更新与帮助
各厂商字段特性差异

DeepSeek 参数与协议差异

了解 DeepSeek 系列模型在兼容协议下的参数差异与使用方式。

使用 DeepSeek 模型时,根据本页调整所选协议的参数。完整请求和响应结构参阅 Chat Completions、Responses 和 Messages。

适用模型

模型适用范围
deepseek-flashChat、Responses、Messages;支持图片输入
deepseek-v4-proChat、Responses、Messages;不支持图片输入,Responses 支持服务端搜索

Chat Completions 差异

字段差异说明
thinking.type两款模型默认开启思考,支持 enabled/disabled
reasoning_effortnone 关闭思考,low/high/max 开启思考,默认 high;兼容档位 minimal 映射为 low,medium/xhigh 映射为 high,ultra 映射为 max
temperature范围 0~2;思考模式下传入值被忽略
top_pFlash:思考时有效范围 0.95~1,低于 0.95 按 0.95 处理;非思考时固定为 1。Pro:思考时忽略传入值,携带 tools 固定为 0.95,否则为 1;非思考时生效
max_tokensDeepSeek 仍使用此字段,未标记弃用;范围 1~393216。非思考时默认 8192,思考时默认 65536,努力程度为 max 时默认 131072
presence_penalty、frequency_penalty官方已弃用,传入不会生效
stop字符串或字符串数组,最多 16 个停止串
response_format.type支持 text/json_object;JSON 模式还须在提示词中明确要求输出 JSON
tools、tool_choice仅支持 Function Tool;思考模式下使用 required 或指定函数会返回 400,须先关闭思考
历史 reasoning_content思考模式下,请求携带 tools 时须回传所有历史 assistant 思考,包括未发生工具调用的轮次;未携带 tools 时历史思考被忽略
stream_options.include_usage只能与 stream: true 同用;无论是否开启,最后一个内容块均有完整 Usage,不另发 choices: [] 的用量块。开启后,之前各块的 usage 为 null
user_idDeepSeek 扩展:最长 512 个字符,仅允许字母、数字、下划线和连字符;用于用户、缓存和调度隔离,不应包含个人隐私信息

Responses 差异

字段差异说明
input、instructions至少传一个;instructions 作为首条 system 消息,developer 角色按 user 处理
reasoning.effort默认 high,支持 none/low/high/max,兼容档位映射同上表;none 关闭思考
temperature、top_p取值和思考模式下的行为同上表,注意 Flash 与 Pro 的区别
previous_response_id、conversation、store无状态接口,传入值被忽略;多轮须回传历史输入和输出。响应固定为 previous_response_id: null、store: false
text.format支持 text/json_object/json_schema;JSON Schema 须提供 name 和 schema
text.verbosity、reasoning.summary前者不生效,后者不生成摘要;历史 reasoning 仅支持明文 content,不支持 summary/encrypted_content
tools支持 Function Tool;Custom Tool 仅支持名称为 apply_patch,其他名称返回 400。web_search 仅 Pro 生效,Flash 忽略;file_search、code_interpreter、computer_use、mcp 被忽略
tool_choice支持 none/auto/required 及指定 Function Tool
parallel_tool_calls、max_tool_calls传入值被忽略;并行工具调用始终开启,响应的 parallel_tool_calls 固定为 true
truncation被忽略,不自动截断;输入超出上下文限制返回 400
background、metadata、include、prompt传入值被忽略
service_tier、safety_identifier、context_management、stream_options传入值被忽略

Messages 差异

字段差异说明
anthropic-versionDeepSeek 忽略该 Header,不按 Anthropic 的版本日期切换字段规则
thinking、output_config.effort默认开启思考;thinking.type 支持 enabled/disabled,budget_tokens 被忽略。深度使用 low/high/max,默认 high,兼容档位映射同 Chat 表;output_config 仅支持 effort
temperature、top_p取值和思考模式下的行为同 Chat 表;top_k 被忽略
tool_choice.type支持 none/auto/any/tool;disable_parallel_tool_use 被忽略
metadata仅支持 user_id,其他字段被忽略
container、mcp_servers、service_tier传入值被忽略
文本与工具结果文本块的 citations、工具结果的 is_error 被忽略;缓存标记见下表
内容块不支持 document、search_result、redacted_thinking、code_execution_tool_result、mcp_tool_use、mcp_tool_result、container_upload

缓存差异

字段差异说明
自动前缀缓存默认开启,无需添加缓存配置;后续请求完整匹配已写入的前缀单元时可命中,不保证任意相同片段均能命中
Responses 的 prompt_cache_key、prompt_cache_retention传入值被忽略,缓存由系统自动管理
Messages 的 cache_control内容块及工具定义中的标记被忽略
缓存用量Chat 查看 usage.prompt_cache_hit_tokens 和 usage.prompt_cache_miss_tokens;Responses 查看 usage.input_tokens_details.cached_tokens

媒体输入差异

仅 deepseek-flash 支持图片,deepseek-v4-pro 不支持。

输入协议内容块差异说明
图片image_urlChat:image_url.url 使用公开 URL 或 Base64 Data URL
图片input_imageResponses:image_url 使用公开 URL 或 Base64 Data URL;允许放在 user/developer 消息或工具输出中,system/assistant 消息携带图片返回 400
图片imageMessages:source.type=url 时提供 url;source.type=base64 时提供 media_type、data
字段差异说明
detailChat 位于 image_url 内,Responses 位于内容块内;支持 low/high/original/auto,low 缩放至 512×512,其余三个值当前等价
图片格式与大小JPEG、PNG、GIF、WebP;URL/Base64 单张最大 32 MiB,请求体最大 48 MiB,Base64 编码也计入请求体
图片 URL最长 8192 个字符,须能在 60 秒内下载完成

调用示例

将 MODEL_ID 替换为平台提供的完整模型 ID,API Key 使用自己的值。

curl 'https://api.agtcloud.cn/v1/chat/completions' \
  -H 'Authorization: Bearer your-api-key' \
  -H 'Content-Type: application/json' \
  --data '{
    "model": "MODEL_ID",
    "messages": [{"role": "user", "content": "用三点说明如何排查接口超时"}],
    "thinking": {"type": "enabled"},
    "reasoning_effort": "high",
    "max_tokens": 4096
  }'

官方参考

本页目录