Skip to main content
POST
/
v1
/
sandboxes
/
{id}
/
fork
curl -X POST https://api.podflare.ai/v1/sandboxes/$SID/fork \
  -H 'content-type: application/json' \
  -d '{"n": 5}'
{
  "children": [
    "sbx_a1ac8f28d473413585d8f4f425bcc2b1",
    "sbx_03cfbf63bb394575aefa4e6c62874998",
    "sbx_532288c716c8424cb8bb549e6ce2748b",
    "sbx_bca65926af5f4afcaa6b8f20a66845b2",
    "sbx_267b68883b41469fbda8973296767542"
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.podflare.ai/llms.txt

Use this file to discover all available pages before exploring further.

id
string
required
Parent sandbox id.
n
int
default:"1"
Number of children to spawn. Range 1..=32.
curl -X POST https://api.podflare.ai/v1/sandboxes/$SID/fork \
  -H 'content-type: application/json' \
  -d '{"n": 5}'
{
  "children": [
    "sbx_a1ac8f28d473413585d8f4f425bcc2b1",
    "sbx_03cfbf63bb394575aefa4e6c62874998",
    "sbx_532288c716c8424cb8bb549e6ce2748b",
    "sbx_bca65926af5f4afcaa6b8f20a66845b2",
    "sbx_267b68883b41469fbda8973296767542"
  ]
}

What children inherit

Each child starts from the parent’s state at the moment of snapshot:
  • Python REPL state — variables, imports, open files.
  • Filesystem — everything written to the parent’s rootfs so far.
  • Full VM memory — page-level CoW shared with siblings; divergence only costs the pages a child mutates.

Parent impact

  • Paused for ~80 ms during snapshot. Resume is automatic.
  • exec calls on the parent made after fork returns are NOT visible in children. Each child only sees pre-fork state.

Timing (Hetzner EX63)

nTotal fork latency
192 ms
2102 ms
5101 ms
Spawn cost is near-flat in N because children boot in parallel (~10 ms each) and the snapshot+merge happens once.

Requirements

Parent must be a pool-warm sandbox (or itself a fork child). Sandboxes created with custom RAM / rootfs skip the warm pool and cannot be forked — fork will return 500 on those.