3 ms·
ELI5 What is a token? Is it a word, question, letter, what? If I ask a question like... What is the capital of Canada? And it responds with 'Ottawa', how many
by chirau 4y ago
ELI5 What is a token?
Is it a word, question, letter, what? If I ask a question like... What is the capital of Canada? And it responds with 'Ottawa', how many tokens have I used there and how are they calculated?
- andrewmunsell 4y agoRoughly speaking, words or word parts. Open AI has an explainer: https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them https://help.openai.com/en/articles/4936856-what-are-tokens-... You can also check your input using their tokenizer: https://platform.openai.com/tokenizer https://platform.openai.com/tokenizer So, your example is ~9 tokens
- chirau 4y agoSo does the response count towards the token count?
- andrewmunsell 4y agoIt does, yeah. It's tokens "processed", meaning request & response. The API response will give you a total token count so you can keep track
- teaearlgraycold 4y agoToken cost is prompt + response. In the case of ChatGPT you don't know the full prompt, but they don't charge by tokens for that app. In the API you need to tokenize your input and tokenize the output then add the counts together.