Azure openai bring your own data token count

Sariga Rahul 146 Reputation points
2023-06-29T13:28:27.64+00:00

How can I get the number of tokens used in the request for Azure OpenAI API when bringing my own data? The response from the API for default data includes the token count in the format shown below, but I am unable to find a way to retrieve the token count for my own data:

"usage": {
        "completion_tokens": 241,
        "prompt_tokens": 211,
        "total_tokens": 452
    }


Any guidance on how to retrieve this information would be greatly appreciated.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,081 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.