skills/openhands-sdk/SKILL.md
Reference skill for the OpenHands Software Agent SDK - the Python framework for building AI agents that write software. Use when you need to build agents with the SDK, create custom tools, configure LLMs, manage conversations, delegate to sub-agents, or deploy agents locally or remotely.
npx skillsauth add openhands/skills openhands-sdkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
All SDK documentation lives at https://docs.openhands.dev/sdk.
For the full topic index, fetch https://docs.openhands.dev/llms.txt and read the "OpenHands Software Agent SDK" section.
Install: pip install openhands-sdk openhands-tools
import os
from openhands.sdk import LLM, Agent, Conversation, Tool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.task_tracker import TaskTrackerTool
from openhands.tools.terminal import TerminalTool
llm = LLM(
model=os.getenv("LLM_MODEL", "gpt-5.5"),
api_key=os.getenv("LLM_API_KEY"),
base_url=os.getenv("LLM_BASE_URL", None),
)
agent = Agent(
llm=llm,
tools=[
Tool(name=TerminalTool.name),
Tool(name=FileEditorTool.name),
Tool(name=TaskTrackerTool.name),
],
)
cwd = os.getcwd()
conversation = Conversation(agent=agent, workspace=cwd)
conversation.send_message("Write 3 facts about the current project into FACTS.txt.")
conversation.run()
print("All done!")
openhands.sdk)| Class | Purpose |
|---|---|
| Agent | Reasoning-action loop |
| Condenser | Conversation history compression system |
| Conversation | Conversation orchestration system |
| Event | Typed event framework |
| LLM | Provider-agnostic language model interface |
| SecurityAnalyzer | Action security analysis and validation |
| Skill | Reusable prompt system |
| Tool / ToolDefinition | Action-observation tool framework |
| Workspace | Execution environment abstraction |
openhands.sdk.agent, openhands.sdk.conversation, openhands.sdk.event, openhands.sdk.llm, openhands.sdk.security, openhands.sdk.tool, openhands.sdk.utils, openhands.sdk.workspace
Source: examples/
01_standalone_sdk/01_hello_world.py02_custom_tools.py03_activate_skill.py04_confirmation_mode_example.py05_use_llm_registry.py06_interactive_terminal_w_reasoning.py07_mcp_integration.py08_mcp_with_oauth.py09_pause_example.py10_persistence.py11_async.py12_custom_secrets.py13_get_llm_metrics.py14_context_condenser.py15_browser_use.py16_llm_security_analyzer.py17_image_input.py18_send_message_while_processing.py19_llm_routing.py20_stuck_detector.py21_generate_extraneous_conversation_costs.py22_anthropic_thinking.py23_responses_reasoning.py24_planning_agent_workflow.py25_agent_delegation.py26_custom_visualizer.py27_observability_laminar.py28_ask_agent_example.py29_llm_streaming.py30_tom_agent.py31_iterative_refinement.py32_configurable_security_policy.py33_hooks34_critic_example.py35_subscription_login.py36_event_json_to_openai_messages.py37_llm_profile_store38_browser_session_recording.py39_llm_fallback.py40_acp_agent_example.py41_task_tool_set.py42_file_based_subagents.py43_mixed_marketplace_skills44_model_switching_in_convo.py45_parallel_tool_execution.py46_agent_settings.py47_defense_in_depth_security.py48_conversation_fork.py49_switch_llm_tool.py50_async_cancellation.py51_agent_hooks02_remote_agent_server/01_convo_with_local_agent_server.py02_convo_with_docker_sandboxed_server.py03_browser_use_with_docker_sandboxed_server.py04_convo_with_api_sandboxed_server.py05_vscode_with_docker_sandboxed_server.py06_custom_tool07_convo_with_cloud_workspace.py08_convo_with_apptainer_sandboxed_server.py09_acp_agent_with_remote_runtime.py10_cloud_workspace_share_credentials.py11_conversation_fork.py12_settings_and_secrets_api.py13_workspace_get_llm.pyhook_scriptsscripts03_github_workflows/01_basic_action02_pr_review03_todo_management04_datadog_debugging05_posthog_debugging04_llm_specific_tools/01_gpt5_apply_patch_preset.py02_gemini_file_tools.py05_skills_and_plugins/01_loading_agentskills02_loading_plugins03_managing_installed_skillstools
Create an automation that generates an async standup digest from Slack. Searches selected channels for messages since the previous workday, groups updates by project, highlights blockers and decisions, and posts a summary to a target channel.
tools
Create an automation that writes a recurring research brief. Uses Tavily MCP for web research and Notion MCP to publish the final brief with executive summary, implications, and source citations.
tools
Create an automation that triages new Linear issues. Inspects the issue title, description, team, customer, priority, and recent related issues via Linear MCP. Suggests labels, priority, likely owner, duplicates, and posts a clarifying comment.
tools
Create an automation that drafts incident retrospectives. Gathers incident-channel messages from Slack, collects linked tickets and follow-ups from Linear, and publishes a retrospective draft to Notion with a timeline, impact summary, root-cause hypotheses, and action items.