← All posts

Insights

Structured Outputs: Why Valid JSON Is Not Enough

Structured outputs control format, not factual accuracy. Compare evidence checks, correction costs, and acceptance rules before automating AI records.

Structured outputs make AI responses easier for software to consume, but a correctly shaped object can still contain the wrong facts. The business value comes from combining a dependable format with evidence checks, clear handling of missing information, and an acceptance rule tied to the task.

This distinction matters when a model fills a catalog, extracts details from documents, or prepares records for another system. A parser can accept a delivery date that the customer never agreed to. Faster ingestion only helps when the record deserves to move forward.

Prepared by Token360. Official documentation checked November 2, 2026. The examples and cost comparison below are original hypothetical scenarios, not a Token360 benchmark or a claim about any model's measured accuracy.

Read first: use the AI model evaluation framework to define acceptable results before comparing output formats.

What do structured outputs actually solve?

They constrain the shape of a response so downstream software can read predictable fields and types. That reduces formatting uncertainty; it does not independently verify what the fields mean.

The Claude structured outputs documentation describes schema-constrained JSON and a separate strict tool-use capability. It also documents limitations on supported schemas. Treat those as features of the documented provider interface, not proof that every gateway route exposes the same controls.

Consider a product record with a name, size, and availability status. A required status field can stop the model from omitting that key. An allowed-value list can restrict its vocabulary. Neither tells you whether the product is actually in stock. That answer needs a trustworthy source and a rule for freshness.

Why can schema-valid data still be wrong?

A schema tests the contract you encoded, while correctness depends on the source and business context. Types and required fields cannot establish every relationship between a document and a decision.

Google's Gemini structured-output guidance explicitly distinguishes syntactic validity from semantic correctness and advises application-side value validation. This is a useful design boundary even when your chosen provider uses different request parameters.

Suppose a purchase request says, “We need 12 units; delivery date to be confirmed.” An output containing quantity 12 and a plausible date can be perfectly well formed yet unsupported. A fixed date field may encourage a completed-looking record where the honest result is “unknown.”

The relevant question is whether the output preserves the source's uncertainty. Decide which fields may be unknown, which require evidence, and which block further processing. A record with an explicit missing value can be more useful than a complete record containing a guess.

Which checks belong between generation and acceptance?

Use separate checks for structure, evidence, business rules, and permission to act. Keeping them distinct makes failures easier to diagnose and prevents one successful check from standing in for all the others.

CheckQuestionExample failure
StructureDoes the result match the supported contract?Quantity is text where an integer is required.
EvidenceDoes the source support the extracted value?A delivery date appears only in the output.
Business ruleIs this record acceptable for this workflow?A product identifier is absent from the current catalog.
Action permissionMay the system perform the next operation?A draft order has no approval for submission.

These are proposed application checks, not a claim that Token360 automatically performs them. Some rules can be deterministic; others require a reviewer. For evidence-sensitive fields, retain a source reference that your application can resolve and check. A model-generated citation should itself be verified.

Four separate acceptance checks ask whether an output has the right structure, supporting evidence, business validity, and permission for action.
A proposed acceptance framework. Passing one check does not imply passing the next.

What should an extraction contract say about missing information?

It should make absence and ambiguity representable instead of forcing invented precision. Define those states before selecting a model or writing a long extraction prompt.

For the purchase request, a conceptual record might include quantity 12, delivery date null, and review reason “date not confirmed.” This describes the desired application behavior, not a universally portable API schema. Check your route's supported schema subset before translating it into a request.

Also distinguish “not mentioned” from “mentioned but unreadable” and “conflicting values.” Those conditions need different remedies. Asking the model again cannot recover a date that the source never supplied; asking a person or retrieving an additional document might.

Keep the contract small enough to inspect. Adding dozens of optional fields can create a misleading sense of coverage while increasing review effort. Begin with the fields that change the next decision and add others when a downstream consumer has a clear use for them.

How should teams measure the result?

Report both format compliance and business acceptance using explicit denominators. A high parse rate is valuable, but it cannot replace the acceptance rate of the records your team actually needs.

For a fixed evaluation set, count submitted items, completed responses, structurally valid records, evidence-supported records, and records accepted without correction. Keep refusals, incomplete responses, and transport failures visible rather than silently removing them from the denominator.

Use representative difficult cases alongside ordinary examples: absent dates, conflicting quantities, duplicated documents, unfamiliar identifiers, and irrelevant inputs. Freeze the source set and acceptance rubric when comparing candidates. Otherwise, a change in test difficulty can look like a model improvement.

Record the schema version and model route with each evaluation. The AI API observability guide explains why request-level context matters when investigating changes in behavior.

Can a more expensive call produce cheaper accepted records?

Yes, if its extra inference cost is outweighed by lower correction effort at comparable final quality. Whether that happens is an empirical question; the calculation below illustrates the decision without claiming a measured result.

Assume two routes process the same 1,000 records. Route A costs 20 normalized units for inference and sends 200 records for correction. Route B costs 30 units and sends 50 records for correction. Assume each correction costs 0.2 units, resolves the issue successfully, and leaves both routes with 1,000 accepted records.

Hypothetical costRoute ARoute B
Inference20 units30 units
Correction200 × 0.2 = 40 units50 × 0.2 = 10 units
Total included cost60 units40 units
Per accepted record0.060 units0.040 units

Route B has 50% higher inference spending but roughly 33% lower included total cost in this scenario. These are not dollars, observed rejection rates, or evidence that structured outputs caused the improvement. Integration, storage, supervision, and unresolved-error costs are excluded.

The break-even correction cost is 10 divided by 150, or about 0.067 units per correction. Below that assumption, A is cheaper; above it, B is cheaper. Use your own costs and measured correction counts before choosing a route. The AI API cost management guide places this calculation within a broader operating budget.

Hypothetical route A costs 20 inference units plus 40 correction units, while route B costs 30 plus 10, producing totals of 60 and 40 for the same thousand accepted records.

When should a record be retried or reviewed?

Retry when another attempt can reasonably fix the identified failure; review when the input or decision requires information the model does not have. Route the failure by cause instead of treating every rejected record as a formatting problem.

An incomplete response may justify a bounded retry after checking completion status and output limits. An unsupported schema requires a contract change. A missing source fact needs additional evidence or an explicit unresolved state. A business-rule violation may require correcting the source system.

Preserve the original output and the reason for any correction. Quietly repairing a field can hide where reliability is being lost. For consequential actions, keep acceptance of a record separate from authorization to execute it.

What should Token360 users verify before adoption?

Verify the exact model route, endpoint, schema support, and failure behavior with a small application test. A familiar API shape is not sufficient evidence of feature equivalence.

Consult Token360's model capability documentation, then confirm that the selected route supports the output control you intend to use. Test a normal input, an ambiguous input, an unsupported contract, and an incomplete response path before expanding traffic.

This article is an evaluation perspective from Token360, not a promise that all listed models support identical structured-output settings. The adoption decision should follow demonstrated acceptance behavior for your workload.

One schema-valid record that must still be rejected

Consider this authored source: “Order DEMO-001: 12 units. Delivery date to be confirmed.” Suppose the application schema requires an order ID, an integer quantity and a delivery_date that may be a date string or null. Both records below can satisfy that shape; only one preserves the source’s uncertainty.

CandidateValueDisposition
Aorder_id=DEMO-001; quantity=12; delivery_date=2026-12-01Reject the date: it appears nowhere in the source
Border_id=DEMO-001; quantity=12; delivery_date=nullAccept extraction; keep scheduling unresolved

These candidates were written for the example and are not model outputs. Accepting B does not authorize shipment or confirm a customer appointment. The next application state can be “awaiting delivery confirmation,” which gives a human a specific action without asking the model to guess again. Preserve A with the rejection reason if it appears in a real run; overwriting it with B would hide the original unsupported inference. This completes the path from source to structural validation, evidence validation and workflow disposition.

Frequently asked questions

Are JSON mode and structured outputs the same?

Do not assume so. A mode that returns JSON may not enforce your field-level schema. Read the exact endpoint contract and test the constraints your application depends on.

Do structured outputs prevent hallucinations?

No. A schema can constrain the form of a value without proving that the source supports it. Evidence validation remains a separate requirement.

Should every field be required?

Only if the contract still represents legitimate unknowns. A required key can hold an allowed unknown state; requiring a concrete answer for missing information creates unnecessary pressure to guess.

Can I reuse one schema across providers?

Possibly, but validate the supported subset and endpoint behavior on each route. A schema accepted by one interface is not automatically portable to another.

Is a model's confidence score enough for acceptance?

No. Treat it as another output to evaluate, not an independently verified probability. Test its relationship to correctness before using it to route review.

What is the most useful cost metric?

Included operating cost per accepted record, with the cost boundary and acceptance rule stated. Also track time to acceptance so cheaper processing does not conceal an unusable delay.

Read next: the AI API governance implementation guide connects acceptance rules with ownership and operational controls.

Editorial revision: November 4, 2026. Test dates and dated source snapshots remain as stated in the article.

  • API
  • Structured Outputs
  • Validation

Build faster with one AI API.

Use Token360 to call video, image, audio, and text models with one key and one bill.

Get started