Urgent.News

What's breaking now, across thousands of outlets.

AI

DeepSeek V4 Flash API Cost: Thinking Mode Corrupts Strict JSON

DeepSeek V4 Flash costs $0.14 per million input tokens and $0.28 per million output, with cache hits at $0.0028, and the retrained 0731 build that now ships under that name has a defect you need to route around: with thinking on (the default) and a strict json_schema , integer fields came back corrupted in 8 of 13 default-thinking runs across two independent request paths. Turning thinking off…

DeepSeek released three versions of its V4 model: Flash 0731, Flash Preview, and V4 Pro. All three share the same tokenizer, cache, and thinking machinery, but they differ in pricing and failure modes. The Flash 0731 build is the cheapest at $0.14 per million input tokens and $0.28 per million output, while the V4 Pro costs $0.435 per million input tokens and $0.87 per million output.

A critical issue was discovered with the Flash 0731 build when using thinking mode and strict JSON schema. In 8 out of 13 runs across two request paths, integer fields were corrupted. Turning off thinking fixed the issue, reducing token usage to a seventh of the default. The retrained 0731 build sharpened the off-switch cliff, causing the 2-hop math to fall from 6/6 to 0/6.

The cache serves 1,024-token pages from a 1.1K-token floor, with hits occurring approximately 0.3 seconds after priming. Entries remain valid for up to 45 minutes. Disabling thinking entirely (enable_thinking: false) resolved the corruption issue, executing the same task in about 44 completion tokens compared to the default's 328.

The preview build performed flawlessly with thinking on, while V4 Pro showed corruption in 2 out of 4 runs. The Flash 0731 build was the hardest hit, with the corruption issue being the most severe. The problem is not related to the thinking budget but to the presence of thinking itself.

In summary, the three V4 builds share the same underlying infrastructure but differ in pricing and failure modes. The Flash 0731 build, when using thinking mode with strict JSON schema, experiences JSON corruption. Disabling thinking resolves the issue, making thinking and strict structured output mutually exclusive for this model. The lesson is to treat thinking and strict structured output as incompatible options when using DeepSeek V4 Flash.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

MCP Explained: The Protocol Powering AI Agents

Introduction Artificial Intelligence has evolved far beyond answering questions and generating code. Modern AI systems can search databases, interact with APIs, read files, execute commands, access…

  • Model Context Protocol (MCP) streamlines AI agents' interaction with external tools.
  • Eliminates need for custom integrations for each AI model and application.
  • Offers standardized integrations, maintainability, and discoverability advantages.

More from Tuesday 4 August →