max_tokens and Truncated Responses: Why Answers Get Cut Off
If an LLM answer ends mid-sentence, the model almost certainly hit your max_tokens limit. The response will show stop_reason equal to max_tokens . The fix is to raise the limit, ask for a shorter answer, or continue the generation in a second call. What max_to...