DeepSeek V4 API Tool Call Behavior
Key point
It was confirmed that the DeepSeek V4 API has a technical requirement to always pass back reasoning_content when Tool Calls are involved.
Details
This is an analysis of an API behavior characteristic discovered while integrating the DeepSeek V4 model with GitHub Copilot Chat. The finding emerged while developing a dedicated provider to resolve an issue where the existing OpenAI bridge approach caused a 400 error starting from the second turn of conversations with Tool Call enabled.
Key Findings:
According to the DeepSeek API documentation, in regular conversations without tool calls, it is not necessary to pass back the reasoning_content from previous turns. However, once a turn involving a Tool Call has occurred, the reasoning_content must be included in all subsequent requests.
Test Results Summary:
- Without Tool Calls: Works normally (200 OK) even if the
reasoning_contentof the previous assistant message is omitted. - With Tool Calls involved: After a tool call, omitting the
reasoning_contentof a prior regular text assistant message results in a 400 error (reasoning_content must be passed back). - When only tool definitions are included without an actual tool call: Works normally (200 OK).
This characteristic is a key consideration for developers implementing agent or tool-calling features using DeepSeek V4 when integrating with the API.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.