Executes Python code on the computer.
Path parameters
Request
Timeout in seconds (1-300).
Response
true if code executed successfully.
Error message if execution failed.
Error type (e.g., SyntaxError, NameError).
true if execution timed out.
Example
curl -X POST https://www.orgo.ai/api/computers/a3bb189e-8bf9-3888-9912-ace4e6543002/exec \
-H "Authorization: Bearer $ORGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "import os\nprint(os.getcwd())",
"timeout": 10
}'
Successful response
{
"output": "/home/user\n",
"success": true
}
Error response
{
"output": "",
"success": false,
"error": "name 'undefined_var' is not defined",
"error_type": "NameError"
}
API key authentication. Get your key at orgo.ai/workspaces
Required range: 1 <= x <= 300
Whether execution succeeded
Whether execution timed out