ChatGPT Chatbot using too many Tokens

I’ve created a ChatGPT Chatbot and deployed it on Huggingface. When I use the Chatbot using the Interface it uses a moderate amount of tokens, but when I access it through the API, it uses a lot of tokens and also restarts the space frequently.