Streaming (SSE)
Enabling streaming
curl -N -X POST https://app.promptshuttle.com/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o",
"messages": [{"role": "user", "content": [{"type": "text", "text": "Research quantum computing"}]}],
"stream": true,
"stream_options": {
"include_usage": true,
"usage_interval_ms": 3000
}
}'Response format
Field
Type
Description
Event types
Lifecycle events
requestStarted
requestStartedrequestCompleted
requestCompletedrequestFailed
requestFailedAgent events
agentStarted
agentStartedagentInferenceStarted
agentInferenceStartedagentInferenceCompleted
agentInferenceCompletedagentCompleted
agentCompletedagentFailed
agentFailedTool events
toolStarted
toolStartedtoolCompleted
toolCompletedtoolFailed
toolFailedUsage events
usageUpdate
usageUpdateSystem events
heartbeat
heartbeaterror
errorFiltering events
Client example
Last updated