Drive the environment's desktop
Relay one computer-use action to the environment’s guest agent: move the mouse, click, type, scroll, screenshot, or zoom into a region. The response carries a base64 PNG screenshot on every action that implies one, which is what a computer-use agent loop feeds back to the model as the tool_result.
The action vocabulary is the guest agent’s (it matches Anthropic’s
computer_20251124 tool): screenshot, left_click,
right_click, middle_click, double_click, triple_click,
left_click_drag, left_mouse_down, left_mouse_up,
mouse_move, type, key, hold_key, scroll, wait, zoom,
cursor_position. Fields this server has not learned yet pass
through to the guest untouched, so a newer image’s actions work
through an older control plane.
Requires an environment booted from a desktop image; on any other image the guest answers with 503 and a reason. Unlike exec this accepts API keys: an action here is a mouse click on a display the image chose to run, not a root shell.
While a human holds the environment (a takeover), or an ask
stall is waiting to be acked, an action is refused with 423
locked before it reaches the guest, exactly as exec is. Wait on
details.intervention_id, then send the action again.
Hitl gates. When the environment’s hitl.gates include
computer gates, the action is checked against them before the
guest sees it, by its action name and, for type, its text
(text_contains). A gate in ask mode answers 202 with a
HeldResponse; once a human approves, the orchestrator performs
the action itself, with the body as sent (or the approver’s
edited_text for a type), and stores the guest’s answer in the
intervention’s result.computer. notify lets it through and
records a terminal intervention; deny answers 403 forbidden
with details.reason hitl_denied. A gate with a decide
webhook asks it first: allow lets the action through, deny
is the same 403 with the decider’s reason, and ask or any
failure holds it for a human. A grant from an earlier approval
lets the exact same action body through without a prompt.
/v1/environments/{vmId}/computerAuthorizationBearer token · headerrequiredfuse_sessionAPI key · cookierequiredvmIdstringrequiredapplication/jsonactionstringrequiredcoordinateinteger[]start_coordinateinteger[]textstringregioninteger[]durationnumberscroll_directionstringupdownleftrightscroll_amountintegeroutputstringscreenshotstringintervention_idstringrequiredinterventionInterventionrequiredShow propertiesHide properties
idstringrequiredenv_idstringrequiredkindstringrequiredasksecrettakeoverreviewexeclifecyclecomputerstallexpirygatestringmodestringasknotifydenystatestringrequiredpendingapprovedrejectedexpiredcancelledpayloadobjectrequiredShow propertiesHide properties
questionstringchoicesstring[]execExecPayloadShow propertiesHide properties
argvstring[]requiredshellstringtimeout_msinteger<int64>lifecycleLifecyclePayloadShow propertiesHide properties
actionstringrequireddestroyforkmigratedrainsnapshotrotate-tokensecretInterventionSecretShow propertiesHide properties
targetstringrequiredlabelstringrequiredmessagestringtakeoverInterventionTakeoverShow propertiesHide properties
viastringrequiredterminaldesktopreasonstringholderActorShow propertiesHide properties
idstringrequirednamestringsourcestringrequiredpinnedassertedkeysystemdeciderkey_idstringstarted_atstring<date-time>signalInterventionSignalShow propertiesHide properties
failuresintegerlast_exit_codeintegerquiet_secondsinteger<int64>reaperstringidle_timeoutmax_runtimereap_atstring<date-time>extended_untilstring<date-time>computerComputerPayloadShow propertiesHide properties
actionstringrequiredtextstringinputobjectrequiredreviewInterventionReviewShow propertiesHide properties
pathstringcontentstringrequiredformatstringrequiredtextdiffmessagestringtruncatedbooleandeciderInterventionDeciderShow propertiesHide properties
verdictstringrequiredaskreasonstringerrorstringtriggered_byActorrequiredShow propertiesHide properties
idstringrequirednamestringsourcestringrequiredpinnedassertedkeysystemdeciderkey_idstringdeadlinestring<date-time>requiredon_timeoutstringrequiredrejectallowdecisionobjectShow propertiesHide properties
outcomestringrequiredapproverejectanswerstringreasonstringdecided_byActorrequiredShow propertiesHide properties
idstringrequirednamestringsourcestringrequiredpinnedassertedkeysystemdeciderkey_idstringdecided_atstring<date-time>requirededited_argvstring[]edited_textstringgrantstringresultInterventionResultShow propertiesHide properties
execExecEnvironmentResponseShow propertiesHide properties
exit_codeintegerrequiredstdoutstringrequiredstderrstringrequiredcomputerComputerActionResponseShow propertiesHide properties
outputstringscreenshotstringenv_idstringsnapshot_idstringerrorstringfinished_atstring<date-time>requiredcreated_atstring<date-time>requiredupdated_atstring<date-time>requirederrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjectcurl -X POST "http://localhost:8080/v1/environments/string/computer" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "left_click",
"coordinate": [
512,
384
]
}'const response = await fetch("http://localhost:8080/v1/environments/string/computer", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"action": "left_click",
"coordinate": [
512,
384
]
})
});import requests
response = requests.post(
"http://localhost:8080/v1/environments/string/computer",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"action": "left_click",
"coordinate": [
512,
384
]
},
){
"output": "string",
"screenshot": "string"
}{
"intervention_id": "string",
"intervention": {
"id": "string",
"env_id": "string",
"kind": "ask",
"gate": "string",
"mode": "ask",
"state": "pending",
"payload": {
"question": "string",
"choices": [
"string"
],
"exec": {
"argv": [
"string"
],
"shell": "string",
"timeout_ms": 0
},
"lifecycle": {
"action": "destroy"
},
"secret": {
"target": "string",
"label": "string",
"message": "string"
},
"takeover": {
"via": "terminal",
"reason": "string",
"holder": {
"id": "string",
"name": "string",
"source": "pinned",
"key_id": "string"
},
"started_at": "2024-01-01T00:00:00Z"
},
"signal": {
"failures": 0,
"last_exit_code": 0,
"quiet_seconds": 0,
"reaper": "idle_timeout",
"reap_at": "2024-01-01T00:00:00Z",
"extended_until": "2024-01-01T00:00:00Z"
},
"computer": {
"action": "string",
"text": "string",
"input": {}
},
"review": {
"path": "string",
"content": "string",
"format": "text",
"message": "string",
"truncated": true
},
"decider": {
"verdict": "ask",
"reason": "string",
"error": "string"
}
},
"triggered_by": {
"id": "string",
"name": "string",
"source": "pinned",
"key_id": "string"
},
"deadline": "2024-01-01T00:00:00Z",
"on_timeout": "reject",
"decision": {
"outcome": "approve",
"answer": "string",
"reason": "string",
"decided_by": {
"id": "string",
"name": "string",
"source": "pinned",
"key_id": "string"
},
"decided_at": "2024-01-01T00:00:00Z",
"edited_argv": [
"string"
],
"edited_text": "string",
"grant": "string"
},
"result": {
"exec": {
"exit_code": 0,
"stdout": "hi\n",
"stderr": ""
},
"computer": {
"output": "string",
"screenshot": "string"
},
"env_id": "string",
"snapshot_id": "string",
"error": "string",
"finished_at": "2024-01-01T00:00:00Z"
},
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}