Stop Waiting on JSON: Stream Structured Output with One Schema Tanstack has released a new `useChat({ outputSchema })` feature that eliminates the need for manual JSON parsing and type casting when streaming structured output from large language models. The update allows developers to pass a single schema to the hook and receive typed partial and final objects directly, removing the boilerplate code previously required for handling streaming JSON responses. The feature works across multiple providers including OpenAI, OpenRouter, Grok, Groq, and Ollama, and includes improved type safety for structured output streams, tagged event variants, and per-chunk debug logging. by Alem Tuzlak on May 14, 2026. You ask an LLM for a Person object. You hit send. The spinner spins. Five seconds. Ten. Twenty. Somewhere on a server in Oregon, the model is happily generating tokens, and your user is staring at a loading state until the very last } of the JSON arrives. That UX is bad and you already know it. The fix, in theory, is "just stream it." The fix, in practice, has been writing 15 lines of glue: an onChunk handler, a useState, a parsePartialJSON call, a manual cast to your Person type. Repeat in every project. Hope you got the types right. This release kills the glue. useChat { outputSchema } now gives you a typed partial and final straight from the hook. One schema. End to end. Until now, mixing streaming with outputSchema in @tanstack/ai looked something like this on the client: const partial, setPartial = useState