Inference APIs

Does streaming include token usage?

Yes. With stream: true the final chunk before data: [DONE] carries a usage object with prompt and completion token counts, so you can meter streamed responses without counting tokens yourself.

Related

More questions