Skip to main content

Stream

POST 

/workstations/:workstation_id/log/stream

Stream the log entries of a Workstation in realtime using Server-Sent Events (SSE).

Example usage with JavaScript:

const id = 'HvcqZjmeoPtP';
const url = `https://api.agentstation.ai/v1/workstations/${id}/log/stream`;

// Get SSE URL from AgentStation API
const response = await fetch(url, {
method: 'POST',
headers: {
'Authorization': 'Bearer <your_token>'
}
});
const stream = await response.json();
// stream.url example: https://stream.agentstation.ai/v1/log/sse/cxBMzXSFUSXf

// Connect to SSE stream
const eventSource = new EventSource(stream.url);

eventSource.onmessage = (event) => {
const log = JSON.parse(event.data);
console.log(log);
};

eventSource.onerror = (error) => {
console.error('EventSource failed:', error);
eventSource.close();
};

Request

Responses

Successfully retrieved SSE stream URL.