Then we cannot help you besides throw random things in the air and hope it sticks.At the very least you can provide your code that you use to structure the prompt.
I’m 99% certain that you are not correctly structuring the conversation, and having data “leak” through.
What you need to do is create the conversation object, and then run it through a library like tiktoken and see what it says.
I am happy for any thing what comes to your mind although it is random maybe. But I think it can help.
i dont use “conversations” or what do you mean by data “leak”? It is just the standard (single) message object with system prompt and user input message sent to OpenAI.
1: are you using images? They also consume tokens.
2: are you using chatbot software that provides the AI past turns of conversation? All the input of those messages of input is also “prompt tokens”.
3: are you actually using an o1 series reasoning model? They also consume tokens with internal generation.
4: are you providing system instructions? Are you providing tools? Those instructions and tool specifications also consume tokens.
I don’t understand. Can you explain? Btw I have to use structures output as this is necessary. How is this now related to the token count in the prompt (the response token count seems to be fine!)