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…)
postgresPostgreSQL
A PostgreSQL database for your apps, on its own disk. Link it to an app and it gets DATABASE_URL.
PostgreSQL 15, database and login "app" · Its data on the instance's own disk · Always on; reached only from your own linked instances · Its password made for it, never stored
mariadbMariaDB (MySQL)
A MariaDB database, MySQL-compatible (WordPress, Laravel…). Link it to an app and it gets DATABASE_URL.
MariaDB 10.11, database and login "app" · Its data on the instance's own disk · Always on; reached only from your own linked instances · Its password made for it, never stored
redisRedis
A Redis store for caches, queues and sessions. Link it to an app and it gets REDIS_URL.
Redis 7, with a password · Saved to the instance's own disk (append-only file) · Always on; reached only from your own linked instances

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", …}

Databases

Two ways to give an app (or any persistent instance) a database. Either way it gets the address as a setting (DATABASE_URL, REDIS_URL, or a name you choose) and restarts with it.

# 1. A Postgres instance
DB=$(curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances" \
  -H "Authorization: Bearer $DC_KEY" -H "Content-Type: application/json" \
  -d '{"template":"postgres","name":"shop-db","diskGb":5}' | jq -er '.id')

# 2. Link it to your app: it gets DATABASE_URL and restarts
curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances/$APP_ID/databases" \
  -H "Authorization: Bearer $DC_KEY" -H "Content-Type: application/json" \
  -d "{\"instance\":\"$DB\"}"

# Or one you already have
curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances/$APP_ID/databases" \
  -H "Authorization: Bearer $DC_KEY" -H "Content-Type: application/json" \
  -d '{"url":"postgres://user:pass@ep-cool.eu-central-1.aws.neon.tech:5432/app?sslmode=require"}'

# Does it connect, from inside the app?
curl --fail-with-body -sS -X POST "https://digicompute.app/v1/instances/$APP_ID/databases/<link id>/test" \
  -H "Authorization: Bearer $DC_KEY"
{"id":"lnk_…","kind":"postgres","env":"DATABASE_URL","host":"db-….internal","port":5432,
 "instance":{"id":"inst_…","name":"shop-db"},"url":"postgres://app:…@db-….internal:5432/app","restarted":true}

A database instance's address (with its password) is also at GET /v1/instances/<db>/connection. It can't be deleted while an instance uses it. No backups yet: keep your own copies of data you can't lose.

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

SizevCPUMemoryDiskPer hour (INR)Per hour (USD)
mini0.5512 MB2 GB₹0.95$0.0125
small11 GB5 GB₹1.90$0.025
medium24 GB10 GB₹4.60$0.06
large48 GB20 GB₹9.20$0.12

Billed to the second while running, from your prepaid credit, in your account's currency (rupees or dollars, chosen at sign-up). A persistent instance's disk is ₹7 ($0.10) per GB a month, running or stopped. GET /v1/usage gives your balance (credit.balance, in paise or cents; credit.currency) and this month's spend.

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
POST · GET/v1/instances/:id/databasesinstance (a database instance of yours) or url (a connection string), env; the list
DELETE/v1/instances/:id/databases/:link
POST/v1/instances/:id/databases/:link/testconnects from inside the instance: { ok, ms }
GET/v1/instances/:id/connectiona database instance's address, login and password
GET/v1/templatesthe templates (kind: sandbox) and ready-made apps (kind: app, with what each asks for); no key needed
POST/v1/instancesan app: persistent: true, network, app: { command, port } (or template, inputs); its address is app.url
GET/v1/instances/:id/app/logsthe app's latest output
POST/v1/instances/:id/app/restart
PATCH/v1/instances/:idapp: { command } starts it again with a new start command; env: { NAME: 'value', OLD: null } sets and removes its environment variables (apps only), then starts it again

Errors

CodeWhen
400Something sent is wrong; the message says what
401No key, or a wrong or revoked one
402Your balance is used up (top up in the console), or a limit on persistent instances, disk or apps is reached
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