I tried to calculate the prompt tokens used for my requests, but when i calculate it i get a different number than reported by the API.
The API reports 29 prompt tokens and i calculated 17
[
{
role: 'system',
content: 'You are a useful chatbot called ChatGPT.'
},
{ role: 'user', content: 'write me a poem about cookies' }
]
These are the messages.
The system message has 11 tokens
The user message has 6 tokens
Resulting in 17