Estimating cost to build chatbot using GPT 3/4 OpenAI APIs on our documentation data

We have documentation content that we want to use to build a support chatbot for our users using OpenAI APIs. How can we understand approximate cost for each query when initiated by our users?

You can limit the tokens used by each query and then apply the price per token to that number.