
Amazon Bedrock Adds Structured Outputs for Anthropic Claude Models
Amazon Bedrock now supports structured outputs for all Anthropic Claude models on both bedrock-runtime and bedrock-mantle endpoints, delivering schema-compliant JSON without custom parsing or retry logic.
What's New
Amazon Bedrock now supports structured outputs for all Anthropic Claude models on both the bedrock-runtime and bedrock-mantle endpoints. Developers can receive schema-compliant JSON responses that conform to a defined structure without custom parsing, retry logic, or post-processing.
Two complementary mechanisms are available: JSON Schema output format for controlling response structure in data extraction and report generation, and strict tool use for validating tool parameters in agentic workflows and multi-step automation.
How It Works
Structured outputs use constrained decoding to enforce JSON schemas during token generation rather than after the fact. Amazon Bedrock validates schemas against the JSON Schema Draft 2020-12 subset, compiles a grammar artifact for new schemas, and caches compiled grammars for 24 hours scoped to the account. Changing schema structure invalidates the cache, while changing only name or description fields leaves it intact.
The feature works with batch inference, cross-Region inference on bedrock-runtime, and supports streaming structured responses as typed events.
Use Cases and Examples
Practical applications include extracting fields from financial reports and compliance documents, parsing clinical notes into EHR systems, analyzing contracts, and routing support tickets. An example using the InvokeModel API with Claude Sonnet 5.5 demonstrates extracting lead data from a customer email into validated JSON fields.
Strict tool use on bedrock-mantle ensures tool parameters match input schemas exactly. Setting strict to true constrains tool inputs so the model cannot add fields outside the schema, which is valuable for agentic workflows with server-side tools.
Requirements and Best Practices
Developers must set additionalProperties to false on all objects. Best practices include using descriptive field names, applying enum for constrained values, starting with basic schemas, reusing schemas to benefit from caching, checking stop reasons in every response, and testing with realistic data before deployment.
Supported features include basic types, enum, const, anyOf, allOf with limitations, internal references, and various string formats. Recursive schemas, external references, and numerical or string constraints are not enforced during generation.
Structured outputs for Claude on Amazon Bedrock is now generally available.
Sources: AWS Machine Learning Blog
SiTech — AI-powered web development
We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.