Choose the stream
Non-streaming calls still run through the same turn. Karta accumulates the
stream and returns the final response object.
Native event envelope
Native session streams use Server-Sent Events. The SSEevent: name matches the
event object’s type.
Native event types
The native stream is the most detailed stream. Event payloads vary by harness, but these event types are the public contract you should branch on.text
An agent text chunk. The text is atevent.data['part']['text'] (the Claude
SDK shape).
tool_use
The agent invoked a tool. Common payload fields include the tool name, input, status, result, and tool-use id.reasoning
An extended-thinking / reasoning block, when the model is configured to emit it.step_start
An agent step began. Payload includes astep_index and a description.
step_finish
An agent step completed, with its result.input_required
The turn is paused awaiting an approval decision (tool use, file write, and similar requests). Payload includesrequest_id, kind, tool, target, message, and
options. Resolve it with approve_once, approve_session, or deny. See
Inputs.
error
An agent, model, or policy error. Payload includes a human-readablemessage
and may include a machine-readable code. In streaming mode, mid-turn failures
arrive as events rather than replacing the stream with a new HTTP response.
done
The turn is complete. Payload carriesusage
(input_tokens, output_tokens, total_tokens) and the assembled message. When
the effective model that ran the turn is known, the payload also carries model
(the resolved model id, e.g. claude-sonnet-5); it is omitted when unknown.
Native API example
Create or resume a session, then stream a message:Managed Agents stream
The Managed Agents adapter is the full-fidelity browser and widget stream. It maps native events into stable UI event names:
Approvals arrive as
session.status_idle with
stop_reason: "requires_action", plus the request_id, tool, target, and
options needed to render a decision UI.
Responses stream
The OpenAI-compatible Responses adapter emits the portable Responses sequence:previous_response_id to continue the same Karta session through the
Responses API.
Messages API
Send and stream over HTTP, with full SSE framing.
Consumer adapters
The same stream, re-shaped into OpenAI and Anthropic wire formats.

