Skip to main content

Streaming SSE

The iNwealth API returns responses as Server-Sent Events (SSE). This allows you to display the answer progressively as it’s generated, just like ChatGPT or Claude.

Event types

Raw SSE format

Extended thinking deltas

When extended_thinking is enabled, delta events may include thinking data instead of content:

JavaScript (fetch + ReadableStream)

Python (httpx)

Multi-turn conversation

The API is stateless. Send the full conversation history in messages:
Reuse the same session_id across turns to benefit from Anthropic’s prompt caching, reducing latency and token costs.
For long conversations (12+ turns), the API automatically optimizes the conversation history to stay within model limits. The most recent messages are always preserved in full. This is transparent — no action needed on your side.