The model maximum is the wrong default
Setting max_tokens to the model maximum "to be safe" reserves context window you could have retrieved into, and on providers that count the ceiling against your rate limit it consumes quota you never use.
Deriving it from the 95th percentile of your observed answer lengths with a margin gives you the same safety at a fraction of the cost.
Handle the stop reason
A response truncated at the ceiling is not an error. If you do not check the stop reason, a cut-off answer reaches your user mid-sentence and nothing in your logs says why.
Checking it is a few lines and turns a silent product defect into a handled case.