Skip to main content
Expose agents over HTTP with Server-Sent Events so clients receive live updates without polling. The user connects a web client; the agent server streams SSE events while the agent processes each HTTP request.

How It Works

A client subscribes to the event stream, and the server pushes agent updates live as work progresses.

Features

  • REST API - HTTP endpoints for agent operations
  • SSE Streaming - Real-time event streaming to clients
  • CORS Support - Configurable cross-origin settings
  • Multi-client - Handle multiple concurrent connections

Quick Start

1

Start a server

2

Use as a context manager

API Reference

ServerConfig

AgentServer

HTTP Endpoints

Examples

Context Manager

Event Handler

Client Connection (JavaScript)

Publishing Events


Best Practices

Replace cors_origins=["*"] with explicit front-end origins before exposing the server publicly.
Use ServerConfig(auth_token=...) when the server binds outside loopback so /publish cannot be abused.
Stream long agent runs on /events; submit work via REST and broadcast milestones to connected clients.
Watch server.client_count and tune max_connections before production traffic spikes.

Async Jobs

Submit long-running work and poll or stream results via the jobs API.

Agent API Launch

Launch agents as HTTP services with minimal setup.