Free auditStart free
GlossaryGlossary · AI search

Structured outputs

Structured outputs make a model reply in JSON that matches your schema. The Claude and OpenAI parameters, documented schema limits, and the failure cases to handle.

2 min
read
2
sources
Oct 31, 2026
updated
Scaplet Editorial Team
author
In one line

Structured outputs constrain a model's reply to a JSON Schema you supply, so the result parses and carries the keys you asked for. Anthropic enables it with output_config.format of type json_schema; OpenAI uses text.format with strict: true. Both document cases where the output may not match: a refusal, or a reply cut off by a token limit.

30-second check

Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode

At a glance

4 facts from the sources below
output_config.format
Anthropic parameter
text.format with strict: true
OpenAI parameter
20 per request
Strict tool limit (Claude)
Refusals and truncated replies
Breaks the schema
02At a glance

Claude and OpenAI side by side

Question

How to turn it on

Anthropic
output_config.format with type: "json_schema"
OpenAI
text.format with type: "json_schema" and "strict": true
Question

SDK helpers

Anthropic
client.messages.parse() with Pydantic in Python, zodOutputFormat() in TypeScript
OpenAI
Helpers that take Pydantic, Zod or Sorbet definitions
Question

Refusal signal

Anthropic
stop_reason: "refusal", status 200, tokens billed
OpenAI
A refusal item in the response
Question

Cut-off signal

Anthropic
stop_reason: "max_tokens"
OpenAI
An incomplete response, for example when max_output_tokens is reached
Question

Tool alternative

Anthropic
strict: true on a tool definition
OpenAI
Function calling, when the model needs to call your tools

OpenAI describes structured outputs as the evolution of JSON mode. JSON mode guarantees valid JSON but not that it matches a schema, and OpenAI recommends structured outputs where available.

04How it works

Check it in 2 minutes

  1. 01

    Send the example

    Use the request above with your API key. The reply text should be a JSON object with exactly the four keys.

  2. 02

    Read the stop reason

    Anything other than a normal end, such as refusal or max_tokens, means do not trust the shape.

  3. 03

    Test an enum

    If your schema has an enum, compare returned values case-insensitively, as Anthropic advises.

  4. 04

    Time the first call

    Anthropic says the first request with a new schema has extra latency while the grammar compiles.

Questions

Asked a lot.

1 questions people ask next, answered from the sources on this page.

01Is structured outputs the same as JSON mode?

No. OpenAI's docs say JSON mode guarantees valid JSON but not adherence to your schema, while structured outputs constrains the reply to the schema you supply. OpenAI recommends structured outputs whenever possible.

Sources · 2

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • claude.com
  • openai.com
  1. 01Structured outputs (Claude docs)platform.claude.com · checked 2026-11-01
  2. 02Structured outputs (OpenAI developer docs)developers.openai.com · checked 2026-11-01
Free · 2 minutes

Know the term. Now check your site.

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly