How does the count_tokens method charge?

I want to use the count_tokens method, for example:
print("total_tokens: ", model.count_tokens(prompt))
But I haven’t found anything specifically talking about the billing system for this type of call. Does it have the same input cost to generate a response?

I want to count tokens from small messages, but from several at different times; I will never send more than one at a time. I will use this information to control the size of the chat history.

So could you tell me, how exactly does the billing system of the count_tokens method work?

2 Likes

welcome to the forums!

The count_tokens method incurs no charge.

2 Likes

How wonderful! Thank you for your return and welcome!