這個頁面還沒有翻譯成繁體中文:以下是英文版。
A sandbox is a virtual machine of its own: a Firecracker microVM that runs an OCI image, the kind docker builds and registries serve. You make one with an API call. Then you run commands in it, read and write its files, open a terminal or a link to one of its ports. Commands and files reach it through an agent inside the machine, not through its network.
When nothing happens in it, a sandbox sleeps. It keeps its memory, its processes and its disk, and the next call wakes it where it was, in milliseconds. It stays until you delete it.
When to use Sandbox
- An AI agent’s computer: a coding agent, a browser agent or a code interpreter that runs commands, installs packages and keeps its work between turns.
- Code you did not write: what users or models send you, kept away from your own machines and from each other, with network rules and secrets the code never sees.
- A job per request:
glac runmakes a sandbox, runs one command and deletes it. - Environments that branch: a snapshot of a running sandbox, and copies (forks) that each go on from that moment.
- A server of its own: with
init: "systemd"the image’s own systemd is its PID 1, for packages, services, cron and SSH as on any server (a whole system).
To serve an image at an address, with instances that start for requests, use Cube. Both run on the same machines, at the same prices.
How it works
- Make.
POST /v1/sandboxes(glac sandboxes create) with an image, or with none for the platform’s default image. The first sandbox of an image waits while the platform pulls it and saves a template. Later ones are copies of that template, from a pool that is already running. - Use. Run commands (
exec), read and write files, open a terminal, give out links to ports. Calls wait for a sandbox that is starting or asleep: none fails for that. - Sleep. After
sleep_after_secondsidle (30 unless you say), it sleeps. Whatever needs it wakes it: a command, a file, a request on a link, a timer.
What it costs
A sandbox pays for the CPU it uses and the memory it holds while it is awake. Asleep, it pays for what it keeps: its memory and the part of its disk that is its own. One held paused in the machine’s memory pays for that memory as if awake, and no CPU.
| 計量項目 | 價格 | 免費版,每天 | 付費版每月內含 |
|---|---|---|---|
| CPU,運算時計費 | 每百萬 CPU 毫秒 $0.01 | 100萬 CPU 毫秒 | 6000萬 CPU 毫秒 |
| 記憶體,醒著或暫停在記憶體中時計費 | 每 GiB 每小時 $0.008 | 6 GiB 小時 | 250 GiB 小時 |
| 請求:送往方塊,或經由沙箱連結 | 每百萬次 $0.30 | 100,000 | 1000萬 |
| 休眠中執行個體保存的內容(記憶體和它自己的磁碟) | 每 GB 每月 $0.02 | 資料總共 15 GB,含快照和磁碟 | 20 GB 月的資料,含快照和磁碟 |
| 快照保存的內容 | 每 GB 每月 $0.02 | 同上,合併計算 | 同上,合併計算 |
| 從北美洲傳到網際網路的傳出流量 | 每 GB $0.004 | 3 GB,來自任何區域 | 1 TB,來自任何區域 |
| 從歐洲傳到網際網路的傳出流量 | 每 GB $0.004 | ||
| 從亞太地區傳到網際網路的傳出流量 | 每 GB $0.01 |
On Free, what an instance uses comes out of the day’s quotas; Paid includes a quantity of each meter every month, and past it usage is paid from the balance at these prices. See pricing and plans.
Limits of each plan
| 免費版 | 付費版 | |
|---|---|---|
| 最大執行個體 | 2 vCPU、4 GiB | 8 vCPU、16 GiB |
| 同時醒著的執行個體 | 5 | 500 |
| 它們的 vCPU 總和 | 10 | 500 |
| 它們的記憶體總和 | 10 GiB | 1,000 GiB |
| 保留的休眠中執行個體 | 20 | 10,000 |
| 每分鐘建立的沙箱 | 10 | 600 |
| 單一專案每小時建立的沙箱 | 200 | 10,000 |
The sandboxes awake, their vCPUs and their memory are counted for the whole account: sandboxes and Cubes’ instances of every project together. Every limit is on the limits page.
Next
- Quickstart: make a sandbox, run a command, copy files, open a port, with the command line, Python or the console.
- Commands, files and terminals: running commands, their output, files, terminals, images.
- Sleep and wake: what puts a sandbox to sleep, what wakes it, keeping it awake from inside.
- Snapshots and forks: saving a sandbox as it is, going back, copies that go on, templates.
- Links, tokens and SSH: links to ports, tokens for one sandbox, SSH.
- Network rules and secrets: what a sandbox may reach, and secrets it uses without holding them.