Search code examples
tokenopenai-api

Does OpenAi count tokens in the answer too?


I started to read about OpenAi and the tokens, but I have one thing, that I didn't find.

If I make a request to OpenAi, does the answer count in the tokens too, or only the question?


Solution

  • When OpenAI GPT-3 is asked a question, you can hover over the token amount on the bottom right of the text box to see how many tokens your query has, and how many the expected response has. It combines these, and that becomes the amount of tokens used.

    OpenAI GPT-3 Tokens Sample

    So yes, it counts both the question and answer in the token count.