Obtaining an API Key
To use the OpenHands Cloud API, you’ll need to generate an API key:- Log in to your OpenHands Cloud account.
- Navigate to the Settings > API Keys page.
- Click
Create API Key
. - Give your key a descriptive name (Example: “Development” or “Production”) and select
Create
. - Copy the generated API key and store it securely. It will only be shown once.
API Usage Example
Starting a New Conversation
To start a new conversation with OpenHands to perform a task, you’ll need to make a POST request to the conversation endpoint.- cURL
- Python (with requests)
- TypeScript/JavaScript (with fetch)
Response
The API will return a JSON object with details about the created conversation:AuthenticationError
if:
- You provided an invalid API key.
- You provided the wrong repository name.
- You don’t have access to the repository.