Documentation Index
Fetch the complete documentation index at: https://docs.ntrp.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
ntrp uses a persistent SSE connection per session. Connect toGET /chat/events/{session_id} to receive all events (agent responses, tool calls, background task results). Messages are sent via POST /chat/message as fire-and-forget — the response arrives on the SSE stream.
Each event has a type field indicating what happened.
Event types
thinking
Agent is processing. Includes a status message.
text
Complete response text block.
text_delta
Streamed token-level text delta. Only sent when streaming is enabled (pass ?stream=true on the SSE connection, or enable in Settings > Connection).
text event is also sent as a complete fallback.
tool_call
Agent invoked a tool.
tool_result
Tool execution completed.
approval_needed
Tool requires user approval before executing.
POST /tools/result to approve or reject.
session_info
Session metadata update.
done
Execution complete. Includes token usage.
error
An error occurred.
background_task
A background task changed state (started, completed, failed, or cancelled).
backgrounded
A running agent was moved to background mode.
cancelled
User cancelled the run.
Approval flow
Whenapproval_needed is received:
- Display the tool call to the user
- Collect their decision (approve/reject)
- Submit via
POST /tools/result: