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.ai/v1/chat/completions' \
  -H 'Authorization: Bearer your-api-key' \
  -H 'Content-Type: application/json' \
  --data '{
    "model": "MODEL_ID",
    "messages": [{"role": "user", "content": "用三點說明如何排查 API 逾時"}],
    "thinking": {"type": "enabled"},
    "reasoning_effort": "high",
    "max_tokens": 4096
  }'

官方參考

本頁目錄