Research Agent
Stream a multi-stage research agent over Server-Sent Events.
Authentication
GET /api/v1/agent/stream uses the same bearer key as the rest of the gateway: Authorization: Bearer <API_KEY>. Gateway base URL: https://api.misar.dev.
Exposes MisarCoder's research pipeline (plan → search → reflect → synthesize) as an SSE stream compatible with the @misar/research-agent AgentEvent protocol. Used by the Misar Code VS Code extension and by @misar/research-agent in coding mode.
/api/v1/agent/streamRun the research agent and stream its progress events as text/event-stream.
Query parameters
querystringqueryrequiredThe research question or task.
modestringquerydefault: researchAgent profile: chat, research, or coding.
maxCyclesintegerqueryMaximum reasoning cycles. Defaults by mode — chat: 1, research: 5, coding: 4.
sessionIdstringqueryOptional session id to continue a previous run.
Event stream
Each SSE data: line carries one JSON AgentEvent:
thinking{ stage, content }Reasoning at a pipeline stage.
tool_call{ tool, input }The agent invoked a tool.
tool_result{ tool, citations }A tool returned results (with citations).
reflection{ covered, gaps }Coverage reflection between cycles.
content{ delta }Streamed answer text.
done{ result: { content, citations } }Final synthesized answer.
error{ code, message }An error terminated the run.
curl -N "https://api.misar.dev/api/v1/agent/stream?query=Summarize%20recent%20RAG%20advances&mode=research" \
-H "Authorization: Bearer $MISARCODER_API_KEY"data: {"type":"thinking","stage":"plan","content":"Decomposing the query..."}
data: {"type":"tool_call","tool":"web_search","input":{"query":"RAG advances 2026"}}
data: {"type":"tool_result","tool":"web_search","citations":[]}
data: {"type":"done","result":{"content":"Recent RAG advances include...","citations":[]}}Status codes
200— Stream opened.400—queryis required, ormodeis invalid (must bechat,research, orcoding).401— Missing or invalid API key.