Skip to main content
When you call the Messages endpoint, each response includes a stop_reason that explains why the model stopped. Handling this field correctly is key to building reliable apps. For details about stop_reason in the response schema, see Messages.

What is stop_reason?

stop_reason is present on every successful response. It doesn’t mean there was an error—it tells you how the model completed its response. Example response (truncated):

Stop reason values

When a request fails, the stop reason matches one of the error values below and the response is returned as an error envelope.