v2 Chat
AI chat stream
Stream a response from Elfa AI using Server-Sent Events (SSE).
Use this when your client can consume incremental events. Use POST /v2/chat instead when your integration needs a complete JSON response.
Access: PAYG and Enterprise API keys.
Response format: text/event-stream.
Common data: event payloads include:
- session_info with sessionId and analysisType
- title with a generated session or analysis title
- text with incremental Markdown content
- text_complete when incremental text has finished
- status with progress updates
- credits with consumed credits
- complete with final sessionId, success, and creditsConsumed; with includeSources: true in the request it also carries sources (the links the research read; same shape as POST /v2/chat)
- invalid_request when a query is rejected by safety checks
- error for stream failures
A : keep-alive comment may be sent during long gaps. The stream ends with data: [DONE].
Request-body semantics match POST /v2/chat: message is required only for analysisType: "chat"; token and account modes use assetMetadata.
post/v2/chat/stream
Request
- Base URL: https://api.elfa.ai
- URL: https://api.elfa.ai/v2/chat/stream
- Auth: API key in header x-elfa-api-key
Request body
Response
SSE stream established (text/event-stream)
Changes
No recorded changes to this operation across all 1 revision of this API.