Real-Time Streaming APIs

Stream real-time data — stock prices, IoT sensors, live feeds — through Opsalis with per-second billing, settled on-chain.

Consumer EventSource connect Opsalis P2P persistent connection per-second billing SSE Ticker API bb-sse-ticker streaming events (SSE)

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

Click "Start Stream" to see live stock prices

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

1

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
2

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
3

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
4

Start Earning Per Second

Consumers connect to your stream and pay for exactly how long they listen. USDC settles automatically on Base L2.