Preview. Run one command in a running sandbox, and answer its exit code and its output.
With stream, the answer is NDJSON: stdout and stderr events with text as the command writes it, then
one exit or error event.
AuthorizationBearer <token>Your Munito API key.
sandbox_id*stringThe id of the sandbox.
application/json- body
A string runs in bash -lc; a list is the argument vector itself.
command*|array<string>A string runs in bash -lc. A list is the argument vector itself.
cwd?|The working directory, /workspace by default.
env?More environment variables for this command.
timeout?|Seconds until the command is stopped: from 1 to 1800, 60 by default.
stdin?|Text for standard input, which then closes. Without it, standard input is empty.
stream?booleanAnswer NDJSON events as the command writes, instead of one result at its end.
falseOne result, or with stream the NDJSON events.
- response
exit_code*integerThe exit code. A command that a signal stopped has 128 plus the signal.
stdout*stringStandard output as UTF-8 text, at most 1048576 bytes.
stderr*stringStandard error as UTF-8 text, at most 1048576 bytes.
duration_ms*integerHow long the command ran.
timed_out*booleanThe command ran past its timeout and was stopped.
truncated*booleanA stream passed its limit, and the rest is left out.
curl -X POST 'https://api.munito.ai/sandboxes/v1/sandboxes/string/exec' \
-H 'Content-Type: application/json' \
-d '{
"command": "string"
}'{
"exit_code": 0,
"stdout": "string",
"stderr": "string",
"duration_ms": 0,
"timed_out": true,
"truncated": true
}