As of 2025-09-16 this is a work in progress and subject to rapid change.
A REST/WebSocket interface for OpenHands AI Agent. This server provides HTTP and WebSocket endpoints to interact with the OpenHands agent programmatically.
-
Prerequisites: Python 3.12+, curl
-
Install uv (package manager):
curl -LsSf https://astral.sh/uv/install.sh | sh # Restart your shell so "uv" is on PATH, or follow the installer hint
# Install dependencies (incl. dev tools)
make install-dev
# Optional: install pre-commit hooks
make install-pre-commit-hooks
# Start the server
make run
# or
uv run openhands-server
Tip: Set your model key (one of) so the agent can talk to an LLM:
export OPENAI_API_KEY=...
# or
export LITELLM_API_KEY=...
The server can be configured using environment variables with the OH_ prefix:
# Set the web URL where OpenHands is running (used for callbacks, webhooks, etc.)
export OH_WEB_URL=https://my-openhands.example.com
# Defaults to http://localhost:3000 if not set# Build (installs PyInstaller if needed)
./build.sh --install-pyinstaller
# The binary will be in dist/
./dist/openhands-server # macOS/Linux
# dist/openhands-server.exe # Windows
For advanced development (adding deps, updating the spec file, debugging builds), see Development.md.
GET /conversations/search- List/search conversationsGET /conversations/{id}- Get conversation by IDGET /conversations/- Batch get conversationsPOST /conversations/- Start a new conversationPOST /conversations/{id}/pause- Pause a conversationPOST /conversations/{id}/resume- Resume a conversationDELETE /conversations/{id}- Delete a conversation
GET /conversations/{id}/events/search- List/search events in a conversationGET /conversations/{id}/events/{event_id}- Get specific eventGET /conversations/{id}/events/- Batch get eventsPOST /conversations/{id}/events/- Send a message to the conversationPOST /conversations/{id}/events/respond_to_confirmation- Respond to confirmation requests
WS /conversations/{id}/events/socket- Real-time event streaming for a conversation
REST/WebSocket interface for OpenHands AI Agent, providing programmatic access to agent capabilities.