ChatGPT's "Stop Generating" function - how to implement?

So if it’s in streaming mode, I understand that I only need to pay for the cost of the tokens I received, right?