n independent children, each starting from that same state. Children share memory pages with their siblings via copy-on-write — a child only consumes additional memory for the pages it actually modifies. Use fork to explore multiple plans in parallel without duplicating work done in the parent.
Request
The parent sandbox id.
Number of child sandboxes to spawn. Must be between 1 and 32 inclusive. Requests with
n > 32 return 400.Response
Array of
n new sandbox ids. Each id is immediately usable — children are booted in parallel and are ready when the response arrives.Examples
What children inherit
Each child starts from the parent’s state at the moment of the snapshot:- Python REPL state — all variables, imports, and open file handles
- Filesystem — everything written to the parent’s rootfs up to the fork point
- Full VM memory — pages are shared copy-on-write with siblings; a child only pays for pages it mutates
exec calls made on the parent after fork returns are not visible to children. Each child only sees the pre-fork state.
Parent impact
The parent is paused for approximately 80 ms while the snapshot is taken. It resumes automatically oncefork returns.
Timing reference
| n | Total fork latency |
|---|---|
| 1 | 92 ms |
| 2 | 102 ms |
| 5 | 101 ms |
n because children boot in parallel (~10 ms each) and the snapshot and merge step happens only once.
Requirements
Error responses
| Status | Body | Cause |
|---|---|---|
400 | {"error": "n must be between 1 and 32"} | n is out of range |
401 | {"error": "invalid api key"} | Missing or invalid bearer token |
404 | {"error": "sandbox not found"} | Parent id does not exist |
500 | {"error": "..."} | Parent has no Firecracker API socket or snapshot failed |