Build AI agents that write software. A clean, modular SDK with production-ready tools.
The OpenHands SDK allows you to build applications with agents that write software. This SDK also powers OpenHands, an all-batteries-included coding agent that you can access through a GUI, CLI, or API.
- Single Python API: Unified interface for building coding agents with minimal boilerplate
- Pre-defined Tools: Built-in tools for bash commands, file editing, task tracking, and web browsing
- REST-based Agent Server: Deploy agents as scalable web services with WebSocket support for real-time interactions
- Emphasis on coding: Purpose-built for software development tasks with specialized tools and workflows
- State-of-the-Art Performance: Powered by advanced LLMs and optimized for real-world coding scenarios
- Free and Open Source: MIT licensed with an active community and transparent development
Here's what building with the SDK looks like:
from openhands.sdk import LLM, Conversation
from openhands.tools.preset.default import get_default_agent
# Configure LLM and create agent
llm = LLM(model="openhands/claude-sonnet-4-5-20250929", api_key=api_key)
agent = get_default_agent(llm=llm)
# Start a conversation
conversation = Conversation(agent=agent, workspace="/path/to/project")
conversation.send_message("Write 3 facts about this project into FACTS.txt.")
conversation.run()For installation instructions and detailed setup, see the Getting Started Guide.
For detailed documentation, tutorials, and API reference, visit:
https://docs.openhands.dev/sdk
The documentation includes:
- Getting Started Guide - Installation and setup
- Architecture & Core Concepts - Agents, tools, workspaces, and more
- Guides - Hello World, custom tools, MCP, skills, and more
- API Reference - Agent Server REST API documentation
The examples/ directory contains comprehensive usage examples:
- Standalone SDK (
examples/01_standalone_sdk/) - Basic agent usage, custom tools, and microagents - Remote Agent Server (
examples/02_remote_agent_server/) - Client-server architecture and WebSocket connections - GitHub Workflows (
examples/03_github_workflows/) - CI/CD integration and automated workflows
For development setup, testing, and contribution guidelines, see DEVELOPMENT.md.
- Join Slack - Connect with the OpenHands community
- GitHub Repository - Source code and issues
- Documentation - Complete documentation
MIT License - see LICENSE for details.