Reference · GlossaryMax tokensAn API setting that caps **how long the model's reply** can be — measured in tokens, not words.On this pageWhen to useWhen not toExample#When to useControl cost, prevent rambling answers, or enforce concise formats ("max 150 tokens").#When not toSetting max tokens too low cuts off mid-sentence. Leave headroom for complete answers.#ExampleCopy{ "max_tokens": 256 }Rough guide: 100 tokens ≈ 75 words of English prose.Learn by doing → Learn by doing →Related termsTokenContext windowLLM← All terms