Tabbit
ResourcesBlogModels
Tabbit LogoTabbit

Tabbit — The AI Browser that Works for You

Topics

  • AI Browser Resources
  • Agentic Browser Resources
  • Browser Downloads and Install Guides
  • Browser Comparisons
  • AI Browser Alternatives
  • Browser Productivity Resources

Popular Guides

  • AI Browser
  • Agentic Browser Download
  • Best AI Browser 2026: Top 9 Tested & Ranked
  • AI Browser Download
  • Free AI Browser
  • Best AI Browser 2026
  • AI Browser Comparison 2026
  • AI Browser for Windows
  • AI Browser for Mac
  • Chrome Alternative 2026

Events

  • Tabbit Skill Competition
  • KPOP SBTI Fandom Personality Test
  • Tabbit Campus Creator Program
  • fifi's Picks: AI Skills for Research Papers
  • User Survey

About

  • Tabbit Blog
  • Press & Media
Prompt guide
OfficialDeepSeek V4.1 Flash

DeepSeek V4.1 Flash: Tool Calls and Strict Schema Configuration

Original source

DeepSeek API Docs

AuthorNot specified

Tabbit curation2026-09-16

Read original

One-sentence takeaway

Tool calling is a two-stage, client-driven process: the model first returns tool_calls, the client executes the function and sends back the role="tool" result, and the model then generates the final answer. When strict beta is enabled, the beta endpoint must be used, every function must set strict: true, and the submitted JSON Schema must fall within the range supported by the service; Chat Completion does not support inserting tool calls that the model did not generate into the middle of the history.

Use cases

  • Suitable tasks: Agent workflows that require the model to call weather, database, search, or business functions while requiring function parameters to conform strictly to a Schema.

  • Unsuitable tasks: Scenarios that require dynamically inserting tool calls and results into the middle of a Chat Completion history; use the Anthropic API or Responses API instead.

  • Applicable model version: deepseek-flash, corresponding to DeepSeek-V4.1-Flash.

  • Applicable client, Agent, or API: OpenAI-compatible Chat Completion API; strict mode supports both thinking and non-thinking mode.

  • Recommended reasoning tier and parameters: Not specified; this article only defines tool-call and Schema configuration.

Ready-to-use content

Minimal strict tool definition

The following is a tool definition that can be placed in the request's tools array. It is not a complete API request or a runnable Python script:

{
  "type": "function",
  "function": {
    "name": "get_weather",
    "strict": true,
    "description": "Get weather of a location.",
    "parameters": {
      "type": "object",
      "properties": {
        "location": { "type": "string" }
      },
      "required": ["location"],
      "additionalProperties": false
    }
  }
}

Strict mode also requires setting the client endpoint to:

https://api.deepseek.com/beta

Every function in the request must set strict: true. The service validates the function Schema; if the Schema does not meet the requirements or contains unsupported types, the request returns an error.

Schema rules at a glance

Supported types or combinations include: object, string, number, integer, boolean, array, enum, and anyOf. The page also explains that $def can define reusable modules and $ref can reference modules or express recursive structures.

Objects must satisfy both requirements at the same time:

{
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "age": { "type": "integer" }
  },
  "required": ["name", "age"],
  "additionalProperties": false
}

In other words, every property must be listed in required, and additionalProperties must be set to false. Strings support pattern and format; the currently supported format values are email, hostname, ipv4, ipv6, and uuid, while minLength and maxLength are not supported. Numbers and integers support const, default, minimum, maximum, exclusiveMinimum, exclusiveMaximum, and multipleOf; arrays do not support minItems or maxItems.

Testing or workflow steps

  1. Define the function and parameter Schema in tools; in strict mode, set each function's strict to true and use https://api.deepseek.com/beta.

  2. Send the user message and tools to deepseek-flash, and read the tool_calls in the returned assistant message.

  3. Based on the function name and arguments in tool_calls, have the client execute the real function. The model only proposes the call; it does not execute the specific function on the client's behalf.

  4. Append the complete assistant message to the history, then append the corresponding tool result:

    { "role": "tool", "tool_call_id": "<corresponding call ID>", "content": "<client function result>" }
  5. Send the message history again until the assistant no longer returns tool_calls, then read the natural-language answer.

The protocol boundary for inserting content during tool calling is as follows:

sequenceDiagram
    participant U as User
    participant M as Model
    participant C as Client
    participant T as External tool
    U->>M: messages + tools
    M-->>C: assistant.tool_calls
    C->>T: Execute function
    T-->>C: Result
    C->>M: Complete assistant + role=tool
    M-->>C: Final answer
  • The Anthropic API (/messages) and Responses API support putting client-dynamically inserted tool calls and results into the middle of a conversation, and also support inserting a system message in the middle.

  • Chat Completion supports inserting a system message in the middle, but does not support inserting tool calls in the middle. When this capability is required, use one of the two APIs above instead.

Original evidence and data

  • The official page's Non-thinking Mode section gives a get_weather example: the model returns get_weather({location: 'Hangzhou'}); after the client provides a result, the model returns a natural-language answer, “The current temperature in Hangzhou is 24°C.”

  • The example's "content": "24℃" is a fixed simulated result written directly in the code. It represents a client tool return, not a real weather tool or real-time weather data.

  • The page explicitly states that the specific functionality of get_weather must be provided by the user; the model does not execute the function itself.

  • The requirements for strict beta are: use the https://api.deepseek.com/beta endpoint, set strict: true for every function, and have the service validate the JSON Schema submitted by the user.

  • Strict mode supports both thinking and non-thinking mode; the page does not provide a thinking switch or reasoning-tier configuration.

Applicable boundaries

  • The page places the example in a section titled “Non-thinking Mode,” but the example request does not explicitly pass a thinking field. The current model homepage defaults to thinking enabled, so the title alone cannot prove that the code explicitly disables thinking; when reproducing, confirm the actual mode against the current API's thinking configuration.

  • Strict is a beta capability, and not every JSON Schema will pass the service's validation. In particular, check required and additionalProperties: false for nested objects.

  • Tool results must be generated by the client and returned with the corresponding tool_call_id; a function call returned by the model cannot be treated as an executed result.

  • The JSON in this article is only a minimal tool definition fragment. It does not include an API key, complete client initialization, exception handling, or a real tool implementation.

Reproduction notes

On 2026-09-16, the DeepSeek Tool Calls page was read in full through the Tabbit browser; no real API request was executed. To reproduce the strict configuration, use the beta endpoint, strict: true, and a complete Schema as required by the page; treat the weather example's 24℃ as a fixed simulated client return.

Curated by Tabbit

Prompt material is summarized from public sources and Tabbit editorial notes. Check the original licensing and intended use before copying it.

DeepSeek V4.1 Flash

Use in Tabbit

DeepSeek V4.1 Flash

Related prompts

OfficialDeepSeek API Docs

DeepSeek-V4.1-Flash: API Model Aliases and First Call

OfficialDeepSeek API Docs

DeepSeek V4.1 Flash Thinking Mode and Reasoning Parameter Configuration

OfficialDeepSeek API Docs

DeepSeek V4.1 Flash: Image Input and Vision Configuration

OfficialDeepSeek API Docs

DeepSeek V4.1 Flash: JSON Question-and-Answer Extraction Prompt

DeepSeek V4.1 Flash

Related reviews

MediaHugging Face (DeepSeek official model card)

DeepSeek-V4.1-Flash Official Model Card Benchmarks: Agent Strengths and Harness Boundaries

CommunityX2026-09-15

DeepSeek-V4.1-Flash (Max): Task Cost and Net Improvement in Agent Arena

CommunityX (Artificial Analysis)2026-09-11

Artificial Analysis: DeepSeek V4.1 Flash's Intelligence, Cost, and Hallucination Boundaries

MediaAI IQ

DeepSeek V4.1 Flash on the AI IQ Leaderboard: Composite Score and Benchmark Coverage