structured-outputs changedbuild-with-claude/structured-outputs
Recorded here
Lines+44added
Lines−15removed
From line
5
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits27to this page, all time
## Availability ### API support #### [Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages) #### [Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview) ### Data handling ## Data retention
The whole hunk
from line 5, old and new numbered
/
from line 5
55featureMetadata:
66 status: ga
77 zdr:
8 eligibility: eligible
9 note: Excludes [Covered Models](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention#model-specific-data-retention-requirements).
8 eligibility: qualified
9 note: "Excludes [Covered Models](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention#model-specific-data-retention-requirements). Your prompts and Claude's outputs are not stored. Only the JSON schema is cached, for up to 24 hours since last use. This also covers strict tool use (`strict: true` on tools), which uses the same grammar pipeline."
1010 supportedModels:
1111 - claude-fable-5-1
1212 - claude-mythos-5-1
from line 15
1515 - claude-mythos-preview
1616 - claude-opus-5-5
1717 - claude-opus-5
18 - claude-sonnet-5-5
19 - claude-sonnet-5
20 - claude-haiku-5-5
21 - claude-haiku-4-5-20251001
1822 - claude-opus-4-8
1923 - claude-opus-4-7
2024 - claude-opus-4-6
21 - claude-sonnet-5-5
22 - claude-sonnet-5
2325 - claude-sonnet-4-6
24 - claude-sonnet-4-5-20250929
2526 - claude-opus-4-5-20251101
26 - claude-haiku-5-5
27 - claude-haiku-4-5-20251001
27 - claude-sonnet-4-5-20250929
2828 supportedPlatforms:
2929 Claude API: ga
3030 Claude Platform on AWS: ga
31 Claude Models on Google Cloud (Anthropic managed): ga
3132 Amazon Bedrock: ga
33 Amazon Bedrock (InvokeModel): ga
3234 Claude Models on Google Cloud (Google managed): ga
3335 Microsoft Foundry: ga
3436---
from line 2787
27852787
27862788The Python SDK (v1.0 and later) does not accept `output_format={...}` on `client.beta.messages.create()` or `count_tokens()` and raises a `TypeError`. Use `output_config` instead. See [Using a raw JSON schema](https://platform.claude.com/docs/en/build-with-claude/structured-outputs#using-a-raw-json-schema) for the updated API shape.
27872789
2788## Data retention
2789
2790Prompts and responses are processed with ZDR when using structured outputs. However, the JSON schema itself is temporarily cached for up to 24 hours since last use for optimization purposes. No prompt or response data is retained beyond the API response.
2791
2792Structured outputs are HIPAA eligible, but **PHI must not be included in JSON schema definitions**. The API compiles JSON schemas into grammars that are cached separately from message content, and these cached schemas do not receive the same PHI protections as prompts and responses. Do not include PHI in schema property names, `enum` values, `const` values, or `pattern` regular expressions. PHI should only appear in message content (prompts and responses), where it is protected under HIPAA safeguards.
2793
2794For ZDR and HIPAA eligibility across all features, see [API and data retention](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention).
2795
27962790## Feature compatibility
27972791
27982792**Works with:**
from line 2804
28102804<Tip>
28112805 **Grammar scope:** Grammars apply only to Claude’s direct output, not to tool use calls, tool results, or thinking tags (when using [thinking](https://platform.claude.com/docs/en/build-with-claude/thinking)). Grammar state resets between sections, allowing Claude to think freely while still producing structured output in the final response.
28122806</Tip>
2807
2808## Availability
2809
2810Structured outputs are available on every model and eligible for HIPAA readiness.
2811
2812### API support
2813
2814#### [Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages)
2815
2816* Availability: Available
2817
2818| Status | Cloud platforms | Models |
2819| --------- | ----------------------- | ----------------------------------------------------------------- |
2820| Available | All supported platforms | [All models](https://platform.claude.com/docs/en/models/overview) |
2821
2822#### [Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview)
2823
2824* Availability: Not available
2825
2826### Data handling
2827
2828[Data handling overview](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention#feature-eligibility)
2829
2830| Item | Zero data retention | HIPAA |
2831| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
2832| Status | Eligible (qualified; excludes [Covered Models](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention#model-specific-data-retention-requirements)) | Eligible |
2833| Details | Your prompts and Claude’s outputs are not stored. Only the JSON schema is cached, for up to 24 hours since last use. This also covers strict tool use (`strict: true` on tools), which uses the same grammar pipeline. [Learn more](https://platform.claude.com/docs/en/build-with-claude/structured-outputs#data-retention) | PHI must not be included in JSON schema definitions; see PHI handling guidelines. [Learn more](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention#phi-handling-guidelines) |
2834
2835Applicable endpoints:
2836
2837* `/v1/messages`
2838
2839Prompts and responses are processed with ZDR when using structured outputs. However, the JSON schema itself is temporarily cached for up to 24 hours since last use for optimization purposes. No prompt or response data is retained beyond the API response.
2840
2841Structured outputs are HIPAA eligible, but **PHI must not be included in JSON schema definitions**. The API compiles JSON schemas into grammars that are cached separately from message content, and these cached schemas do not receive the same PHI protections as prompts and responses. Do not include PHI in schema property names, `enum` values, `const` values, or `pattern` regular expressions. PHI should only appear in message content (prompts and responses), where it is protected under HIPAA safeguards.
28132842
28142843## Next steps
28152844
No line in this hunk matches that.