PRODUCTION SCENARIO
An API integration needs Claude to return machine-parseable JSON on every response, with no preamble and no code fences. It gets that today by prefilling the assistant turn with an opening brace. On Claude Opus 5 the request now 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 to constrain the response to a JSON schema
Prefilled assistant messages on the last turn stopped being supported with the Claude 4.6 generation and return a 400, and structured outputs is the documented replacement because it constrains every response to a schema. A stop sequence ends generation when a string appears rather than starting a reply with one. Assistant messages elsewhere in the conversation really are still accepted, but one that is not on the last turn does not constrain the final reply. And pinning to a pre-4.6 model does keep prefill working, at the price of freezing the integration on a model heading for retirement.