In short.
Anthropic's Structured outputs guide teaches developers to build Claude applications that consume structured JSON, but schema guarantees have exceptions and do not establish factual accuracy. It documents output_config.format for responses and strict: true for tool inputs, with SDK examples and detailed schema restrictions. Important integration issues include refusals, truncated responses, enum capitalization and differences in SDK validation. The page also explains compilation latency, token overhead and qualified data-retention eligibility. Prices and measured performance are unknown; the examples were not executed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes the complete page at [https://platform.claude.com/docs/en/build-with-claude/structured-outputs.md], including its SDK examples, schema limitations, migration, compatibility, availability and data-handling notices. Linked pages, linked GitHub files, pricing tables, model catalogues and separate contractual terms are excluded. API behavior and SDK examples were not executed; performance, task accuracy, actual charges and deployment-specific eligibility remain unassessed.
The overview
Identity
Structured outputs is Anthropic's developer documentation for making Claude responses follow a defined data structure. Its original address is [https://platform.claude.com/docs/en/build-with-claude/structured-outputs.md], and its displayed documentation address is [https://platform.claude.com/docs/en/build-with-claude/structured-outputs].
The guide primarily covers JSON responses. It also explains how JSON outputs work alongside strict tool use, which constrains tool names and inputs, and links to separate documentation for that feature.
Assessment
This is a useful implementation reference for extraction pipelines, classification services and agents that need consistently shaped data. Its practical strength is the combination of request examples, language-specific SDK guidance and explicit failure cases.
It fits applications with a known output structure and a place to handle validation errors. The documentation does not establish extraction accuracy, end-to-end reliability or production latency, so those outcomes remain unassessed.
Users
Backend developers, data engineers and agent developers can use the guide to turn model responses into records their software can process. Its examples include contact extraction, invoices, feedback classification and API response formatting.
Beginners need familiarity with API requests, JSON and basic data types. Experienced developers get details about schema compilation, SDK transformations, caching, combined tool limits and migration from the older API parameter.
Capabilities
JSON outputs constrain Claude's direct response using output_config.format with type: json_schema. Strict tool use applies schema constraints to tool names and inputs through strict: true. Both features can be included in one request.
The page provides HTTP and CLI examples plus Python, TypeScript, C#, Go, Java, PHP and Ruby examples. SDK helpers can derive schemas from language types and return parsed objects, although their transformation and validation behavior differs.
Documented compatible features include streaming, batch processing and token counting. Streaming consumers must accumulate a complete JSON response before deserializing it; the Java example explains this through MessageAccumulator.
Using it
Requirements
An integration needs access to Claude through a supported platform, credentials and a schema within the supported JSON Schema subset. Direct HTTP examples use /v1/messages, an API key and anthropic-version: 2026-10-21. The example model is claude-opus-5-5.
The page lists stable support across Claude API, Amazon Bedrock, Claude Platform on AWS, both Anthropic-managed and Google-managed Claude on Google Cloud, and Microsoft Foundry. Its availability section says the Messages API supports all models on supported platforms and that Managed Agents is unavailable.
SDK helpers may require supporting schema libraries, such as Pydantic for the Python example or Zod for one TypeScript approach. General minimum SDK versions and account-specific model access are not established.
Mechanism
The API compiles a schema into a grammar that constrains generation. Claude returns JSON in a text content block, which an SDK helper or application parser converts into data. The JSON output grammar does not constrain tool results or thinking sections; strict tool inputs need their own strict schemas.
Most SDK helpers simplify unsupported constraints before sending them, adding those constraints to field descriptions. Helpers that validate responses then check the original constraints locally. Moving a numerical limit into a description does not make it an API-enforced limit.
The differences matter: TypeScript's jsonSchemaOutputFormat() does not validate responses against constraints removed during transformation. Java's class-based integration rejects unsupported schema keywords through local validation rather than transforming them.
Compiled grammars are cached for 24 hours since last use. Changing schema structure or the combined request's tool set invalidates that cache; changing only name or description fields does not.
Setup
Start with an object schema that lists its properties and required fields, and set additionalProperties: false on every object. Send it under output_config.format with type: json_schema. Read the response's stop_reason before treating its text as complete structured data.
In Python, the recommended helper is client.messages.parse() with a Pydantic model supplied as output_format. In TypeScript, zodOutputFormat() wraps a Zod schema; jsonSchemaOutputFormat() accepts a plain schema without Zod. Go's struct-derived schema helper is documented as beta, while a raw schema can use the stable Messages API.
Use explicit nested models when object keys are known. Python dictionaries and TypeScript records can produce schemas permitting only an empty object. For unknown keys, the guide recommends an array of objects containing key and value fields.
Example
The contact-extraction example supplies an email about John Smith, john@example.com, an Enterprise plan and a requested demo. Its schema requires three strings named name, email and plan_interest, plus a boolean named demo_requested, and disallows additional properties.
The illustrated response contains John Smith, john@example.com, Enterprise and true in those fields. Python returns a parsed Pydantic object, while TypeScript returns parsed_output through its parsing helper. These are documentation examples, not execution results from this report.
The schema controls the fields and their types. It does not independently demonstrate that a model will interpret every email correctly or handle missing information appropriately.
Assessment & evidence
Limitations
Unsupported schema features include recursion, oneOf, numerical bounds, string-length limits, arbitrary object keys and array constraints beyond minItems values of 0 or 1. Some schema compositions and complex regular expressions are also unsupported. Unsupported features sent directly to the API produce a 400 error.
A refusal can return HTTP 200 with stop_reason: refusal and text outside the requested schema. A max_tokens stop can leave incomplete JSON. String enum and const capitalization can differ from the schema even when a response completes normally, so exact enum matching still needs attention.
Combined request limits are 20 strict tools, 24 optional parameters and 16 parameters using union types across strict tool and JSON output schemas. Additional internal grammar limits can reject requests below those thresholds. Compilation has a 180-second timeout.
JSON outputs are incompatible with citations and message prefilling. Required properties appear before optional properties, preserving schema order within each group rather than necessarily preserving the entire original property order.
Reasoning
The feature addresses a concrete integration problem: malformed or inconsistently shaped model responses can break downstream software. Constraining the output structure can reduce that class of failure, subject to the exceptions the page documents.
Structural validity and factual correctness require separate assessment. A correctly typed invoice total is not evidence that it matches the invoice, and valid tool arguments do not establish that a tool choice is appropriate or that execution succeeds. Application checks should therefore cover task meaning as well as JSON structure.
Alternatives
The page describes ordinary prompting as an approach that can still produce malformed JSON, missing fields or inconsistent types, requiring validation and retries. It provides no measured comparison of that approach against constrained generation.
Choose JSON outputs for structured response text, strict tool use for function arguments, or both when an agent needs both forms of structure. These options address different parts of an application.
For extraction requiring citations for individual values, the page points to separate guidance at [https://platform.claude.com/docs/en/build-with-claude/citations#get-structured-data-with-citations]. That linked method and competing vendors' offerings are not assessed here.
Evidence
The evidence is Anthropic's complete Structured outputs documentation page, including examples, SDK notes, schema restrictions, migration guidance, availability and data-handling notices. It supports descriptions of documented behavior and intended integration patterns.
The page contains no independent benchmark, measured extraction-accuracy study or production reliability result. Its example outputs illustrate expected behavior. No code examples or API requests were executed, so runtime behavior remains unverified.
Access & freshness
Costs
Exact model rates, any separate feature charge and total deployment costs are unknown from this page. It states that an automatically added formatting system prompt increases billable input tokens. Refusal responses also incur charges for generated tokens despite potentially failing the requested schema.
A new schema adds grammar-compilation latency, but no measured timings are supplied. Changing output_config.format invalidates the conversation's prompt cache, which matters when estimating cached-token savings.
The page states that batch processing works with structured outputs at a 50 percent discount. Base prices and a worked cost estimate are not provided.
Rights
The page does not supply a redistribution licence for its documentation or code examples, or establish ownership and commercial-use terms for generated outputs. Those rights remain unknown from this source.
Zero data retention is marked qualified and excludes Covered Models, whose definitions and requirements are on a linked page. For eligible use, the documentation says prompts and outputs are not stored, while JSON schemas are cached for up to 24 hours since last use. The same qualification covers strict tool use.
The feature is described as HIPAA eligible, but protected health information must not appear in schema property names, enum values, const values or regular-expression patterns. The page directs such information to message content because cached schemas receive different protections.
Freshness
The documentation was captured on 25 November 2026. It marks structured outputs stable and uses anthropic-version: 2026-10-21 in HTTP examples. No publication or last-updated date is supplied.
The migration notice replaces the older API output_format parameter with output_config.format and removes the normal beta-header requirement. The older parameter requires the structured-outputs-2025-11-13 beta header. Python's Pydantic output_format argument to parse() or stream() remains supported because the SDK translates it to output_config.
Availability and SDK behavior after the capture date are unknown.
Actions
For an initial integration, use a small fixed schema and a helper whose validation behavior matches your needs. Add explicit handling for refusals, token truncation, schema errors and local validation failures before passing results downstream.
Avoid enum values distinguished only by capitalization, and decide whether case-insensitive comparison fits the application's rules. Check extracted values against source material or business rules where correctness matters.
Before deployment, verify model access, current SDK behavior, actual token costs and latency with representative requests. Check the applicable retention requirements if schemas or messages involve sensitive data, and keep protected health information out of schema definitions.
