How exactly do you get charged for using the API for assistants?

Assume I am really stupid, but only just read all the documentation and API reference.

https://platform.openai.com/docs/api-reference/messages/modifyMessage

How do I simulate what locally is just system + chat[-turns*2:] + user to pass the number of turns that fit in my token budget?

No need to answer hastily, I’ll give you all the time you need.

Then we have the utility of “answer not ready yet, still looping calling your API endlessly with the same thing”.