Create a sandbox

Preview. Start a sandbox from a template, with a preset size or a custom one. It runs until its timeout or a delete.

The answer comes when the sandbox runs. The environment goes to the sandbox only, and no answer returns it. With command, the sandbox runs that command first, and the answer has its result in command. With disk_gib, the root disk is larger than the template's.

POST
/sandboxes

Authorization

headerAuthorizationBearer <token>

Your Munito API key.

Header Parameters

idempotency-key?|

A retry with the same key answers the sandbox of the first request.

Request Body

application/json
  1. body

Name a preset in size, or give vcpus and memory_mib for a custom size, or neither for the default.

template?string

The root filesystem. base, the default: Debian 12 with Python 3.12, Node 24, git and build tools. ubuntu: Ubuntu 24.04 with systemd, Docker running, Python 3.12, Node 24, and the agent harnesses Claude Code, Codex and OpenCode. desktop: ubuntu with an Xfce desktop and Firefox, which a browser opens on port 6080. A desktop needs 2 vCPUs and 4096 MiB at least.

Default"base"
size?|

A preset: small, default, large. Without size, vcpus and memory_mib, the size is default.

vcpus?|

A custom size: from 1 to 16 vCPUs, with memory_mib.

memory_mib?|

A custom size: from 512 to 32768 MiB in steps of 256, at least 512 for each vCPU.

disk_gib?|

The root disk in GiB: from 10 to 100, 10 by default. A larger disk grows when the sandbox starts, which adds some milliseconds to the start.

timeout?|

Seconds from now until the sandbox stops, or pauses when it is persistent: from 10 to 86400, 3600 by default.

env?

Environment variables of every command, at most 100. No answer returns them.

metadata?

Your own keys and values, at most 16. The sandbox does not see them.

internet?boolean

Outbound internet access. Its ports and SSH take inbound connections with or without it.

Defaulttrue
command?|array<string>|

A command to run once the sandbox starts, in /workspace with env, for at most 60 seconds. A string runs in bash -lc. A list is the argument vector.

persistent?boolean

Keep the files and the processes across a pause: the sandbox can pause, resume and fork, and its timeout pauses it. A paused sandbox pays for the storage of its saved state only.

Defaultfalse
public_ports?array<>

Ports that anyone may open at their URL, without the sandbox's token, at most 16. Every other port is private.

ssh_keys?array<string>

Public keys that open SSH to the sandbox, each a line of authorized_keys, at most 16. Without one, SSH takes no connection.

networks?array<string>

The ids of the networks that the sandbox joins, at most 10. A persistent sandbox cannot join a network yet.

hostname?|

The name of the sandbox in its networks: the other members reach it at <hostname>.<network>.internal. A DNS label, unique in each network. By default, its id with a hyphen for the underscore.

Response Body

The sandbox: running, or pending while its start takes longer.

application/json
  1. response
id*string
object?string
Default"sandbox"
status*SandboxStatus

pending until it runs, then running, then stopped. failed when it did not start. A persistent sandbox is paused between a pause and a resume, and pending while it resumes.

Value in"pending""running""paused""stopped""failed"
template*string
size*string

The preset, or custom.

vcpus*integer
memory_mib*integer
disk_gib*integer

The root disk in GiB.

internet*boolean
persistent*boolean

The sandbox keeps its files and its processes across a pause.

metadata*
created_at*integer

Unix seconds.

started_at*|

Unix seconds, or null before the sandbox runs.

expires_at*integer

Unix seconds. The sandbox stops then, or pauses when it is persistent.

ended_at*|

Unix seconds, or null while the sandbox runs.

end_reason*|

deleted, timeout or error, or null while the sandbox runs.

public_ports?array<integer>

The ports that open without the sandbox's token.

ssh_keys?array<string>

The public keys that open SSH to the sandbox.

hostname?|

The name of the sandbox in its networks, or null for its id.

networks?array<>

The networks that the sandbox is a member of.

command?|

The result of command. Null without a command, when the command could not run, and for a retry with the same Idempotency-Key. The sandbox runs in each case.

curl -X POST 'https://api.munito.ai/sandboxes/v1/sandboxes' \
  -H 'Content-Type: application/json' \
  -d '{}'
Example Response
{
  "id": "string",
  "object": "sandbox",
  "status": "pending",
  "template": "string",
  "size": "string",
  "vcpus": 0,
  "memory_mib": 0,
  "disk_gib": 0,
  "internet": true,
  "persistent": true,
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "created_at": 0,
  "started_at": 0,
  "expires_at": 0,
  "ended_at": 0,
  "end_reason": "deleted",
  "public_ports": [
    0
  ],
  "ssh_keys": [
    "string"
  ],
  "hostname": "string",
  "networks": [
    {
      "id": "string",
      "name": "string",
      "dns_name": "string",
      "address": "string"
    }
  ],
  "command": {
    "exit_code": 0,
    "stdout": "string",
    "stderr": "string",
    "duration_ms": 0,
    "timed_out": true,
    "truncated": true
  }
}