DeepInfra raises $107M Series B to scale the inference cloud — read the announcement
DeepInfra · Sandboxes
A sandbox is an isolated Linux microVM: a small virtual machine with its own kernel. Start one with a single API call, on our image or any public container image. Run bash or Python in it, and move files in and out. From $0.054 per hour, billed by the second.
The nano plan · 1 vCPU · 1 GB RAM
Billed by the second, no minimum
Create a sandbox, run code, move files, then stop or delete it. No Dockerfile, no orchestrator, no fleet to look after.
01
Sandbox.create() returns once the microVM is running. Pick a plan, an idle timeout and, if you need one, your own image.
02
exec() runs any command and run_python() runs Python. Each result has stdout, stderr and a return code.
03
fs.write() and fs.read() move files in and out of /workspace, up to 100 MiB per call.
04
stop() frees the compute and keeps /workspace. terminate() deletes the sandbox.
Python · pip install deepinfra
from deepinfra import Sandbox
sb = Sandbox.create(plan="small", timeout="10m") # blocks until running
r = sb.exec("bash", "-c", "pip install pandas")
print(r.stdout, r.stderr, r.returncode)
out = sb.run_python("print(21 * 2)").check() # raises on a non-zero exit
print(out.stdout) # "42"
sb.fs.write("/workspace/in.csv", b"a,b\n1,2\n")
data = sb.fs.read("/workspace/in.csv")
sb.stop() # frees compute, keeps /workspace
sb.start() # /workspace is back, the rest is reset
sb.terminate() # deletes the sandbox and /workspace
For coding agents, code interpreters, data pipelines and eval harnesses that run untrusted code.
Every sandbox boots as its own microVM on Kata Containers and QEMU/KVM, with its own kernel and a virtualized hardware boundary. It is not a slice of a host shared with other tenants.
The default image is Ubuntu with Python, Node.js, git and build tools, and it starts from a warm pool in about a second. Pass image to run any public container image instead, from Docker Hub, GHCR, Quay and the other supported registries.
Run bash or Python, read and write files, and get typed errors to branch on. Use the Python or TypeScript SDK, or call the HTTP API directly, with the same API key you use for inference.
stop() frees the compute and keeps /workspace. start() brings it back within 7 days. A stopped sandbox costs nothing.
Every network method has an async twin, such as acreate and aexec, so running dozens of sandboxes is a plain asyncio program. Up to 50 can be active per account.
A sandbox can reach the public internet, so pip install works. It accepts no inbound connections and cannot reach other sandboxes.
Billed by the second with no minimum. A stopped sandbox costs nothing.
| Plan | vCPU | RAM | Disk | Per hour |
|---|---|---|---|---|
| nano | 1 | 1 GB | 5 GB | $0.054 |
| small | 2 | 2 GB | 10 GB | $0.107 |
| medium | 2 | 4 GB | 20 GB | $0.134 |
| large | 4 | 8 GB | 40 GB | $0.268 |
| xlarge | 4 | 16 GB | 40 GB | $0.375 |
| 2xlarge | 8 | 16 GB | 40 GB | $0.536 |
| 4xlarge | 8 | 32 GB | 40 GB | $0.750 |
Disk is the size of /workspace. The rest of the filesystem has 20 GB of its own on every plan. A sandbox gets the small plan when you name none. The same catalog is in the dashboard and at GET /v1/sandboxes/catalog.
The numbers to plan around. The docs cover each one in detail.
Default image
Ubuntu with Python, Node.js, git and build tools
Custom image
Any public linux/amd64 image with /bin/sh
Image size
Up to 4 GiB compressed · 20 GB unpacked
Start
About a second on the default image
Runtime
Kata Containers on QEMU/KVM
Kernel
One per sandbox
Inbound connections
None
Internet access
1 Gbit/s down · 200 Mbit/s up
Idle timeout
1 hour by default · set per sandbox
Longest continuous run
24 hours, then it stops
Stopped sandbox kept for
7 days
Command timeout
60 s by default · up to 30 min
Active sandboxes
50 per account
File transfer
100 MiB per call
/workspace disk
5 to 40 GB, by plan
Rest of the filesystem
20 GB on every plan
What to know before you run code in a sandbox.
An isolated Linux microVM that you create with one API call. You run commands and Python in it, move files in and out, and stop or delete it when you are done. It is built for agents and pipelines that run untrusted code.
By the second with no minimum, at the hourly rate of its plan, from $0.054 per hour for nano. Billing runs while a sandbox is creating, starting, running or stopping. A stopped sandbox costs nothing.
Yes. Pass image when you create the sandbox, with any public linux/amd64 container image that contains /bin/sh, up to 4 GiB compressed. Docker Hub, ghcr.io, quay.io, gcr.io, public.ecr.aws, mcr.microsoft.com and nvcr.io are supported. The tag is pinned to its digest at create, so a later start runs the same image. Common images start in 6 to 20 seconds. Private images are not supported.
Two disks. /workspace is 5 to 40 GB, by plan, and it is the only part that survives a stop. Everything outside /workspace shares 20 GB on every plan, so apt and pip can install anywhere. Filling that disk makes writes fail, and the sandbox keeps running.
Everything under /workspace is kept and comes back when you start the sandbox again. The rest is reset, because start() boots a fresh container from the sandbox's image: installed packages, environment changes, /tmp and /root are gone.
Three clocks apply. It stops after its idle timeout, 1 hour by default, and a running command counts as activity. It stops after 24 hours of continuous running. Once stopped, it is deleted after 7 days unless you start it again.
A key that has the compute:sandbox scope, or an unrestricted key. A scoped key without that scope cannot create or use sandboxes. You set a key's scopes under API keys in the dashboard.
It moves to the failed state and is deleted within about 5 minutes, and /workspace is not kept. Only a clean stop() guarantees that your data survives, so write anything you want to keep to external storage.
Install the SDK, set DEEPINFRA_API_KEY to the key you use for inference, and create a sandbox. It runs code a few lines later.
Need an agent that stays on? See hosted agents.
© 2026 DeepInfra. All rights reserved.