# Stop sequence

Canonical page: https://www.theglitch.ai/ai-glossary/stop-sequence

Text that tells the model to stop generating as soon as it appears.

[Stop sequence, common card \#211 in The Glitch AI glossary: Text that tells the model to stop generating as soon as it appears.](https://www.theglitch.ai/images/cards/glossary/stop-sequence.png?v=facb40cd92134a5b)

GLS 211 · common

For: Builders

## Why it matters

Handy for keeping outputs to one item, one field or one turn.

## In practice

Generation stops at “\#\#\#” so only the first section comes back.

## Watch for

If the stop text also appears inside a valid answer, you will cut it short.

## Related terms

[Max tokens](https://www.theglitch.ai/ai-glossary/max-tokens) · [Structured output](https://www.theglitch.ai/ai-glossary/structured-output)

## Sources

- [Anthropic docs: Messages API](https://docs.anthropic.com/en/api/messages)

Definition updated 2026-10-29.

[The Ultimate AI Glossary (2027): every term](https://www.theglitch.ai/ai-glossary)

---

Site: [The Glitch](https://www.theglitch.ai) · [About Rabin](https://www.theglitch.ai/about) · [Agent guide](https://www.theglitch.ai/agent.md)
