Skip to content

Streaming

Real-time conversation streaming with Server-Sent Events

The Inconvo API supports real-time streaming of conversation responses using Server-Sent Events (SSE). This allows you to receive responses as they are generated, providing a more interactive experience for your users.

When you create a response with stream: true, the API returns a stream of events instead of waiting for the complete response. This enables you to:

  • Display agent progress steps in real-time
  • Show partial responses as they’re generated
  • Provide immediate feedback to users
  • Build more responsive interfaces

The streaming API emits three types of events. For detailed information about each event type, see:

Terminal window
curl -N -X POST https://app.inconvo.ai/api/v1/conversations/{id}/response \
-H "Authorization: Bearer $INCONVO_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{
"message": "What is my best selling product?",
"stream": true
}'
Terminal window
data: {"type":"created","id":"5b5de977-0678-46aa-8d21-3d2ae875fdd2"}
data: {"type":"agent_step","id":"5b5de977-0678-46aa-8d21-3d2ae875fdd2","step":"get_schemas","message":"Jumping into data..."}
data: {"type":"agent_step","id":"5b5de977-0678-46aa-8d21-3d2ae875fdd2","step":"database_retriever","message":"Retrieving..."}
data: {"type":"agent_step","id":"5b5de977-0678-46aa-8d21-3d2ae875fdd2","step":"set_message_derived_filters","message":"Setting filters..."}
data: {"type":"agent_step","id":"5b5de977-0678-46aa-8d21-3d2ae875fdd2","step":"decide_complete","message":"Verifying..."}
data: {"type":"agent_step","id":"5b5de977-0678-46aa-8d21-3d2ae875fdd2","step":"format_response","message":"Formatting response..."}
data: {"type":"completed","id":"5b5de977-0678-46aa-8d21-3d2ae875fdd2","response":{"type":"text","message":"Your best selling product is the iPhone 15, with the highest total quantity sold to date."}}
data: [DONE]