DigiCompute

Quickstart

Make a key in the console, then paste these in order: start an instance, run a command, move files, stop it. Every call takes Authorization: Bearer dc_…; base address https://digicompute.app.

0. Your key

Keep it in an environment variable; every example below reads DC_KEY.

export DC_KEY="dc_…"

1. Start an instance

# Start an instance (it lives 10 minutes unless timeoutSec says otherwise) and keep its id
INSTANCE=$(curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances" \
  -H "Authorization: Bearer $DC_KEY" \
  -H "Content-Type: application/json" \
  -d '{"size":"small","timeoutSec":600}')
export INSTANCE_ID=$(printf '%s' "$INSTANCE" | jq -er '.id')
echo "$INSTANCE"
{"id":"inst_8f2k1q9vx3","status":"running","size":"small","network":"none",
 "expiresAt":"…","maxExpiresAt":"…","limits":{"cpus":1,"memoryMb":1024,"diskGb":5}, …}

The curl examples that follow use $INSTANCE_ID, set above with jq (or by hand: export INSTANCE_ID=inst_8f2k1q9vx3). --fail-with-body makes a refused call fail in scripts while still printing why. Anything that goes wrong comes back as {"error": "…"} saying what (errors).

2. Run a command

curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances/$INSTANCE_ID/exec" \
  -H "Authorization: Bearer $DC_KEY" \
  -H "Content-Type: application/json" \
  -d '{"command":"python3 -c \"print(6*7)\"","timeoutSec":60}'
{"exitCode":0,"stdout":"42\n","stderr":"","timedOut":false,"durationMs":432}

Also cwd and env ({"DEBUG":"1"}).

3. Move files

Write a file (the body is the file), read it back, list a folder.

# write
curl --fail-with-body -sS -X PUT "https://digicompute.app/v1/instances/$INSTANCE_ID/files?path=/work/app.py" \
  -H "Authorization: Bearer $DC_KEY" --data-binary @app.py
# read
curl --fail-with-body -sS "https://digicompute.app/v1/instances/$INSTANCE_ID/files?path=/work/app.py" \
  -H "Authorization: Bearer $DC_KEY" -o app.py
# list
curl --fail-with-body -sS "https://digicompute.app/v1/instances/$INSTANCE_ID/list?path=/work" \
  -H "Authorization: Bearer $DC_KEY"

4. Extend or stop

It stops by itself when its time runs out (how long it lives); more time is one call.

# 30 more minutes
curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances/$INSTANCE_ID/extend" \
  -H "Authorization: Bearer $DC_KEY" -H "Content-Type: application/json" \
  -d '{"seconds":1800}'
# done: stop it (the counting stops too)
curl --fail-with-body -sS -X DELETE "https://digicompute.app/v1/instances/$INSTANCE_ID" -H "Authorization: Bearer $DC_KEY"

Templates

A template is what an instance starts from. Pass "template" when you create one; without it you get base. Every template is driven the same way: commands through exec, files through the files API.

templateWhat it isWhat's in it
base defaultLinux sandbox
A plain Linux sandbox: Node, Python, git and build tools. No agent.
Debian 12 (bookworm) · Node.js 24 and npm · Python 3.11 with pip and venv (python, pip) · git, curl, wget, jq, ripgrep, zip · build-essential (gcc, make), pkg-config
openclawOpenClaw
OpenClaw general agent: headless browser, code, files.
Everything in Linux sandbox · OpenClaw (openclaw on PATH) · Headless Chromium for its browser tool · Bring your model key as env (ANTHROPIC_API_KEY, OPENAI_API_KEY…)

An OpenClaw instance: your model key goes in as env (only its name is kept; never shown back), and it needs the internet to reach the model ("network": "open", when your plan includes it).

# Start an OpenClaw instance with your model key
INSTANCE=$(curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances" \
  -H "Authorization: Bearer $DC_KEY" \
  -H "Content-Type: application/json" \
  -d '{"template":"openclaw","size":"medium","network":"open","timeoutSec":1800,
       "env":{"ANTHROPIC_API_KEY":"'"$ANTHROPIC_API_KEY"'"}}')
export INSTANCE_ID=$(printf '%s' "$INSTANCE" | jq -er '.id')

# Give it a task
curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances/$INSTANCE_ID/exec" \
  -H "Authorization: Bearer $DC_KEY" \
  -H "Content-Type: application/json" \
  -d '{"command":"openclaw agent --local --model anthropic/claude-sonnet-5-5 --message \"Find the latest Node.js LTS version and write it to /work/node.txt\"","timeoutSec":600}'

# Every template there is
curl --fail-with-body -sS "https://digicompute.app/v1/templates"
{"id":"inst_…","status":"running","template":"openclaw","size":"medium","network":"open", …}

How long an instance lives

An instance stops by itself when its time runs out: 10 minutes unless it's made with timeoutSec. Nobody needs to come back to this site for more time; your code asks for it, up to the plan's longest life, counted from when the instance started (Free: 200 hours). You're billed for the time it runs, not the time asked for, so delete it when the work is done.

Every instance's answer has expiresAt (when it stops now) and maxExpiresAt (the latest it can be moved to).

# Stops after 15 minutes without a command or file call
curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances" \
  -H "Authorization: Bearer $DC_KEY" -H "Content-Type: application/json" \
  -d '{"size":"small","timeoutSec":900,"extendOnActivity":true}'

# Switch it on (or off) for one that's running
curl --fail-with-body -sS -X PATCH "https://digicompute.app/v1/instances/$INSTANCE_ID" \
  -H "Authorization: Bearer $DC_KEY" -H "Content-Type: application/json" \
  -d '{"extendOnActivity":true}'
201 {"id":"inst_…","status":"running","expiresAt":"…T10:15:00Z",
     "maxExpiresAt":"…T11:00:00Z","extendOnActivity":true, …}

A workspace that keeps its files

A persistent instance has its own disk at /work. It stops by itself when idle (no compute hours while stopped) and starts again on the next command or file call, files where they were. Delete it to remove the disk.

curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances" \
  -H "Authorization: Bearer $DC_KEY" -H "Content-Type: application/json" \
  -d '{"size":"small","persistent":true,"diskGb":10,"idleTimeoutSec":900}'

# later, even after it stopped: it starts again
curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances/$INSTANCE_ID/exec" \
  -H "Authorization: Bearer $DC_KEY" -H "Content-Type: application/json" \
  -d '{"command":"ls /work"}'

# stop and start by hand
curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances/$INSTANCE_ID/stop" -H "Authorization: Bearer $DC_KEY"
curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances/$INSTANCE_ID/start" -H "Authorization: Bearer $DC_KEY"

Give your agent a "run code" tool

Describe one tool to your model; when it calls the tool, your code starts an instance, runs the command, returns the output and deletes the instance. Any model or framework with tool calls works the same way.

{
  "name": "run_code",
  "description": "Run a shell command in a fresh, isolated Linux computer and return its output.",
  "input_schema": {
    "type": "object",
    "properties": {
      "command": { "type": "string", "description": "e.g. python3 -c \"print(6*7)\"" },
      "files": { "type": "object", "description": "Optional: path → contents, written before the command" }
    },
    "required": ["command"]
  }
}

When the model calls it, run this and hand back what it returns:

# The same four calls, from a shell
INSTANCE=$(curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances" \
  -H "Authorization: Bearer $DC_KEY" -H "Content-Type: application/json" \
  -d '{"size":"small","network":"none","timeoutSec":600}')
INSTANCE_ID=$(printf '%s' "$INSTANCE" | jq -er '.id')
curl --fail-with-body -sS -X PUT "https://digicompute.app/v1/instances/$INSTANCE_ID/files?path=/work/main.py" \
  -H "Authorization: Bearer $DC_KEY" --data-binary @main.py
curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances/$INSTANCE_ID/exec" -H "Authorization: Bearer $DC_KEY" \
  -H "Content-Type: application/json" -d '{"command":"python3 /work/main.py","timeoutSec":60}'
curl --fail-with-body -sS -X DELETE "https://digicompute.app/v1/instances/$INSTANCE_ID" -H "Authorization: Bearer $DC_KEY"

Give the agent its own key (API keys in the console), so its instances, sizes and hours have their own limits.

Sizes

SizevCPUMemoryDiskCompute hours per hour
mini0.5512 MB2 GB0.5
small11 GB5 GB1
medium24 GB10 GB2
large48 GB20 GB4

network: none (no network), limited (allowed hosts only) or open, when your plan includes the internet.

Every endpoint

POST/v1/instancestemplate (base when none), size, network, timeoutSec, extendOnActivity, env, metadata; persistent, diskGb, idleTimeoutSec; waitSec to wait for room instead of a 503
GET/v1/instancesyours that run; ?all=1 for stopped ones too
GET/v1/instances/:id
POST/v1/instances/:id/extendseconds, up to maxExpiresAt
PATCH/v1/instances/:idname, metadata, extendOnActivity; idleTimeoutSec and autoStop for persistent ones
POST/v1/instances/:id/stop · /startpersistent instances
DELETE/v1/instances/:id
POST/v1/instances/:id/execcommand, cwd, env, timeoutSec
PUT · GET/v1/instances/:id/files?path=
GET/v1/instances/:id/list?path=
GET/v1/usagethis month: instances, running time, compute hours, your limits
GET/v1/templatesthe templates an instance can start from (kind: sandbox); no key needed

Errors

CodeWhen
400Something sent is wrong; the message says what
401No key, or a wrong or revoked one
402This month's compute hours are used up (plan and hour packs)
403Not in your plan or key: a bigger size, the internet, a longer life; or the account is suspended
404No such instance for this key
409The instance has stopped
429Too many instances at once for this key or plan
503No server has room for that size right now: try again shortly