A Claude API response returns stop_reason: 'end_turn'. What does this indicate?
Select an answer to reveal the explanation.
Short Explanation and Infographic
'end_turn' means Claude finished naturally — it said what it had to say and stopped. It's the happy path. 'max_tokens' means truncated; 'stop_sequence' means a delimiter triggered.
Full explanation below image
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 (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 (max_tokens) and handle them appropriately vs. complete responses (end_turn). Options A, C, and D all describe different stop reasons.