This document provides a detailed description of all the server-side APIs available in the OpenHands project. Each API is categorized by its respective route file and includes information about the endpoint, HTTP method, and functionality.
General Endpoints
Endpoint | Method | Description | Response |
---|
/health | GET | A simple health check endpoint. | 200 OK: Returns the string "OK" . |
Conversation API
Endpoint | Method | Description | Response |
---|
/api/conversations/{conversation_id}/config | GET | Retrieves the runtime configuration. | 200 OK: JSON object with runtime_id and session_id . |
/api/conversations/{conversation_id}/vscode-url | GET | Retrieves the VSCode URL. | 200 OK: JSON object with vscode_url . |
/api/conversations/{conversation_id}/web-hosts | GET | Retrieves the runtime hosts. | 200 OK: JSON object with hosts . |
Feedback API
Endpoint | Method | Description | Response |
---|
/api/conversations/{conversation_id}/submit-feedback | POST | Submits user feedback. | 200 OK: JSON object with stored feedback data. |
File Management API
Endpoint | Method | Description | Response |
---|
/api/conversations/{conversation_id}/list-files | GET | Lists files in the runtime. | 200 OK: JSON array of file names. |
/api/conversations/{conversation_id}/select-file | GET | Retrieves file content. | 200 OK: JSON object with file content. |
/api/conversations/{conversation_id}/upload-files | POST | Uploads files to the workspace. | 200 OK: JSON object with upload details. |
/api/conversations/{conversation_id}/save-file | POST | Saves a file to the runtime. | 200 OK: Success message. |
/api/conversations/{conversation_id}/zip-directory | GET | Compresses the workspace. | 200 OK: Returns the ZIP file. |
GitHub API
Endpoint | Method | Description | Response |
---|
/api/github/repositories | GET | Retrieves GitHub repositories. | 200 OK: JSON array of repositories. |
/api/github/user | GET | Retrieves GitHub user information. | 200 OK: JSON object with user details. |
/api/github/installations | GET | Retrieves GitHub installation IDs. | 200 OK: JSON array of installation IDs. |
/api/github/search/repositories | GET | Searches GitHub repositories. | 200 OK: JSON array of repositories. |
Conversation Management API
Endpoint | Method | Description | Response |
---|
/api/conversations | POST | Initializes a new conversation. | 200 OK: JSON object with conversation ID. |
/api/conversations | GET | Searches for conversations. | 200 OK: JSON object with conversation details. |
/api/conversations/{conversation_id} | GET | Retrieves conversation details. | 200 OK: JSON object with conversation details. |
/api/conversations/{conversation_id} | PATCH | Updates conversation title. | 200 OK: Success message. |
/api/conversations/{conversation_id} | DELETE | Deletes a conversation. | 200 OK: Success message. |
Public API
Endpoint | Method | Description | Response |
---|
/api/options/models | GET | Retrieves supported models. | 200 OK: JSON array of model names. |
/api/options/agents | GET | Retrieves supported agents. | 200 OK: JSON array of agent names. |
/api/options/security-analyzers | GET | Retrieves security analyzers. | 200 OK: JSON array of analyzer names. |
/api/options/config | GET | Retrieves server configuration. | 200 OK: JSON object with configuration details. |
Security API
Endpoint | Method | Description | Response |
---|
/api/conversations/{conversation_id}/security/{path:path} | ANY | Security analyzer API requests. | 200 OK: Response from the security analyzer. |
Settings API
Endpoint | Method | Description | Response |
---|
/api/settings | GET | Loads current settings. | 200 OK: JSON object with settings details. |
/api/settings | POST | Stores new settings. | 200 OK: Success message. |
Trajectory API
Endpoint | Method | Description | Response |
---|
/api/conversations/{conversation_id}/trajectory | GET | Retrieves the current trajectory. | 200 OK: JSON object with trajectory details. |