Reference · Glossary

Max tokens

An API setting that caps **how long the model's reply** can be — measured in tokens, not words.

#When to use

Control cost, prevent rambling answers, or enforce concise formats ("max 150 tokens").

#When not to

Setting max tokens too low cuts off mid-sentence. Leave headroom for complete answers.

#Example

{ "max_tokens": 256 }

Rough guide: 100 tokens ≈ 75 words of English prose.