Examples
Complete, tested programs with output, cost and cleanup.
Before you start
- Run
fdtn author setFDTN_API_KEY. Quickstart - Install the SDK:
pip install https://compute.fdtn.dev/install/fdtn-0.1.5-py3-none-any.whlornpm i https://compute.fdtn.dev/install/fdtn-sdk-0.1.5.tgz. - Save the code in a new folder. TypeScript files are ESM (
.mjs).
For a coding agent, add .md to the page address, for example https://fdtn.dev/docs/examples/preview.md.
AI agents
Run code from an LLMRun untrusted code with a time limit and read the result.
Give an agent a code toolA tool-use loop with a run_code tool backed by a sandbox.
Test a change to a repoRun the tests, apply a change, test again and get the diff.
Run an AI engineerGive an AI agent its own computer that pauses between tasks, with your key.
Run Claude Code from codeGive Claude Code one task in a sandbox and read the result.
Work at scale
Split a test suiteRun test shards in many sandboxes and collect the reports.
Grade evals in parallelGrade model answers in many sandboxes at the same time.
Run a headless browserBuild a Playwright template and screenshot a JavaScript page.
Data and apps
Analyze a CSV fileUpload a data file, run pandas and download the chart.
Preview a web appStart a server on a public port and share its URL with people.
Pause a workerPause an idle sandbox with its memory and resume it later.
Receive webhooksA webhook receiver that checks signatures and drops duplicates.
Rules in every example
- Each sandbox has a lifetime, so it ends even if your code stops early.
- Code kills each sandbox in
finally. Scripts end withfdtn kill. - Metadata on each sandbox lets
fdtn ls -mandfdtn kill --all -mfind leftovers. - Costs use $0.018 per vCPU-hour and $0.006 per GiB-hour.
basecosts $0.039 per hour. Pricing