stop_sequences

API

Definition

An API parameter that provides a list of strings that, when encountered in the response, cause Claude to stop generating immediately. The matched string is not included in the response. Useful for enforcing structured output boundaries or workflow step delimiters.

Example Usage

Use stop_sequences: ['</answer>'] to ensure Claude stops after producing the answer block in a structured format.