#How to calculate tokens

3 messages · Page 1 of 1 (latest)

next hinge
#

I've got a question about token usage. My latest request used this many tokens 645 prompt + 242 completion = 887 tokens When I count the characters in my promt myself, I get more characters than it calculated (1515). How does it calculate promt-characters? For example how does it handle empty spaces ect.?
additional question, when I set the max_tokens: does it include promt-tokens or is this only for comletion-tokens? I think it's for the whole request, promt+comnpletion, right?

sonic grove
next hinge