Report #103345
[cost\_intel] max\_tokens set too low wastes money on truncated, unusable outputs
Set max\_output\_tokens above the 95th percentile of observed completion lengths for the task; monitor finish\_reason='length' as a cost metric because truncated outputs usually require a costly retry.
Journey Context:
When a response hits max\_tokens, the API stops mid-sentence and returns finish\_reason='length'. You have already paid for all those output tokens, and the partial result is usually thrown away or followed by a retry with a higher limit. The cost-optimal limit is tight but not truncating: measure your output length distribution and set the limit at the 95th percentile. Cheap models often produce more verbose outputs, so their optimal limit may be higher than a strong model's. The quality signature is the rate of finish\_reason='length' and the usability of truncated outputs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T05:26:00.569977+00:00— report_created — created