Execute Python
Run a Python snippet on the computer and capture its output.
python3 -c, HOME=/root, DISPLAY=:99, and PATH=/usr/local/bin:/usr/bin:/bin.
On Windows, the code is written to a temporary file and run with C:\Python312\python.exe from the user’s Desktop folder. The response carries stdout, stderr, exit_code, and output instead of the fields listed under Response, plus error when the code could not run. Code that runs out of time returns 200 with exit_code: 124 and error: "timeout".
Path parameters
Body parameters
400.0 or a non-numeric value becomes
10. Out-of-range values are never rejected.exec takes no ?screen= parameter. Unlike the pointer and keyboard actions,
sending one here is silently ignored rather than rejected. The code always runs
against the computer’s default display.Response
true only when the interpreter exited zero. Code that raises returns 200
with success: false, not an error status.exec.false. Code killed by the timeout also returns false, so this field
carries no information. Infer a timeout from success: false with truncated
output instead.null on a 200, including when the code raises. Read output for
the traceback.null on a 200. It never carries a Python exception class. Parse
output if you need the exception name.Example
Successful response
Response when the code raises
Still a200. The exception is in output; error and error_type stay null.
Errors
200 with
success: false. Every failure raised after the request leaves the API layer
carries a request_id. Quote it in support requests. When the computer agent
itself answered non-2xx, the body additionally carries upstream_status.
Authorizations
API key authentication. Get your key at orgo.ai/workspaces
Path Parameters
Computer ID
Body
Response
The code ran. Code that raises is still a 200, with success: false and the traceback in output.
true only when the interpreter exited zero. Code that raises returns 200 with success: false.
exec Combined stdout and stderr. An uncaught exception's traceback arrives here.
Always false, even when the code was killed by the timeout. Infer a timeout from success: false with truncated output.
false Always null on a 200, including when the code raises.
Always null on a 200. It never carries a Python exception class.