Discussions
Checking Input Token Size Before API Call
about 2 months ago by Murali Anand
I want to verify whether my input token size exceeds the model’s limit. Is there a built-in function to calculate token length without making an API call and incurring costs? If using tiktoken is the only option, which encoding should I use?