Consumer opens EventSource connection → Opsalis maintains persistent P2P link → Owner streams events back in real-time
Why SSE Streaming on Opsalis?
Server-Sent Events (SSE) power real-time applications: stock tickers, IoT sensor feeds, live dashboards, notification streams. Unlike REST polling, SSE delivers data the instant it's available — lower latency, less bandwidth, better user experience.
Opsalis makes SSE streams monetizable. API owners set per-second pricing, and the platform meters stream duration automatically. Consumers connect with a standard EventSource API — no SDK, no library, just native browser support. Billing settles in USDC on Base L2.
The P2P architecture means streaming data flows directly between consumer and owner. No central relay buffering your data, no single point of failure in the stream path.
Try It Live
SSE Stock Ticker Stream
Code Samples
# Stream SSE events through Opsalis
$ curl -N -H "Accept: text/event-stream" \
-H "X-Consumer-Key: demo-public-key-2026" \
"https://opsalis.com/api/demo/api/bb-sse-ticker?symbol=AAPL"
// Connect to SSE stream through Opsalis
const source = new EventSource(
'https://opsalis.com/api/demo/api/bb-sse-ticker?symbol=AAPL',
{ headers: { 'X-Consumer-Key': 'demo-public-key-2026' } }
);
source.onmessage = (event) => {
const tick = JSON.parse(event.data);
console.log(`${tick.symbol}: $${tick.price} (${tick.change})`);
};
source.onerror = () => {
console.error('Stream disconnected');
source.close();
};
// Stop streaming after 30 seconds
setTimeout(() => source.close(), 30000);
# Stream SSE events through Opsalis
import requests
response = requests.get(
'https://opsalis.com/api/demo/api/bb-sse-ticker',
params={'symbol': 'AAPL'},
headers={'X-Consumer-Key': 'demo-public-key-2026'},
stream=True
)
for line in response.iter_lines():
if line:
decoded = line.decode('utf-8')
if decoded.startswith('data:'):
print(decoded[5:].strip())
Self-Host in Minutes
Install Opsalis
Pull and run the free Docker container on your own hardware.
$ docker pull opsalis/node:latest
$ docker run -d --name opsalis -p 3000:3000 opsalis/node:latest
Register Your SSE Endpoint
Add your streaming endpoint in the control center. Set per-second pricing for stream duration.
# In the Opsalis control center:
API Name: my-sse-stream
Protocol: SSE (Server-Sent Events)
Endpoint URL: http://localhost:8080/stream
Price/second: $0.0001 USDC
Configure Stream Settings
Set maximum stream duration, reconnection policy, and event filtering options.
# Stream configuration:
Max Duration: 3600s (1 hour)
Reconnect: Automatic with backoff
Heartbeat: Every 30s
Start Earning Per Second
Consumers connect to your stream and pay for exactly how long they listen. USDC settles automatically on Base L2.