How to calculate Max_Token in chatCompletion?

Hello everyone, I am making the chatbot that has huge system prompt. And I need to get response with huge token. The max token of gpt-4 is about 8192. Please help me if someone has an experience with it.
Is that best way to calculate the available max_token?

Please clarify what you mean by huge.