Handle any Server-Sent Events stream without serverless timeout issues. Perfect for OpenAI, analytics, and real-time data streams.
Sign up and navigate to Settings → API Keys to create your authentication key.
Send a POST request to subscribe to any SSE endpoint. Choose webhook (real-time push) or resumable (stored in Redis).
curl -X POST https://api.durablr.run/stream/subscribe \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"projectId":"your_project","streamType":"webhook",...}'Webhook streams push events to your URL in real-time. Resumable streams can be consumed via SSE anytime.
https://api.durablr.runThe API runs on a separate server from the web frontend. All stream operations use this base URL.
All API requests require authentication using your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYHow to get your API key:
Choose the right stream type for your use case:
Stream OpenAI chat completions to your webhook in real-time:
curl -X POST https://api.durablr.run/stream/subscribe \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_DURABLR_API_KEY" \
-d '{
"projectId": "your_project_id",
"streamType": "webhook",
"method": "POST",
"streamUrl": "https://api.openai.com/v1/chat/completions",
"webhookUrl": "https://webhook.site/your-unique-url",
"headers": {
"Authorization": "Bearer YOUR_OPENAI_API_KEY",
"Content-Type": "application/json"
},
"body": {
"model": "gpt-4",
"messages": [{"role": "user", "content": "Write a creative story"}],
"stream": true,
"max_tokens": 500
}
}'{"streamId": "7f8c9d2e-4b5a-1c3d-9e8f-2a1b3c4d5e6f"}Subscribe to any Server-Sent Events endpoint:
curl -X POST https://api.durablr.run/stream/subscribe \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_DURABLR_API_KEY" \
-d '{
"projectId": "your_project_id",
"streamType": "webhook",
"streamUrl": "https://your-sse-endpoint.com/events",
"webhookUrl": "https://webhook.site/your-unique-url",
"headers": {
"Authorization": "Bearer YOUR_ENDPOINT_TOKEN"
}
}'Create a resumable stream that stores data in Redis and can be consumed via SSE:
curl -X POST https://api.durablr.run/stream/subscribe \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_DURABLR_API_KEY" \
-d '{
"projectId": "your_project_id",
"streamType": "resumable",
"streamUrl": "https://api.openai.com/v1/chat/completions",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR_OPENAI_API_KEY",
"Content-Type": "application/json"
},
"body": {
"model": "gpt-4",
"messages": [{"role": "user", "content": "Tell me a story"}],
"stream": true
}
}'curl https://api.durablr.run/stream/resume/7f8c9d2e-4b5a-1c3d-9e8f-2a1b3c4d5e6f?fromId=0 \
-H "Authorization: Bearer YOUR_DURABLR_API_KEY"Streams all chunks as Server-Sent Events. Can reconnect anytime with last received ID to resume. Authentication is required.
your-unique-url in the examples aboveDurablr forwards streaming chunks in real-time:
{
"streamId": "7f8c9d2e-4b5a-1c3d-9e8f-2a1b3c4d5e6f",
"type": "chunk",
"data": "data: {\"id\":\"chatcmpl-ABC123\",\"object\":\"chat.completion.chunk\",\"created\":1756648138,\"model\":\"gpt-4-0613\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" couldn\"},\"logprobs\":null,\"finish_reason\":null}]}\n\n",
"timestamp": "2025-08-31T13:49:05.649Z"
}{
"streamId": "7f8c9d2e-4b5a-1c3d-9e8f-2a1b3c4d5e6f",
"type": "completed",
"timestamp": "2025-08-31T13:49:15.123Z"
}data: lines to extract the actual JSON responsesAll webhooks include cryptographic signatures so you can verify they're authentic.
X-Webhook-Signature: 8f3a2b1c9d4e5f6a... (HMAC-SHA256 hex)
X-Webhook-Timestamp: 2025-08-31T13:49:05.649Zconst crypto = require('crypto');
function verifyWebhook(req) {
const signature = req.headers['x-webhook-signature'];
const apiKey = process.env.DURABLR_API_KEY;
const hmac = crypto.createHmac('sha256', apiKey);
hmac.update(JSON.stringify(req.body));
const expected = hmac.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}Monitor and control your streams programmatically
curl https://api.durablr.run/stream/active \
-H "Authorization: Bearer YOUR_DURABLR_API_KEY"{"activeStreams": ["7f8c9d2e-4b5a-1c3d-9e8f-2a1b3c4d5e6f"], "count": 1}curl https://api.durablr.run/stream/7f8c9d2e-4b5a-1c3d-9e8f-2a1b3c4d5e6f \
-H "Authorization: Bearer YOUR_DURABLR_API_KEY"{"streamId": "7f8c9d2e-4b5a-1c3d-9e8f-2a1b3c4d5e6f", "projectId": "your_project_id", "status": "active", "streamType": "webhook", "streamUrl": "https://...", "webhookUrl": "https://...", "createdAt": "2025-01-15T10:30:00Z"}Stream statuses: active, completed, error, stopped
Streams auto-complete when the source finishes, so manual stopping is optional.
curl -X DELETE \
https://api.durablr.run/stream/subscribe/7f8c9d2e-4b5a-1c3d-9e8f-2a1b3c4d5e6f \
-H "Authorization: Bearer YOUR_DURABLR_API_KEY"{"message": "Stream stopped", "streamId": "7f8c9d2e-4b5a-1c3d-9e8f-2a1b3c4d5e6f"}Handle long AI responses without timeouts
Real-time analytics and metrics feeds
Long-running data transformation jobs
Real-time financial data streams
Device telemetry and sensor data
Streaming chat and messaging systems