API Reference

Streaming

Receive real-time updates as Wren AI processes your request.

The Streaming API allows you to receive real-time updates as Wren AI processes your request β€” from understanding the question, to generating SQL, running it, and optionally returning summaries.

These endpoints use Server-Sent Events (SSE) to deliver a continuous stream of structured events. This is ideal for interactive applications such as chat interfaces, notebooks, or dashboards where users benefit from step-by-step feedback.


Use Cases

  • βœ… Display live reasoning and SQL generation feedback in chatbots
  • βœ… Show SQL execution progress in real time
  • βœ… Render streaming text response
  • βœ… Improve perceived latency by showing intermediate steps

Available Streaming Endpoints

EndpointDescription
POST /stream/askFull pipeline: generates SQL, executes it, and returns a summary
POST /stream/generate_sqlOnly generates the SQL based on a natural language question