BF Streaming API (Chat)
The BetterForms chat streaming endpoint is a lightweight streaming API for simple OpenAI and Gemini text generation.
Overview
This endpoint still exists in the current BetterForms server and is registered at:
POST /stream/create
It is a simpler streaming endpoint than /llm/query:
supports
openaiandgeministreams basic
deltaandendevents over BetterForms messagingdoes not expose the richer tool orchestration and cancellation contract documented for
/llm/query
Request Shape
apiKey
string
BetterForms API key
channels
array
BetterForms messaging channels used for streamed events
actionName
string
Named action that handles the streamed events
payload
object
Provider request payload
payload.provider
string
Provider name. Current implementation supports openai and gemini. Defaults to openai if omitted.
payload.apiKey
string
API key for the selected provider
payload.stream
boolean
If true, returns a streaming setup acknowledgment and emits events over messaging. If false, returns the result directly in the HTTP response.
payload.messages
array
Conversation messages
payload.model
string
Model name for the selected provider
payload.generationConfig
object
Optional Gemini-specific generation settings
Example
Streaming Behavior
When payload.stream is true, the endpoint returns a setup acknowledgment such as:
The generated content is then delivered over BetterForms messaging.
Current event types for this endpoint are intentionally simple:
deltaend
Example streamed event:
Non-Streaming Behavior
When payload.stream is false, BetterForms returns the result directly in the HTTP response.
OpenAI returns the provider response object
Gemini returns a normalized response with
choices[0].message.content
Provider Notes
OpenAI
Uses the older chat-completions streaming flow in the current implementation
Sends streamed text chunks as
deltaevents
Gemini
Uses Gemini streaming directly
Expects the last message to be a
usermessageSupports
payload.generationConfig
Related Pages
Last updated
Was this helpful?