Evaluation, Testing & Quality

Prefill Deprecation: Which Models Are Affected and What Replaces It

If your integration sends a partial assistant message to steer Claude's output, upgrading to a current model turns that request into a 400 error. Here is the exact model list and the two documented replacements.

Claude 3P 101 · Updated July 2026 · Unofficial guide

Prefilling was one of the oldest tricks in the Claude playbook: include a final assistant-role message in your request containing the first characters of the answer you want — an opening brace, an XML tag, a "Here is the JSON:" — and the model continues from there. It was a cheap way to skip preamble and lock in a format. On current-generation models, it no longer works, and knowing exactly which models reject it is the difference between a planned migration and a production incident.

The affected model list

Anthropic's "Increase output consistency" page carries the note verbatim: "Prefilling is not supported on Claude Fable 5, Claude Mythos 5, Claude Mythos Preview, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, and Claude Sonnet 4.6. Use structured outputs on models that support it, or system prompt instructions, instead." The migration guide adds Claude Sonnet 5 to the picture — assistant prefilling "still returns 400" on it, as it did on Sonnet 4.6.

Prefill rejected (400 error)Prefill still works
Claude Fable 5, Mythos 5, Mythos Preview, Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 5, Sonnet 4.6 Older generations, e.g. Claude Haiku 4.5, Sonnet 4.5, Opus 4.5

The pattern is generational: every model from the 4.6 generation onward rejects prefill, while the 4.5-and-earlier generation still accepts it. The failure mode is loud, not silent — the migration guide for Opus 4.6 → 4.7 lists it plainly: "Assistant message prefilling returns 400." Your request errors; it does not quietly ignore the prefill. That makes affected code easy to find in staging: run your suite against the new model ID and grep the errors.

Why it was removed

Anthropic's public documentation does not spell out a detailed rationale — the docs state the restriction and the replacements rather than the reasoning. The shift does track two visible platform changes, though. First, current models handle reasoning differently: adaptive thinking is on by default (Sonnet 5) or always on (Fable 5), and a hand-written prefix on the assistant turn sits awkwardly in front of a turn the model begins with its own reasoning. Second, the job prefill did best — format enforcement — now has a purpose-built feature that does it with actual guarantees. Treat any deeper explanation you read elsewhere as speculation, and check the official docs for updates.

Replacement 1: structured outputs

For the classic prefill use case — forcing valid JSON — the documented replacement is structured outputs (configured via output_config.format per the migration guide). You provide a schema; the platform constrains generation to match. Unlike prefill, which merely biased the model toward a format, structured outputs are enforced. They are generally available on the first-party API, Claude Platform on AWS, Amazon Bedrock, and Vertex AI, and in beta on Microsoft Foundry. Details in the structured outputs article.

Replacement 2: system-prompt format instructions

For everything else — response templates, tag structures, "no preamble" rules, persona consistency — the documented replacement is explicit format instructions in the system prompt, reinforced with few-shot examples where the format is fiddly. Current models follow literal format instructions closely, and the consistency docs' remaining techniques (examples, retrieval grounding, prompt chaining) all still apply. The full playbook is in output consistency without prefill.

Migration checklist for prefill users

The migration guide's code-path review includes removing assistant-message prefills alongside its other checks. Concretely: search your codebase for requests whose messages array ends with an assistant role; decide per call site whether the intent was format enforcement (move to structured outputs) or style steering (move to system-prompt instructions); and add a format assertion to your eval suite so the replacement's behavior is verified, not assumed. If you use Claude Code, the migration guide notes that /claude-api migrate applies prefill replacement among its automated fixes — with a manual verification checklist afterward.

Where to go next

Fold this into the broader model migration regression checklist, and see output format control for prompt-level format patterns.

Sources