https://platform.claude.com/docs/en/build-with-claude/handling-stop-reasons
https://www.youtube.com/watch?v=ldqOnljDINc
When calling the Claude Messages API, the stop_reason field in a successful (http 200) response explains why the model finished generating.
You should evaluate this field to determine your next step: accepting the response, continuing the conversation, retrying, or falling back to an alternative model. Note that this field is completely omitted if the request encounters an API error or processing failure.
end_turn
- ok