Chat & Streaming
Real-time AI chat via Server-Sent Events
The chat endpoint streams Claude's responses in real-time using Server-Sent Events (SSE).
Usage
curl -X POST https://api.yolocode.ai/api/e2b-sandboxes/<id>/chat \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"message": "Explain this codebase"}' \
--no-bufferHow it works
- Your request hits the Yolocode API
- The API proxies it to the sandbox's internal chat service (port 7031 for E2B, port 17031 for Daytona)
- The response streams back as
text/event-stream
Response headers
Content-Type: text/event-stream
Cache-Control: no-cache
Connection: keep-aliveStream format
The response is a standard SSE stream. Each event contains a chunk of Claude's response.
Notes
- The chat endpoint has a max duration of 300 seconds
- The stream proxies directly from the sandbox's internal API
- Both E2B and Daytona sandboxes support chat streaming
- The internal sandbox service maintains conversation history per connection