Token Estimation before documents index generation

how to get tokens used estimation before indexing is run.
I need the total token utilization before the index are generated

What indexing? What language are you coding in? What are you trying to accomplish?

We need more info, please.

Creating the custom bot based on document
first wee need to create index.json using gptindex of lliamaindex
next thing is to get save and load is there any way that we can stimate the cost or token used before performing indexng