'How do I know how much tokens a GPT-3 request used?

I am building an app around GPT-3, and I would like to know how much tokens every request I make uses. Is this possible and how ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source