I wanna get the usage from the api/chat

cuz i need to show the token value on the website , and i tried to compare with the original one , i cant find any problems with this