X-EXECD-ACCESS-TOKEN header.
Base URL
Authentication
All API requests must include the access token in the request header:Key Features
Code Execution
Execute code in multiple programming languages with stateful contexts:- Multi-language Support: Python, JavaScript, Bash, Java, and more
- Stateful Sessions: Maintain execution state across multiple code runs
- Context Management: Create, list, and delete execution contexts
- Real-time Output: Stream execution results via Server-Sent Events (SSE)
Command Execution
Run shell commands with flexible execution modes:- Foreground Mode: Execute commands with streaming output
- Background Mode: Run long-running commands in detached mode
- Status Polling: Check command status and retrieve logs
- Timeout Control: Set maximum execution time limits
- Process Interruption: Stop running commands on demand
File Operations
Complete filesystem management capabilities:- CRUD Operations: Create, read, update, and delete files
- Directory Management: Create and remove directories recursively
- Permissions: Set Unix-style file permissions (owner, group, mode)
- File Search: Search files using glob patterns
- Batch Operations: Upload, download, move, and replace content in bulk
System Monitoring
Real-time system resource tracking:- CPU Metrics: Monitor CPU usage and core count
- Memory Metrics: Track total and used memory
- Real-time Streaming: Watch metrics continuously via SSE
- Timestamped Data: All metrics include Unix millisecond timestamps
Streaming Output (SSE)
Code execution and command execution endpoints use Server-Sent Events (SSE) to stream real-time output. SSE provides a persistent HTTP connection that allows the server to push updates to the client as they occur.Event Types
The streaming API supports the following event types:| Event Type | Description |
|---|---|
init | Initialization event with session details |
status | Status update during execution |
stdout | Standard output stream data |
stderr | Standard error stream data |
result | Execution result with MIME-typed output |
execution_complete | Execution finished successfully |
execution_count | Jupyter-style execution counter |
error | Error information with traceback |
ping | Keep-alive heartbeat |
Event Format
Each SSE event follows this structure:API Sections
The Execution API is organized into the following sections:Code Interpreter
Execute code in Python, JavaScript, and other languages with stateful contexts
Command Execution
Run shell commands with foreground/background modes and status polling
Filesystem
Complete file and directory operations with permissions management
Metrics
Monitor CPU and memory usage in real-time
Error Handling
The API uses standard HTTP status codes and returns structured error responses:Error Response Format
Common Error Codes
| Status Code | Error Code | Description |
|---|---|---|
| 400 | INVALID_REQUEST_BODY | Invalid request format or missing required fields |
| 404 | FILE_NOT_FOUND | File or resource not found |
| 416 | RANGE_NOT_SATISFIABLE | Invalid HTTP range request |
| 500 | RUNTIME_ERROR | Internal server error during operation |
Quick Start
Execute Python Code
Run a Shell Command
Get System Metrics
Next Steps
Code Interpreter
Learn about code execution endpoints
Command Execution
Explore command execution capabilities