Pattern
Stream Text
Stream text responses from AI prompts in real-time. Includes character counting and live response rendering with useCompletion.
View Full Pattern on Desktop

AI SDK APIs
streamTextuseCompletion
Tags
aiprompttext-generationstreamingai-sdkopenai
Environment Variables
OPENAI_API_KEYGet key →
External Services
openai
Ready to use?
View the full interactive pattern with live preview and copy the source code.
View Pattern on DesktopRelated Patterns


Streaming Structured Output
Stream structured output from AI prompts in real-time using streamText with Output.object(). Generate typed data with useObject and live rendering.
aiprompt+6
View →


Tool Input Lifecycle Hooks
Explore tool input lifecycle hooks: onInputStart, onInputDelta, and onInputAvailable. See how to track tool input generation in real-time during streaming.
aitools+7
View →
End of Pattern



