Skip to main content
v2 available: See POST /v2/chats/stream for the REST-native version using standard SSE, which works with any HTTP client.
This endpoint requires a Connect-RPC client and cannot be tested with a simple HTTP request. In TypeScript, the SDK streaming client wraps it — streaming.chats.streamChat(...) / streaming.chats.watchChat(...) — with no Connect setup required.

Overview

The Stream Chat endpoint allows you to receive chat responses in real-time as they are generated. This is a server-streaming Connect-RPC endpoint that works over standard HTTP/1.1 or HTTP/2. Endpoint: POST /v1/stream

Stream Flow

1

Initialize Client

Create a Connect-RPC transport with your API base URL and authentication token. Connect-RPC works over standard HTTP, so any HTTP client can be used with the Connect protocol.
2

Send Request

Send a StreamRequest with your question, optional chat_id (for continuation), and tools configuration. If no chat_id is provided, a new chat session is created.
3

Receive Initial Metadata

First StreamResponse contains metadata with:
  • chat_id: Use this for subsequent messages in the same conversation
  • model: The LLM model being used
  • is_continuation: Whether this continues an existing chat
  • status: Initially QUERY_STATUS_IN_PROGRESS
4

Stream Content

Receive multiple StreamResponse messages as content is generated:
  • meta_data: ChatId, model
  • text: Incremental text deltas (append these to build the full response)
  • preview: Results and visualizations (charts, tables)

Request Body

Response

The endpoint streams StreamResponse messages containing:
  • metadata: Chat metadata including ID, model, status, and token usage
  • cell: Executable cells (SQL, Python, etc.)
  • text: Text content deltas
  • preview: Preview cells with results

StreamMetadata

ChatTools

Notes

  • This endpoint uses Connect-RPC server streaming over standard HTTP/1.1 or HTTP/2
  • Connect-RPC is fully HTTP-compatible - no special gRPC infrastructure needed
  • Responses are streamed incrementally as the AI generates content
  • The stream will remain open until the query completes, fails, or is cancelled
  • Use the Cancel Stream endpoint to stop an in-progress query