## Stream Messages `JsonValue beta().chat().stream(ChatStreamParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **post** `/api/v1/chat/{session_id}/messages/stream` Stream agent events for a chat turn as Server-Sent Events. ### Parameters - `ChatStreamParams params` - `Optional sessionId` - `Optional organizationId` - `Optional projectId` - `List indexIds` Indexes to retrieve data from. - `String prompt` User message for this chat turn. ### Returns - `class ChatStreamResponse:` ### Example ```java package com.llamacloud_prod.api.example; import com.llamacloud_prod.api.client.LlamaCloudClient; import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient; import com.llamacloud_prod.api.models.beta.chat.ChatStreamParams; import com.llamacloud_prod.api.models.beta.chat.ChatStreamResponse; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); ChatStreamParams params = ChatStreamParams.builder() .sessionId("session_id") .addIndexId("idx-abc123") .addIndexId("idx-def456") .prompt("What were the main findings in Q3?") .build(); ChatStreamResponse response = client.beta().chat().stream(params); } } ``` #### Response ```json {} ```