The chat completions messages are wrapped in a container of tokens along with the name of the role, and in addition, the AI is prompted with more tokens where it is supposed to write its answer.
That gives a token overhead of 7 tokens per first message, and 4 for each additional.
For more understanding, imagine that the % symbol represents special tokens (which you can’t send yourself) that are injected into AI language. An API call that tells the AI what it is and what the user wants would have this received by the AI model internally:
%system%You are TokenBot%%user%Say Hello%%assistant%