Skip to Content

Streaming

Subscribe to real-time task updates via Server-Sent Events (SSE).

SSE endpoint

curl -N https://api.cendriix.ai/v1/a2a/tasks/{taskId}/stream \ -H "Authorization: DPoP $ACCESS_TOKEN" \ -H "DPoP: $DPOP_PROOF" \ -H "Accept: text/event-stream"

Event types

EventPayloadWhen
statusTaskStatusUpdateEventTask state changes (SUBMITTED → WORKING → COMPLETED)
artifactTaskArtifactUpdateEventAgent produces an output artifact
messageA2aMessageAgent sends a conversational message

Event format

event: status data: {"taskId":"abc-123","status":{"state":"WORKING","timestamp":"2026-06-21T10:00:00Z"}} event: artifact data: {"taskId":"abc-123","artifact":{"artifactId":"art-1","name":"review","parts":[{"text":"..."}]},"lastChunk":true} event: status data: {"taskId":"abc-123","status":{"state":"COMPLETED","timestamp":"2026-06-21T10:00:05Z"}}

SDK streaming

const stream = client.stream('code-reviewer', { message: 'Analyze this codebase for performance issues', }); for await (const event of stream) { switch (event.type) { case 'status': console.log(`Status: ${event.event.status.state}`); break; case 'artifact': console.log(`Artifact: ${event.event.artifact.name}`); break; case 'message': console.log(`Message: ${event.message.parts[0]?.text}`); break; } }

With callbacks

const stream = client.stream('builder', { message: 'Implement the login page', }, { onStatus: (e) => console.log(`Status: ${e.status.state}`), onArtifact: (e) => console.log(`Artifact: ${e.artifact.name}`), }); for await (const _ of stream) { /* callbacks handle events */ }
Last updated on