If we stop streaming output stream before it finishes, do we still get billed for the tokens that weren't ouputted?

My NodeJS code is like so:

const payload = {
    model: 'gpt-3.5-turbo',
    messages: [{ "role": "user", "content": "output 1000 tokens" }],
    max_tokens: 1000,
    stream: true,

const stream = await openaiClient.chat.completions.create(payload);
let chunksGot = 0;
for await (const chunk of stream) {
  if (chunksGot > 100) {
  let choice = chunk.choices[0];
  if (choice?.finish_reason) {
  // do something with choice.delta.content

// Abort connection

My question is: as I have aborted the connected after receiving ~100 tokens, do I still get billed for the remaining ~900 tokens in the incoming output (that I never received)?

Why not just set max_tokens to 100 and that way it will always only spit out 100? Than no way to be overcharged

The context here is that the user can close my website’s browser tab while my backend was still returning responses. The 100 tokens in my post is just an example - in practice, the user can close the tab whenever they wish to. In that case, I need cancel the output stream if I can reduce the bill. Hence my question above.