Request
Body
| Field | Type | Required | Description |
|---|---|---|---|
messages | array | ✅ | Conversation messages (AI SDK format) |
context | object | Optional | Workspace context |
context.cwd | string | Optional | Current working directory |
Response
Content-Type:text/event-stream (SSE)
The response uses the AI SDK UIMessageStream protocol:
Event Types
| Event | Description |
|---|---|
reasoning-start/delta/end | Analysis phase thinking |
text-delta | Streaming text response |
tool-input-start | Tool call begins |
tool-input-available | Tool call arguments |
tool-output-available | Tool result |
tool-approval-request | Human-in-the-loop approval needed |
step-boundary | Multi-step separator |
finish | Stream complete |
Pipeline
- Analyze — Fast model classifies intent (~200ms)
- Route — Simple/standard/complex/long-running
- Execute — Agent runs with tools
- Evaluate — Quality check (complex tasks only)
- Stream — Response sent via SSE