Claude API Drops JSON Prefill Support; Developers Must Switch to Structured Outputs or Tool Use
Anthropic's Claude models from Opus 4.6 onward no longer support last-assistant-turn prefilling, a common technique developers used to force JSON output, now returning a 400 error. The recommended replacement for enforcing a JSON schema is the output_config.format parameter, which validates responses against a defined schema automatically and integrates with Zod for type safety in TypeScript. Alternatively, developers can use tool use with strict mode enabled when the structured data represents arguments for an action rather than a direct answer. The key distinction is whether JSON is the final output to be consumed directly, favoring structured outputs, or an intermediate step passed to another operation, favoring tool use. Developers who have not yet updated their code risk breakage as soon as they upgrade their model version string.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in