Best code execution APIs in 2026: 13 compared
We make OnlineCompiler.io, one of the APIs on this page. Every entry gets the same facts, read on the vendor's own pages on the date at the top, and the products that beat ours at something say so. Where a vendor doesn't publish a figure, the table says not stated.
Two kinds of product
"Code execution API" covers two different things, and picking the wrong kind is the costliest mistake here.
- Stateless runners take one program per request, with its input, and return the output or a verdict. They suit online judges, coding courses, graders, assessment tools and tool calls that run a snippet. OnlineCompiler.io, Judge0, Sphere Engine, JDoodle and Piston are this kind.
- Persistent sandboxes give an AI agent a whole machine for minutes to days: a shell, a filesystem, packages it installs, often the network. E2B, Daytona, Modal, Vercel Sandbox, Cloudflare's Sandbox SDK and CodeSandbox are this kind. None of them judges code against test cases.
At a glance
| Service | Kind | Status | Languages | Free | Paid from | Judging | Takes Judge0 or Piston requests | Self-host |
|---|---|---|---|---|---|---|---|---|
| OnlineCompiler.io | Stateless runner | Active | 46 | 100,000 runs a month, commercial use included | $10/month for 150,000 runs | Yes: verdict and score per test, stored problems, custom checkers | Both, plus Jobe (Moodle CodeRunner) | No (clients MIT) |
| Judge0 | Stateless runner | Active | "60+" (judge0.com), "90+" (GitHub) | 50 submissions a day advertised on judge0.com; self-host free | €27/month for 2,000 a day | One expected output per submission | It is the Judge0 API | Yes, GPL-3.0 |
| Sphere Engine | Stateless runner, plus Problems | Active | "80+" | None; 14-day trial | Not published (custom quote) | Yes (Problems): test case and master judges | Not stated | On-premise on request |
| JDoodle | Stateless runner (REST and WebSocket) | Active | 114, with several versions each | 20 runs a day | $10/month for 1,000 a day | Not in the API (separate Assessments product) | Not stated | Not stated |
| Piston | Stateless runner | Project active; public API whitelist-only since 15 Feb 2026 | 84 | Self-host free; public API for approved non-commercial education only | No paid plan | No | It is the Piston API | Yes, MIT |
| E2B | Persistent sandbox (Firecracker microVM) | Active | Python, JavaScript and TypeScript, R, Java, Bash; custom runtimes | $100 one-time credit | $150/month plus per-second usage | No | Not stated | Yes, Apache-2.0 |
| Daytona | Persistent sandbox (container or VM) | Active; open-source repo archived since June 2026 | Python, TypeScript, JavaScript | $200 of compute | Pay as you go: $0.0504 per vCPU-hour, $0.0162 per GiB-hour | No | Not stated | Last public code AGPL-3.0, unmaintained |
| Modal Sandboxes | Persistent sandbox (container) | Active | Any container image | $30 of credit a month | Per second beyond the credit; Team $250/month | No | Not stated | No |
| Vercel Sandbox | Persistent sandbox (Firecracker microVM) | Active | Node.js LTS and Python 3.14 by default; custom images | 5 active CPU hours a month, personal or non-commercial use only | $20/month Pro with $20 of usage; $0.128 per active CPU hour | No | Not stated | No |
| Cloudflare Sandbox SDK | Persistent sandbox (microVM container) or Dynamic Worker | Active; container scheduling in public beta | Any (containers); JavaScript, Python, WebAssembly (Dynamic Workers) | None | $5/month Workers Paid, with 375 vCPU-minutes included | No | Not stated | No |
| CodeSandbox SDK | Persistent sandbox (Firecracker microVM) | Active per its GitHub and npm | JavaScript and Python interpreters; any Dockerfile | 10 concurrent VMs, 400 credits a month | Credits at $0.01486 each | No | Not stated | No |
| Glot.io | Playground | Active; no documented public API | 44 | Free playground | None published | No | Not stated | Yes, MIT (its runner components) |
| Riza | Stateless code interpreter | Closed: hosted API shut down 1 Oct 2025 | Python, JavaScript, TypeScript, Ruby, PHP | None (closed) | None (closed) | No | Not stated | Self-hosted container for existing licence holders |
Free tiers and prices are as each vendor lists them; units differ (runs, daily quotas, credits, CPU seconds), so compare them for your own workload. Free code execution tiers are compared in more depth in free code execution APIs.
Which one fits
- Judge or grade code against test cases: Sphere Engine Problems has the most complete problem management (test case judges, a master judge, rankings, on-premise and an SLA). OnlineCompiler.io returns a verdict and score per test in one request and keeps stored problems with hidden tests. Judge0 compares one expected output per submission.
- Programs that read input while they run: JDoodle's WebSocket API streams output and takes live input. OnlineCompiler.io takes all input up front.
- Free self-hosting: Judge0 (GPL-3.0) or Piston (MIT), on servers you run and keep patched.
- An existing Judge0 or Piston client: OnlineCompiler.io answers both APIs, so the client changes its base URL and key; Moodle CodeRunner points its Jobe server at it.
- An AI agent with a shell, files and long sessions: E2B, Daytona, Modal, Vercel Sandbox, Cloudflare's Sandbox SDK or CodeSandbox. Modal and Daytona also offer GPUs.
- The most languages: JDoodle lists 114 and Piston 84. OnlineCompiler.io runs 46.
The services
OnlineCompiler.io
A stateless runner: each run gets a fresh gVisor sandbox with no network, 30 seconds and 512 MB by default (up to 2 GB on Pro and above). It runs 46 languages, judges code against test cases with signed receipts, and answers the Judge0 API, the Piston API and Jobe for Moodle CodeRunner. Free up to 100,000 runs a month; paid plans from $10 a month (pricing). Hosted only; the clients, the MCP server and the plugins are MIT on GitHub. Not for: sessions that keep state, network access or interactive input.
Judge0
The long-established open-source runner (GPL-3.0) whose API many tools already speak, with expected-output verdicts, batches and webhooks; it sandboxes with isolate. Hosted plans are daily quotas on judge0.com (from €27 a month for 2,000 submissions a day) and on RapidAPI; Sulu, which sold its pay-per-use plan, shut down in November 2025. The public instance's settings show a 5-second default CPU limit (20 at most) and 256 MB of memory by default.
Sphere Engine
A commercial runner (Compilers) and judge (Problems) with stored problems, test case judges, a master judge, custom judges and rankings, plus on-premise deployment. No free plan and no published prices: a 14-day trial, then a custom quote (pricing). Its FAQ states 1.5 GB of memory and time limits of 1 to 15 seconds for Compilers and 1 to 60 for Problems.
JDoodle
A runner with REST and WebSocket APIs and the widest language list here (114, several versions each). Billing is in credits, one per run: 20 a day free, then from $10 a month for 1,000 a day (credits). Better than a plain runner for programs that read input while they run (WebSocket). Run-time, memory and concurrency limits are not stated.
Piston
A small, MIT-licensed runner with 84 language packages that you host yourself; it sandboxes with isolate inside Docker (README). Its public API at emkc.org has been whitelist-only since 15 February 2026, for approved non-commercial education only, and answers others with 401.
E2B
Firecracker microVMs for agent sessions, with a persistent filesystem, pause, resume and fork; Python, JavaScript, R, Java and Bash in its code interpreter. A $100 one-time credit, then $150 a month plus per-second usage; sessions up to 1 hour (Hobby) or 24 hours (Pro) (pricing). The runtime is Apache-2.0 and can run on your own infrastructure.
Daytona
Sandboxes that keep their state indefinitely, including Linux, Windows, macOS and GPU machines. $200 of free compute, then pay as you go (pricing). Its open-source repository was archived in June 2026, when core development moved to a private codebase.
Modal Sandboxes
Containers from an image you define, with GPU access and large burst capacity, isolated with gVisor or microVMs. $30 of credit a month on the free Starter plan, then per-second billing; sandboxes live 5 minutes by default and up to 24 hours (pricing).
Vercel Sandbox
Firecracker microVMs billed only for active CPU time, with persistent sandboxes, snapshots and up to 10,000 at once on Pro. Hobby includes 5 active CPU hours a month but, under Vercel's terms, only for personal or non-commercial use; Pro is $20 a month with $20 of usage (pricing).
Cloudflare Sandbox SDK
A full Linux microVM container or a lighter Dynamic Worker for JavaScript and Python, driven from a Worker on Cloudflare's network (docs). It needs the $5-a-month Workers Paid plan, which includes 375 vCPU-minutes; usage is billed per 10 ms of activity (pricing).
CodeSandbox SDK
Firecracker VMs with snapshot, restore and cloning, running any Dockerfile; a free Build plan with 10 concurrent VMs and 400 credits a month. Its live pages refused automated access when we checked, so these facts come from its own GitHub docs and npm package, and current prices may differ.
Glot.io
A free playground for 44 languages whose runner components are MIT licensed. It publishes no API documentation, so as a hosted API it is not an option today.
What changed in the past year
- Riza shut down its hosted code interpreter on 1 October 2025.
- Sulu, which sold Judge0's pay-per-use plan, shut down in November 2025 (Judge0 issue #572).
- The public Piston API became whitelist-only on 15 February 2026 (what the 401 means).
- Daytona's open-source repository was archived in June 2026.
How we checked
Every figure was read on 22 November 2026 on the vendor's own site, docs, pricing page, public API or GitHub; no review sites. Where a vendor's own pages disagree (Judge0's language count; judge0.com's advertised free plan against RapidAPI's), both are given. We check again every quarter and change the date above only when we do. If a fact here is wrong or out of date, tell us and we will fix it.
Frequently asked questions
What is the best code execution API?
It depends on the job. To run or judge short programs in many languages per request, a stateless runner fits: OnlineCompiler.io (46 languages, judging built in, Judge0- and Piston-compatible, free up to 100,000 runs a month), Judge0, Sphere Engine or JDoodle. For an AI agent that needs a shell, files and long sessions, a persistent sandbox fits: E2B, Daytona, Modal, Vercel Sandbox, Cloudflare's Sandbox SDK or CodeSandbox. We make OnlineCompiler.io; the facts on this page were read on each vendor's own pages on 22 November 2026.
Which code execution APIs have a free tier?
OnlineCompiler.io gives 100,000 runs a month, commercial use included. JDoodle gives 20 runs a day. judge0.com advertises 50 submissions a day on its Basic cloud plan. E2B gives a $100 one-time credit, Daytona $200 of compute, Modal $30 of credit a month, and Vercel Sandbox's Hobby plan 5 active CPU hours a month for personal or non-commercial use only. Sphere Engine has a 14-day trial and Cloudflare's sandboxes need the $5 Workers Paid plan. Judge0 and Piston are free to self-host.
Which code execution APIs can judge code against test cases?
Sphere Engine Problems (test case judges, a master judge, custom judges and rankings), OnlineCompiler.io (a verdict and score per test in one request, stored problems with hidden tests and custom checkers) and Judge0 (one expected output per submission). JDoodle judges through its separate Assessments product. The persistent sandboxes have no built-in verdicts.
Is the public Piston API still free?
No. Since 15 February 2026 the public API at emkc.org is whitelist-only, and keys go only to non-commercial educational projects. Piston itself is MIT licensed and free to self-host.
Is Riza still running?
No. Riza shut down its hosted Code Interpreter API on 1 October 2025 and closed sign-ups on 28 July 2025. Existing holders of an offline licence key can keep running its self-hosted container.
Should I use a stateless runner or a sandbox for an AI agent?
A stateless runner fits when each call is one program with its input and you want the output or a verdict back, as in coding tutors, graders and tool calls that run a snippet. A sandbox fits when the agent installs packages, keeps files between steps, needs the network or runs for minutes to hours. OnlineCompiler.io's runs have no network and stop after 30 seconds, by design.