TL;DR

Ask for the fields and level of explanation your application actually uses, then set an output allowance large enough to finish that response. Validate the schema and inspect truncation or stop reasons before accepting a result. A smaller limit can increase retries or break JSON. Compare complete, correct outputs before claiming savings from a shorter response format.

01 / Structured output: define the response format

Specify fields, types, allowed values, and handling for unknown data. Explain whether extra fields are allowed and how the application handles invalid responses. Requesting JSON alone does not establish a complete contract.

02 / Output tokens: make explanations optional

If your application only uses a category, it may not need a long explanation every time. Add a short evidence field when it helps the user. Preserve useful information rather than optimizing only for brevity.

Return only JSON, without Markdown.
Fields: category (string), tags (at most 3 strings).
If unknown, set category to "unknown".

03 / Output token limits and truncation

Set an output budget appropriate to the task and check why generation stopped. An overly small limit can truncate JSON, trigger retries, and increase costs. Supported settings vary across models.

04 / Validate in your application

Validate responses against a schema. Record success, format errors, and truncation separately. Confirm quality on representative examples before comparing token use and costs.

Sources and further reading

DS-V4-HUUB · DeepSeek JSON Output Guide ↗api-docs.deepseek.com · Official documentation ↗

Adapted from the source guide, last updated 2026-06-27. Savings depend on your workload and must be measured.