PRODUCTION SCENARIO
A research tool sends document blocks with citations enabled and also sets output_config.format to a JSON schema so the answer parses cleanly. Every request now fails with a 400 error.
What explains the failure?
Answering here is anonymous. Nothing is saved unless you sign in.
Show answer and explanation
Answer: Citations and structured outputs cannot both be enabled on the same request
Enabling citations on a user-provided document together with output_config.format returns a 400, because citations interleave citation blocks with the text and that conflicts with the strict JSON schema constraints of structured outputs. Citations are not schema fields, so declaring a citations property changes nothing. Citations are generally available on all active models and take no beta header. A document too large returns a size error, not a 400 on every request regardless of length.
Official Source: https://platform.claude.com/docs/en/build-with-claude/citations ↗