Text Generation: I'm struggling with Output Consistency

Well in your case, it wouldn’t cost more, because it seems you aren’t giving a chatbot its conversation history, you are just making individual calls:

    messages=
      [systemMessageWhole] + userMessages

Here’s a little demo of a chatbot loop, providing some turns of conversation history to talk to an AI as the prompt seems to describe.

messages = system + chat[-10:] + user