A chatbot feels fast when the reply appears word by word instead of all at once. The Upfyn API streams responses so your interface can render each piece as it arrives.
What you need
- An Upfyn account and an API key — see Authentication.
- The Streaming guide for the response format.
The shape of it
Keep the conversation
Send the running list of messages with every request so the model has the context.
Ask for a stream
Turn streaming on and read the response as a sequence of small chunks.
Render as you go
Append each chunk to the message on screen, and mark the message complete when the stream ends.
The complete recipe, with code, is on upfyn.com: A streaming chatbot.