Per-message effort
Use a system message to change the effort level partway through a conversation and keep the prompt cache.
A per-message effort change sets a new effort level for later turns of a conversation without changing the request’s top-level value, so the cached prefix still matches.
Change the effort level
To change the level partway through a conversation:
- Add a
role: "system"message tomessages, with emptycontentand the new effort level inoutput_config.effort. - Send the
mid-conversation-output-config-2026-07-01beta header. - Leave the top-level value unchanged.
The following example keeps the top-level value at high and drops to low for a routine follow-up:
client = anthropic.Anthropic()
response = client.beta.messages.create(
model="claude-fable-5-1",
max_tokens=4096,
output_config={"effort": "high"},
messages=[
{
"role": "user",
"content": "Plan a migration from SQLite to PostgreSQL in three short steps.",
},
{
"role": "assistant",
"content": "1. Export the SQLite data. 2. Create the PostgreSQL schema. 3. Import the data and verify row counts.",
},
# Effort-only system message: the new level takes effect from the next user turn.
{"role": "system", "content": [], "output_config": {"effort": "low"}},
{"role": "user", "content": "Summarize the plan in one sentence."},
],
betas=["mid-conversation-output-config-2026-07-01"],
)
for block in response.content:
if block.type == "text":
print(block.text)The message’s position decides when the new level starts:
- Directly after a
userturn with new input: Claude’s reply to that turn uses the new level. - In any other position, such as between an
assistantturn and the nextuserturn as in the preceding example: the new level starts at the nextuserturn with new input.
A user turn that holds only tool_result blocks doesn’t count as new input.
The new level stays in effect until a later message changes it.
Put the message after everything you’ve already sent, and keep it in place on later requests. Don’t insert it before turns you’ve already sent, and don’t move or remove it later. On models with preserved thinking, any of those changes invalidates the thinking blocks in the assistant turns after the message. What the API does with an invalid block says what happens next.
If it sits next to a system message that has content, both messages must follow the placement rules for mid-conversation system messages.
With the Amazon Bedrock InvokeModel API, send the beta value in the anthropic_beta array of the request body instead of the header. For the models that support per-message effort there, see Mid-conversation system messages on Bedrock.
Errors
- Without the beta header, a per-message
output_configreturns a 400 error:messages.N.output_config: Extra inputs are not permitted, whereNis the index of thesystemmessage inmessages. - With the beta header, models without per-message effort, such as Claude Fable 5, return a 400 error:
output_config.effort requires a model that supports per-turn effort; this model does not. On Amazon Bedrock, those models and Claude Opus 5 returnExtra inputs are not permittedinstead. - On Claude Sonnet 5.5 with
thinking: {"type": "between_tools"}, and on Claude Haiku 5.5 withthinking: {"type": "disabled"}, you can’t change the effort level mid-conversation. There, a per-messageoutput_config.effortwith a new level returns a 400 error. To vary effort for each turn, use adaptive thinking.
Per-message or top-level effort
Prefer per-message effort over changing the top-level value between requests. A per-message change leaves everything before it unchanged, so the cached prefix still matches. A top-level change restarts the cache. On Claude Fable 5.1, a top-level change also steers the model less reliably. The model’s earlier replies were written at the previous level, and the model tends to stay consistent with them.
Availability
Claude API
- Status
- Beta
- APIs
- Messages API
- Managed Agents Not supported
- Beta header
- Requires
- Models
- Claude Fable 5.2, Fable 5.1
- Claude Mythos 5.2, Mythos 5.1
- Claude Opus 5.5, Opus 5
- Claude Sonnet 5.5
- Claude Haiku 5.5
Amazon Bedrock
- Status
- Beta
- API
- Messages API
- Beta header
- Requires
- Models
- Claude Fable 5.1
- Claude Mythos 5.1
- Claude Opus 5.5
Amazon Bedrock (bedrock-runtime)
- Status
- Beta
- API
- Messages API
- Beta header
- Requires
- Models
- Claude Fable 5.2, Fable 5.1
- Claude Mythos 5.2
- Claude Opus 5.5
- Note
Send the beta value in the
anthropic_betaarray of the request body.
Claude Platform on AWS
- Status
- Beta
- APIs
- Messages API
- Managed Agents Not supported
- Beta header
- Requires
- Models
- Claude Fable 5.2, Fable 5.1
- Claude Opus 5.5, Opus 5
- Claude Sonnet 5.5
- Claude Haiku 5.5
Claude Models on Google Cloud (Anthropic managed)
- Status
- Beta
- APIs
- Messages API
- Managed Agents Not supported
- Beta header
- Requires
- Models
- Claude Fable 5.2, Fable 5.1
- Claude Mythos 5.2
- Claude Opus 5.5, Opus 5
- Claude Sonnet 5.5
- Claude Haiku 5.5
Claude Models on Google Cloud (Google managed)
- Status
- Beta
- API
- Messages API
- Beta header
- Requires
- Models
- Claude Fable 5.2, Fable 5.1
- Claude Mythos 5.2, Mythos 5.1
- Claude Opus 5.5, Opus 5
- Claude Sonnet 5.5
- Claude Haiku 5.5
Microsoft Foundry (hosted on Azure)
- Status
- Beta
- API
- Messages API
- Beta header
- Requires
- Models
- Claude Opus 5.5, Opus 5
- Claude Sonnet 5.5
- Claude Haiku 5.5
Microsoft Foundry (hosted on Anthropic)
- Status
- Beta
- API
- Messages API
- Beta header
- Requires
- Models
- Claude Fable 5.2, Fable 5.1
- Claude Mythos 5.2, Mythos 5.1
- Claude Opus 5.5, Opus 5
- Claude Sonnet 5.5
- Claude Haiku 5.5
Was this page helpful?