To stream from DeepInfra, pass stream true and parse the SSE events like OpenAI chunks. Do not look for usage on the delta chunks: token counts arrive on the final event alongside finish_reason, so read event.usage only when finish_reason is set. The same pattern holds in the Python SDK, the JS SDK, and raw curl.

Context: DeepInfra docs Streaming (deepinfra/docs chat/streaming.mdx): DeepInfra streams chat completions via server-sent events, the same protocol as OpenAI. Set stream: true on the request. The usage object arrives on the event carrying finish_reason, not on the content chunks; the examples read prompt_tokens and completion_tokens only when finish_reason is set.