Skip to main content

Overview

each::sense uses Server-Sent Events (SSE) for real-time streaming. This enables progressive AI reasoning display, live generation updates, and workflow execution monitoring.

SSE Format

Each event follows the SSE specification:
data: {"type": "event_type", "field": "value"}\n\n
The stream terminates with:
data: [DONE]\n\n

Enabling Streaming

Set stream: true in your request (this is the default):
curl -N -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "messages": [{"role": "user", "content": "Generate a portrait"}],
    "stream": true
  }'

Event Categories

CategoryEvent TypesPurpose
AI Reasoningthinking_delta, text_responseDisplay AI thought process
Tool Operationsstatus, tool_call, message, progressShow operation progress
Generationgeneration_responseDeliver generated media
Interactionclarification_neededRequest user input
Web Searchweb_search_query, web_search_citationsSearch status and results
Workflowworkflow_created, workflow_fetched, workflow_built, workflow_updatedWorkflow lifecycle
Executionexecution_started, execution_progress, execution_completedWorkflow execution
Terminalcomplete, errorTask completion or failure

Event Flow: Simple Generation

thinking_delta     → "Analyzing request..."
status             → "Searching for best model..."
status             → "Executing nano-banana-pro..."
text_response      → "Here's your portrait!"
generation_response → url: "https://..."
complete           → status: "ok"
[DONE]

OpenAI-Compatible Format

When using /v1/chat/completions, events are wrapped in OpenAI-compatible chunks with each::labs extensions in the eachlabs field:
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion.chunk",
  "model": "eachsense/beta",
  "choices": [{
    "index": 0,
    "delta": {"content": "Generating your image..."},
    "finish_reason": null
  }],
  "eachlabs": {
    "type": "text_response",
    "content": "Generating your image..."
  }
}

Timeouts

OperationTimeout
HTTP request300 seconds
Streaming connection15 minutes idle
Image generation10–60 seconds
Video generation60–600 seconds
Workflow execution15 minutes
Last modified on March 3, 2026