openai/openai-realtime-api-beta

How to know the input token count in the context including the tools for each call?

Opened this issue · 1 comments

Is there a way to know the exact/rough token count including the tools?

Yes there is each response.done has the info. https://platform.openai.com/docs/api-reference/realtime-server-events/response/done.
The event can be of type message or function_call. In the usage object you find the detailed information