Definition
What is stop_reason? — Plain-Language AI Definition
The field in a Claude API response that indicates why the model stopped generating, used to control agentic loop flow.
What is stop_reason?
stop_reason is a field returned in every Claude API response. It tells your code why the model stopped generating text. The two most important values are end_turn (the model is done) and tool_use (the model wants to call a tool).
Key Values
- end_turn -- The model has finished its response
- tool_use -- The model wants to call one or more tools
- max_tokens -- The response was cut off because it hit the token limit
- stop_sequence -- The model hit a custom stop sequence
Key Takeaway
stop_reason is the control signal for agentic loops. Check it after every API call.
Learn This in Practice
Move from definition to application with guides and resources that show how this concept appears in real AI workflows.
Article
Anthropic Just Launched Its First Certification: Here's What You Need to Know
Anthropic's new Claude Certified Architect — Foundations (CCA-F) exam is the first vendor certification for building with Claude. Here is everything you need to know about the format, domains, and how to prepare.
Article
CCA-F Study Guide: Domain-by-Domain Breakdown
A complete domain-by-domain breakdown of the CCA-F exam.
Article
5 Anti-Patterns That Will Cost You Marks on the CCA-F Exam
Five common mistakes that trip up CCA-F exam candidates.
Tutorial
How Engineers Should Really Work with AI in 2026
A practical guide to the modern engineer-AI workflow: scoping, context, tests, review, evals, and when to slow down instead of automating more.
Get AI Tips Every Week
Get smarter about AI every week — practical tips, prompts, and workflows in your inbox.