Skip to main content

Request

curl -X POST http://localhost:3001/run \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [{"role": "user", "content": "help me research AI efficiency"}],
    "context": {"cwd": "/Users/you/projects"}
  }'

Body

FieldTypeRequiredDescription
messagesarrayConversation messages (AI SDK format)
contextobjectOptionalWorkspace context
context.cwdstringOptionalCurrent working directory

Response

Content-Type: text/event-stream (SSE) The response uses the AI SDK UIMessageStream protocol:
data: {"type":"reasoning-start"}
data: {"type":"reasoning-delta","content":"Analyzing intent..."}
data: {"type":"reasoning-end"}
data: {"type":"text-delta","content":"Here's what I found..."}
data: {"type":"tool-input-start","toolName":"webSearch"}
data: {"type":"tool-input-available","input":{"query":"AI efficiency 2026"}}
data: {"type":"tool-output-available","output":{"results":[...]}}
data: {"type":"step-boundary"}
data: {"type":"text-delta","content":"Based on my research..."}
data: {"type":"finish"}

Event Types

EventDescription
reasoning-start/delta/endAnalysis phase thinking
text-deltaStreaming text response
tool-input-startTool call begins
tool-input-availableTool call arguments
tool-output-availableTool result
tool-approval-requestHuman-in-the-loop approval needed
step-boundaryMulti-step separator
finishStream complete

Pipeline

  1. Analyze — Fast model classifies intent (~200ms)
  2. Route — Simple/standard/complex/long-running
  3. Execute — Agent runs with tools
  4. Evaluate — Quality check (complex tasks only)
  5. Stream — Response sent via SSE