Error about token length, max token

When using o3-mini, I often encounter situations where the returned content is empty or truncated. Truncated content can be understood as a token length problem, but why is the content empty? Today, I encountered a situation where gpt-4o returned “max_tokens is too large: 20000. This model supports at most 16384 completion tokens, whereas you provided 20000”, not 128K

and what is the difference between context window and max output tokens.