Read command logs
GET /sandboxes/{id}/logs answers with what the commands of the sandbox wrote to stdout and stderr: every command
started through exec, /commands or the envd API, read from the command history. Entries come oldest first,
in E2B’s two shapes:
limit (default 1000, at most 10000) keeps the newest lines, stream is stdout, stderr or all, and start and
end (milliseconds since the epoch) bound the commands by when they started. A line carries the time its command
started. stderr lines have the level warn. Only the last 1 MiB of each stream of a command is kept. Finished commands of the last
6 hours also come from the stored history with the last 16 KiB of each stream, so an API restart keeps them and every API
instance shows them. A sandbox of another account is a 404.
Read CPU, memory and disk
Read how much CPU, memory and disk one of your sandboxes used over a window. The sample is E2B’sSandboxMetric, so
the E2B SDK’s getMetrics reads it unchanged.
start and end (milliseconds since the epoch, both optional) bound the window; a window that runs backwards is a
400. A sandbox of another account is a 404, the same as one that does not exist.