Foundational Compute

Quickstart

Start an isolated Linux sandbox and run a command in it, from the terminal and from code. It takes about 5 minutes.

Using an AI coding agent? Paste this into Claude Code, Cursor or another agent. It reads our docs and asks you before it runs anything.

I want to use Foundational Compute (https://fdtn.dev) to run code in cloud sandboxes.
Read https://fdtn.dev/llms.txt first, and follow only what it says.
Explain each command before you run it, and ask me before you install anything.
I will sign in myself with fdtn auth. Never ask me to paste my API key into this chat.

1Create an API key

  1. Sign in at compute.fdtn.dev with Google or GitHub. The first sign-in creates your personal workspace.
  2. Open API keys and create a key. It starts with fdtn_.
  3. Copy it. The page shows it only once. Do not paste it into a chat or a project file.

A personal workspace starts with a $20 welcome credit, with no card. Credit

2Install the CLI

The fdtn command needs Node.js 22.19 or newer and npm (nodejs.org). Do not type the $.

macOS · Linux · Windows

$ curl -fsSL https://compute.fdtn.dev/install | sh

The script checks the sha256 checksum and installs with npm i -g. It does not touch your API key. Install errors

3Sign in and test

$ fdtn auth
Paste your API key from https://compute.fdtn.dev, then press Return:
Key saved. You are signed in.

The key goes to ~/.fdtn/key, readable only by you. The CLI and SDKs read it there. On a server or in CI, set FDTN_API_KEY; it wins over the file. API keys

Test the setup. This starts a small sandbox, runs a command and stops it:

$ fdtn doctor --create
✓ api key: from key file, starts with fdtn_, 45 characters
✓ dns: api.sbx.fdtn.dev -> 203.0.113.10
✓ tls: certificate for api.sbx.fdtn.dev accepted
✓ key accepted: listed your sandboxes
✓ sandbox round trip: i... started in 111 ms, ran a command, stopped

A failed check starts with ✗ and has a fix: line under it. fdtn doctor results

4Start a sandbox

A sandbox is a separate Linux computer. A template is the system it starts from; base is the default.

$ fdtn create base
Starting a sandbox from template base...
Terminal connecting to template base with sandbox ID i...
user@fdtn:~$

You get a terminal inside the sandbox. Type exit to leave; the sandbox then stops.

Size2 vCPU, 512 MiB, 5 GiB disk: $0.039 an hour. Pricing
InstalledDebian 12, Python 3.11, pip, Node.js 20, git, curl
Lifetime5 minutes by default, up to 24 hours
StartUnder 500 ms
CPUarm64

5Control it from your terminal

$ fdtn create base -d --name worker   # start only, print the id
$ fdtn exec @worker echo hello        # run a command, get its output and exit code
$ fdtn connect @worker                # open a terminal inside
$ fdtn cp -r @worker:/tmp ./out       # download files
$ fdtn ls                             # list your running sandboxes
$ fdtn pause @worker                  # keep memory and files, stop the clock
$ fdtn resume @worker                 # bring it back
$ fdtn kill @worker                   # stop it for good
  • -d starts without a terminal. The sandbox stops after 5 minutes, or after --timeout <seconds>.
  • Each command that uses the sandbox sets its time left to at least 5 minutes.
  • @name replaces the ID. A new name can take a few seconds to resolve.

6Use it from code

Python needs 3.11 or newer; install into a virtual environment (python3 -m venv .venv && . .venv/bin/activate). TypeScript needs Node.js 22.19 or newer. The SDKs do not need the fdtn command: set FDTN_API_KEY.

  1. Install the SDK:

Python · TypeScript

$ pip install https://compute.fdtn.dev/install/fdtn-0.1.5-py3-none-any.whl
  1. Save this file and run python hello.py or node hello.mjs (the TypeScript SDK is ESM). It prints hello.

Python · TypeScript

hello.py
from fdtn import Sandbox

# timeout: how long the sandbox lives, in seconds.
# request_timeout: how long the SDK waits for the start, in seconds.
sbx = Sandbox.create("base", timeout=300, request_timeout=120)
try:
    result = sbx.commands.run("echo hello")
    print(result.stdout)
finally:
    sbx.kill()

The SDK waits 60 seconds for a start by default. A create can wait up to 30 minutes in the queue; for batches, set request_timeout=1800 or requestTimeoutMs: 1_800_000. The queue

Next