Start a conversation to manage the agent’s lifecycle:
conversation = Conversation(agent=agent, workspace=cwd)conversation.send_message( "Write 3 facts about the current project into FACTS.txt.")conversation.run()
FACTS.txt---------1. This is a Python project using the OpenHands Software Agent SDK.2. The project includes examples demonstrating various agent capabilities.3. The SDK provides tools for file manipulation, bash execution, and more.
The model name should follow the LiteLLM convention: provider/model_name (e.g., anthropic/claude-sonnet-4-5-20250929, openai/gpt-4o).
The LLM_API_KEY should be the API key for your chosen provider.
ChatGPT Plus/Pro subscribers: You can use LLM.subscription_login() to authenticate with your ChatGPT account and access Codex models without consuming API credits. See the LLM Subscriptions guide for details.