A Claude API response returns stop_reason: 'end_turn'. What does this indicate?
Select an answer to reveal the explanation.
Short Explanation
When you see 'end_turn', Claude finished naturally — it said what it had to say and stopped. That's the happy path. If you see 'max_tokens' or a stop sequence, that's a different stop reason.
Full Explanation
The stop_reason field indicates why generation stopped. 'end_turn' is the normal completion — Claude naturally finished its response without hitting any limits. 'max_tokens' means generation was cut off at the token limit, so the response may be incomplete. 'stop_sequence' means one of the specified stop_sequences was generated and triggered a stop. 'tool_use' means Claude is requesting a tool call. Checking stop_reason is important in production to detect truncated responses from max_tokens and handle them appropriately versus complete responses from end_turn. The choice saying Claude ran out of time and the response was cut short describes a truncated response, not natural completion. The choice saying the maximum token limit was reached before Claude finished describes max_tokens. The choice saying a stop sequence was triggered and generation halted describes stop_sequence. Those other choices describe different stop reasons.