PRODUCTION SCENARIO
Your classification service prefills the assistant turn with an opening brace to force JSON, and it has worked for two years. After the move to Claude Sonnet 4.6, every request returns a 400 error.
What should replace the prefill?
Answering here is anonymous. Nothing is saved unless you sign in.
Show answer and explanation
Answer: Use structured outputs with a JSON schema in output_config.format instead of the prefill
From Claude 4.6 onward, a prefilled assistant message on the last turn returns a 400, and the migration for format-forcing prefills is structured outputs, which constrain the whole response to a schema. For classification specifically, a tool with an enum field holding the valid labels is the other supported route.