Streaming Interruption: Billing Clarification Needed

I have a question regarding the billing process for streaming responses in the OpenAI API. I’m hoping someone can provide some clarity on this matter.

What happens when a streaming response is interrupted. Specifically, if I interrupt the streaming by closing the API connection while the response is still being streamed, how does this affect the billing?

There are two scenarios I’m considering:

  1. Is the billing based on the complete message that would have been sent if the streaming wasn’t interrupted?
  2. Or is the billing only for the portion of the message that was actually streamed before the interruption occurred?

If anyone has experience with this or can point me to official documentation addressing this scenario, I would greatly appreciate it.