You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Complete guide for migrating from OpenHands V0 APIs to V1 APIs
The V0 API (`/api/conversations`) is deprecated and scheduled for removal on **April 1, 2026**.
Please migrate to the V1 API as soon as possible.
Overview
This guide helps you migrate from OpenHands V0 APIs to the new V1 APIs. The V1 API introduces significant architectural improvements including decoupled sandboxes and conversations, better reliability, and enhanced developer experience.
Key Architectural Change
In V1, Conversations and Sandboxes are decoupled. Sandboxes (runtime environments) are managed independently, enabling features like:
Pause and resume sandboxes without losing state
Sandbox reuse across conversations
Independent lifecycle management for better resource control
V1 also introduces two levels of API:
App Server API - The main API for managing conversations and sandboxes (focus of this guide)
Agent Server API - Fine-grained control of individual runtimes and sandboxes (see Agent Server API section)
Benefits of V1 APIs
Theme
Key Result
Reliability
61% reduction in system failures — eliminated entire classes of infrastructure errors
Performance
Lighter-weight runtime with co-located execution — removes inter-pod communication overhead
Developer Experience
Modern API patterns — dedicated search, filtering, batch operations, webhooks, and flexible sandbox controls
Reliability
61% reduction in system-attributable failures — Production data showed V1 reduced errors from 78.0 to 30.0 per 1k conversations
Eliminated infrastructure errors — V0's inter-pod communication caused authentication failures, runtime readiness races, and connection timeouts. V1 eliminates these entirely.
Co-located execution model — Removes dependency on inter-pod HTTP communication, eliminating an entire class of failure modes
Replay-based recovery — Event-sourced state enables recovery via replay after failures
Performance
Lighter-weight agent server — More efficient runtime API reduces resource overhead
Decoupled sandboxes and conversations — Independent lifecycle management for better resource control
Event-sourced state — One-to-one mapping between execution events and LLM messages enables clean integration, persistence, and replay
Developer Experience
Sandbox Controls
Pause and resume sandboxes — Pause when not in use, resume without losing state
Explicit status tracking — Clear states (STARTING, RUNNING, PAUSED, ERROR, MISSING)
Sandbox specs — Reusable templates with custom commands, environment variables, and working directories
Querying & Filtering
Dedicated search endpoints — Enhanced filtering for conversations and events
Count endpoints — Get counts without fetching full data
Batch get operations — Retrieve multiple items by ID in a single request
Enhanced event filtering — Filter by kind, timestamp ranges, with improved pagination
Streaming & Real-time
Stream from start — Stream conversation updates from moment of creation
initial_user_msg (string) → initial_message (object with content array)
Response handling: V1 returns a start task object with status tracking. The conversation ID is in app_conversation_id (available when status is READY).
V1 introduces explicit sandbox management. Here's how to pause and resume a sandbox:
# Pause a sandbox
curl -X POST "https://app.all-hands.dev/api/v1/sandboxes/{sandbox_id}/pause" \
-H "Authorization: Bearer YOUR_API_KEY"# Resume a sandbox
curl -X POST "https://app.all-hands.dev/api/v1/sandboxes/{sandbox_id}/resume" \
-H "Authorization: Bearer YOUR_API_KEY"
Agent Server API
In addition to the App Server API (app.all-hands.dev), V1 exposes an Agent Server API on each sandbox runtime. This API provides direct access to workspace and conversation operations.
How to Access
Get sandbox info: GET /api/v1/sandboxes?id={sandbox_id}
Find AGENT_SERVER in the exposed_urls field
Use session_api_key as X-Session-API-Key header
Call Agent Server endpoints on that URL
OpenAPI spec available at {agent_server_url}/openapi.json
Available Endpoints
Endpoint
Description
POST /api/file/upload/{path}
Upload files to workspace
GET /api/file/download/{path}
Download individual files
GET /api/file/download-trajectory/{conversation_id}
Download conversation trajectory
Endpoint
Description
GET /api/git/changes/{path}
Get git changes
GET /api/git/diff/{path}
Get git diff
Endpoint
Description
POST /api/conversations/{conversation_id}/events
Send user message
GET /api/conversations/{conversation_id}/events/search
Search events
GET /api/conversations/{conversation_id}/events/count
Count events
DELETE /api/conversations/{conversation_id}
Delete conversation
POST /api/conversations/{conversation_id}/pause
Pause conversation
POST /api/conversations/{conversation_id}/run
Resume/run conversation
POST /api/conversations/{conversation_id}/condense
Condense conversation history
POST /api/conversations/{conversation_id}/generate_title
Auto-generate title
POST /api/conversations/{conversation_id}/confirmation_policy
Set confirmation policy
POST /api/conversations/{conversation_id}/secrets
Update conversation secrets
POST /api/conversations/{conversation_id}/security_analyzer
Set security analyzer
POST /api/conversations/{conversation_id}/ask_agent
Ask agent directly
Endpoint
Description
POST /api/bash/execute_bash_command
Execute bash command (blocking)
POST /api/bash/start_bash_command
Start bash command (async)
GET /api/bash/bash_events/search
Search bash events
Endpoint
Description
GET /api/vscode/url
Get VSCode URL
GET /api/vscode/status
Check VSCode status
GET /api/desktop/url
Get desktop URL
GET /api/tools/
List available tools
Endpoint
Description
GET /health
Health check
GET /alive
Alive check
GET /server_info
Get server info
The Agent Server API requires an active/running sandbox. For operations on inactive sandboxes, use the App Server API.
Known Gaps
The following V0 capabilities do not yet have direct V1 App Server REST API equivalents:
Gap
V0 Endpoint
Workaround
Download workspace as zip
GET /api/conversations/{id}/zip-directory
Use Agent Server file download endpoints
Get trajectory (inactive runtime)
GET /api/conversations/{id}/trajectory
Trajectory available while sandbox is active via Agent Server
List files in workspace
GET /api/conversations/{id}/list-files
Use Agent Server POST /api/bash/execute_bash_command with ls, or Agent SDK workspace.list_files()
Authentication
API keys created via /api/keys work for both V0 and V1 App Server APIs
Agent Server uses per-sandbox session_api_key with X-Session-API-Key header