The $0.01 Computer
Give your AI agent a fresh Linux computer to run experiments, test programs, and get things done. One API key. One cent per run.
Your AI agent can now have a computer for $0.01.
A fresh Linux machine. Internet access. A filesystem. The ability to install packages, run commands, compile programs, and use Docker. Your agent sends a program, the computer runs it, and the results come back.
All through a single DeepAPI key.
Think about what this means. Every time your agent needs to test an idea, it can get a clean computer to try it on. You don't have to rent a server, configure SSH, or clean up whatever it installed afterward. DeepAPI creates the VM and discards it when the run finishes.
One cent per run. Up to 10 minutes.
Give your agent somewhere to experiment
An agent writes a program. It thinks the program works. It thinks one approach is faster than another. It thinks a package will do what you need.
Great. Give it a computer and let it find out.
This is what I find exciting about this endpoint. You can give an agent a place to run experiments, make mistakes, read the errors, and check its ideas against actual results. The next attempt can go into another fresh VM.
Maybe it needs to install an unfamiliar tool. Maybe it needs to test a script you would rather keep away from your laptop. Maybe it wants to compare 3 implementations before choosing one for your project.
These are all useful things to do. And the VM execution cost of 100 separate runs is $1. Your agent's model costs are separate, but trying an idea on a computer is now a very small part of the bill.
Let it prove which solution is faster
Imagine telling your agent:
Find the fastest way to remove duplicates from this dataset. Try 3 approaches, preserve the original order, check they produce the same result, and measure their speed inside a DeepAPI VM.
The agent writes the experiment. It can compare a simple loop, a set that tracks values it has already seen, and Python's dictionary method. All 3 run in the same VM, against the same data.
Then it brings back measurements.
The correctness check matters. A method that changes the order has solved a different problem. Speed only means something after the results are right. And the winner is specific to this dataset and environment. Change the data, run another experiment.
Here is a small version you can try. Save it as benchmark.py:
import json
import random
import statistics
import timeit
data = list(range(1000)) * 5
random.Random(42).shuffle(data)
def list_scan(values):
result = []
for value in values:
if value not in result:
result.append(value)
return result
def seen_set(values):
seen, result = set(), []
for value in values:
if value not in seen:
seen.add(value)
result.append(value)
return result
methods = {
"list_scan": list_scan,
"seen_set": seen_set,
"dictionary": lambda values: list(dict.fromkeys(values)),
}
expected = sorted(set(data), key=data.index)
timings = {}
for name, method in methods.items():
assert method(data) == expected, name
samples = timeit.repeat(lambda: method(data), repeat=5, number=5)
timings[name] = round(statistics.median(samples) * 1000 / 5, 3)
print(json.dumps({"median_ms": timings, "fastest": min(timings, key=timings.get)}))
Run it with one API key
Set DEEPAPI_API_KEY in your local environment. Save the following as
run_vm.py beside benchmark.py, then run python3 run_vm.py. It uses
Python's standard library, submits the program, and waits for the result.
The API key stays in the request header; it is never sent inside the VM's code.
import json
import os
from pathlib import Path
import time
from urllib.request import Request, urlopen
import uuid
base = "https://deepapi.co"
headers = {"Authorization": "Bearer " + os.environ["DEEPAPI_API_KEY"]}
body = {"language": "python", "code": Path("benchmark.py").read_text(),
"maxCostUsd": "0.01"}
request = Request(base + "/v1/vm/run", json.dumps(body).encode(),
{**headers, "Content-Type": "application/json",
"Idempotency-Key": str(uuid.uuid4())})
with urlopen(request, timeout=60) as response:
result = json.load(response)
while result.get("next") and result["next"]["method"] == "GET":
step = result["next"]
time.sleep(step["afterSecs"])
with urlopen(Request(base + step["path"], headers=headers), timeout=60) as response:
result = json.load(response)
if result["status"] != "succeeded":
raise RuntimeError(result.get("error"))
output = result["output"]
print(output["stdout"], end="")
if output["timedOut"] or output["exitCode"] != 0:
raise RuntimeError(output)
In a live VM check, this program returned:
{"median_ms":{"list_scan":18.986,"seen_set":0.159,"dictionary":0.165},"fastest":"seen_set"}
Those are median times per operation across 5 batches of 5 repetitions. Both faster methods beat the simple loop by a lot. The gap between them is tiny, so repeat the experiment before drawing a broader conclusion. Your numbers will differ.
Your existing agent can handle these steps too. The
DeepAPI skill
includes the VM workflow. Add this instruction to your project's AGENTS.md:
Use DeepAPI POST /v1/vm/run for temporary experiments and code execution.
Check correctness, exitCode, and timedOut before trusting the result.
Never include credentials in the submitted code.
The possibilities go well beyond this example
Give your agent public data to clean and analyze. Let it fetch several public APIs and combine the results. Have it install a command-line tool, compile generated code, or run a small test suite. Send a Dockerfile to build and run a container with the tools the task needs.
The input is one program, but that program can create more files and run multiple steps. You decide what you want to accomplish. Your agent writes the code to do it.
There are practical limits. Each run ends after 10 minutes at most. Files disappear with the VM, so print the results you need. This endpoint doesn't provide persistent hosting or file downloads. The API docs cover the full request and output format.
That still leaves an enormous amount of useful work.
The idea behind DeepAPI is to give agents the capabilities they need to act. A computer they can experiment on is a big one.
Get a DeepAPI key and give your agent an idea to test. Let it run the experiment. See what it finds.
FAQ
- What does the $0.01 computer actually include?
- Each POST /v1/vm/run creates a fresh Linux virtual machine with internet access, a writable filesystem, shell tools, sudo, and Docker. Your program can run for up to 10 minutes.
- Can I give it a plain-English task?
- Give the task to your AI agent. The agent writes and submits the code. The VM endpoint itself accepts code, not a plain-English instruction.
- Which languages can my agent use?
- The entry runtimes are Python, Node.js, Bun for TypeScript, Rust, C, and Dockerfile. Your program can install additional tools and create more files during the run.
- Does the computer stay running afterward?
- No. Each call gets a fresh VM that is discarded afterward. There is no persistent session, SSH access, or lasting web hosting.
- What happens if my program fails?
- Check the returned exit code, stderr, and timedOut flag. A program error does not make the run free, and timed-out runs still cost $0.01. Provider or setup failures are free.
- How do I get the results back?
- Print results to stdout. The API returns stdout, stderr, and exit details. Each output stream is capped at 512 KiB. Files are not returned as attachments or download links.
Originally published at https://deepapi.co/blog/the-001-computer.