How does the chatgpt api count tokens?



I don’t know how to accurately calculate the tokens needed for each question