Introduction
The Runtime API provides a simple REST interface for executing code snippets in isolated Docker containers across multiple programming languages. The API is built with Spring Boot and runs on port 8081 by default.Base URL
The API is available at:localhost:8081 with your server’s hostname and port.
API Architecture
The Runtime API follows a straightforward request-response pattern:- Submit Code - Send a code execution request with your code snippet and target language
- Isolated Execution - Code runs in a secure Docker container with resource limits
- Receive Results - Get output, exit code, and execution time in the response
Response Format
All API responses follow a consistent wrapper format using theApiResponse<T> structure:
Response Fields
Indicates whether the API request was successful
Human-readable message describing the result
The actual response payload (type varies by endpoint)
Supported Languages
The Runtime API supports code execution in the following languages:- Java - JDK-based execution
- Python - Python 3 interpreter
- C - GCC compiler
- C++ - G++ compiler
- JavaScript - Node.js runtime
Quick Example
Here’s a complete example of executing a Python script:Resource Limits
All code executions are subject to resource constraints to ensure system stability:- Memory - Limited per container
- CPU - Constrained CPU usage
- Execution Time - Automatic timeout and cleanup
- Network - Isolated network environment
Resource limits are enforced at the Docker container level. Long-running or resource-intensive code may be terminated automatically.
Error Handling
When an error occurs, the API returns a response withsuccess: false:
- Invalid or unsupported language
- Code compilation errors
- Runtime exceptions
- Resource limit violations
- Docker container failures
Next Steps
Authentication
Learn about API authentication and security
Execute Endpoint
Detailed documentation for the code execution endpoint