Skip to main content
POST
Execute Python
Executes Python code on the computer in a short-lived interpreter and returns its output.

Path parameters

string
required
Computer ID (UUID).

Body parameters

string
required
Python code to execute.
integer
default:"10"
Timeout in seconds (1-300).

Response

string
Captured stdout from the interpreter.
boolean
true if the code ran without raising an uncaught exception.
string
Error message, if execution failed.
string
Python exception class (e.g., SyntaxError, NameError).
boolean
true if execution was killed by the timeout.

Example

Successful response

Error response

For shell commands, use Execute bash instead.

Errors

Authorizations

Authorization
string
header
required

API key authentication. Get your key at orgo.ai/workspaces

Path Parameters

id
string
required

Computer ID

Body

application/json
code
string
required

Python code to execute

timeout
integer
default:10

Timeout in seconds

Required range: 1 <= x <= 300

Response

Code executed

output
string

Code output

success
boolean

Whether execution succeeded

error
string

Error message if failed

error_type
string

Error type if failed

timeout
boolean

Whether execution timed out