POST /api/execute
Execute code in a secure, isolated Docker container. This endpoint supports multiple programming languages and returns the execution output, exit code, and execution time.Request Body
The source code to execute. Must be valid code for the specified language.
The programming language of the code. Supported values:
java- Javapython- Pythonc- Ccpp- C++js- JavaScript
Response
Returns anApiResponse object containing the execution result.
Indicates whether the request was successful.
A descriptive message about the execution result.
The execution result data. Only present when
success is true.The standard output from the code execution.
The exit code from the execution process.
0 indicates successful execution.The execution time in milliseconds.
Examples
Success Response
Error Responses
Unsupported Language
Compilation Error (Java example)
Runtime Error (Python example)
Notes
Code execution happens in isolated Docker containers with resource limits applied. Each execution is ephemeral and containers are automatically cleaned up after execution.