Sandboxed Code Execution as an API
OnlineCompiler.io is a sandboxed code execution platform for 46 languages, with a REST API, WebSocket support, an embeddable widget, and MCP support for AI agents.
- Category
- Developer Infrastructure + AI-Ready Tooling
- Project Type
- Live API platform at onlinecompiler.io
- Audience
- Developers, edtech platforms and AI agents
- Links
- Visit OnlineCompiler.io
The problem.
Running arbitrary user code is a problem most teams would rather not own. Doing it safely means container isolation, resource limits, and careful handling of anything that touches the network or filesystem, which is a lot of infrastructure to build for what is usually a small product feature.
OnlineCompiler.io turns that into an API call. Education platforms, documentation sites, and AI agents can execute code without operating the sandbox themselves.
What we built.
- sandboxed execution across 46 programming languages
- test-case judging for online judges, coding courses and autograders
- REST API for synchronous execution
- WebSocket support for streaming output
- embeddable widget for documentation and learning sites
- MCP support so AI agents can execute code as a tool
- resource limits and execution timeouts
Why this was more than a code runner.
Executing untrusted code as a service means the security model is the product. Every design decision follows from containing what runs.
- 01
isolating untrusted code without making cold starts unusable
- 02
streaming output over WebSockets while keeping the sandbox sealed
- 03
supporting 46 language toolchains with predictable behaviour
- 04
exposing execution to AI agents through MCP safely
- 05
keeping per-execution cost low enough for an API product
Technology stack.
- Python
- Django
- Celery
- Redis
- PostgreSQL
- Docker
- gVisor
- Node.js
- WebSockets
- SvelteKit
- Hetzner
Outcome.
- live in production at onlinecompiler.io
- supports 46 languages behind one API
- 1,900+ developer accounts, about 45,000 runs a month (September 2026)
- MCP support makes it directly usable as an AI agent tool
- embeddable widget extends it beyond the API surface
Relevant service lanes.
Executing untrusted code as a service means the security model is the product. Every design decision follows from containing what runs.