openhands-sdk
OpenHands SDK - Core functionality for building AI agents
What it is and what it does
OpenHands SDK is a framework for building AI agents that interact with code and development tasks. It provides a Python API to define agents, attach tools (like terminal, file editor, and task tracker), connect them to LLMs, and orchestrate conversations where the agent receives instructions and executes code-related work. Agents can run locally on your machine or in ephemeral Docker/Kubernetes workspaces via the Agent Server, making it suitable for one-off tasks, routine maintenance, and complex multi-agent refactors.
The SDK is built on 18 runtime dependencies including pydantic for data validation, httpx for HTTP communication, litellm for LLM abstraction, and tree-sitter for code parsing. It supports modern Python versions (3.12 or later) and is actively maintained. The framework is designed to be extensible—you can build custom tools, load public skills from a marketplace, and integrate it into CI/CD pipelines or custom developer experiences.
Use it for:
- Automate one-off development tasks like generating README files or documentation for a repository.
- Run routine maintenance workflows such as dependency updates or code refactoring across multiple files.
- Build multi-agent systems that collaborate on large tasks like full codebase rewrites or architectural changes.
- Integrate agentic capabilities into CI/CD pipelines via GitHub Actions or similar workflow systems.
- Create custom developer tools or CLIs that leverage agent-driven code analysis and generation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
OpenHands SDK provides Python and REST APIs for building software agents that can work with code, execute tasks locally or in ephemeral workspaces, and integrate with LLMs to perform development workflows.
Yes, with conditions. The SDK is actively maintained, has low install friction, and addresses a real need for code-working agents. However, the unclear license status requires verification before production use. If you need to build agents that interact with code, execute tasks autonomously, and integrate with LLMs, this is a solid choice—but confirm licensing terms first and ensure Python 3.12 or later is available in your environment.
Install
openhands-sdk on PyPI
pip
pip install openhands-sdkuv
uv add openhands-sdkpoetry
poetry add openhands-sdkInstalling openhands-sdk
Before you install
Low install friction with a pure Python wheel. Active maintenance with a release 2 days old and 987 repository stars. Requires Python 3.12 or later. The 18 runtime dependencies include established packages like pydantic, httpx, and litellm, suggesting a mature dependency ecosystem.
License in practice
License treatment is unclear—no SPDX identifier or raw license text is available in the package metadata. Before production use, verify the actual license terms in the repository or documentation.
Quickstart
pip install openhands-sdk
from openhands.sdk import LLM, Agent, Conversation, Tool
from openhands.tools.terminal import TerminalTool
llm = LLM(model="gpt-5.5", api_key="your-key")
agent = Agent(llm=llm, tools=[Tool(name=TerminalTool.name)])
conversation = Conversation(agent=agent, workspace=".")
conversation.send_message("List files in the current directory")
conversation.run()
Requires Python 3.12 or later. LLM API credentials must be provided for the agent to function.
Verify before relying
- Whether the unclear license permits commercial use or has specific attribution requirements.
- Performance characteristics and latency when running agents against large codebases.
- Compatibility with specific LLM providers beyond the example shown.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 18 — agent-client-protocol, deprecation, fakeredis, fastmcp, filelock, httpx, jsonschema, joserfc, litellm, pillow, pydantic, python-frontmatter, python-json-logger, tenacity, websockets, lmnr, tree-sitter, tree-sitter-bash |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 12,200,524/month — #1,336 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: openhands_sdk-1.42.1-py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
openhands-toolsProvides Python and REST APIs for building AI…
unclear · top 5,000 on PyPI
openhands-workspaceProvides Python and REST APIs for building…
unclear · top 15,000 on PyPI
xpander-sdkPython SDK for building, deploying, and…
permissive · top 15,000 on PyPI
openhands-agent-serverProvides a REST and WebSocket API server for…
unclear · top 5,000 on PyPI
openhandsOpenHands is a CLI tool that runs an AI agent…
permissive · top 5,000 on PyPI
openhands-aiOpenHands is a self-hosted developer control…
permissive · top 5,000 on PyPI
openhands-aciProvides tools and interfaces for AI agents to…
permissive · top 5,000 on PyPI
cursor-sdkPython SDK for scripting Cursor agents with…
unclear · top 15,000 on PyPI
openai-codexPython SDK for building applications that…
permissive · top 15,000 on PyPI
plato-sdk-v2Python SDK for the Plato platform that manages…
permissive · top 15,000 on PyPI