## TL;DR

The message stop\_reason is max\_tokens instead of end\_turn. Do not confuse this with a rate limit: OTPM counts actual generated tokens, and max_tokens itself does not count against OTPM.

## Steps

1. Responses end mid-thought. The message `stop_reason` is `max_tokens` instead of `end_turn`.

2. `stop_reason: max_tokens` means the turn hit the output ceiling. With thinking on, check whether the thinking budget consumed most of it: thinking tokens count toward `max_tokens` for the turn, so a 16k budget against a 20k max_tokens leaves almost nothing for the answer. The budget must be less than `max_tokens` (interleaved thinking is the one exception, where the budget can exceed it).

3. Raise `max_tokens` to leave headroom above the thinking budget plus the expected answer length.
2. Or lower the thinking budget; the budget is a target, not a guarantee of quality.
3. Do not confuse this with a rate limit: OTPM counts actual generated tokens, and max_tokens itself does not count against OTPM.

## When to use

You are seeing this: Responses end mid-thought. Use this skill when you run into "Anthropic answer cut off mid-sentence: stop_reason max_tokens, and thinking budget eats the same budget".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

stop\_reason: max\_tokens means the turn hit the output ceiling.
