Skip to main content
POST
Run a process
Start a process, stream its captured output over Server-Sent Events, and receive a final exit event. Use this endpoint when you want a single request for non-interactive command execution. If the process needs stdin, use Start Process, Process Stdin, and Close Process Stdin instead.

Endpoint

Use this endpoint on the sandbox proxy host:

Example Request

Request Body

  • command is required.
  • args defaults to [].
  • env defaults to {} and is applied to the process environment.
  • working_dir is optional.
  • user is optional and accepts a username, UID string, uid:gid string, or an object such as {"uid": 1000, "gid": 1000}.
  • timeout is optional. When set, Tensorlake kills the process if it is still running after that many seconds.
/processes/run always starts the process with stdin closed and stdout/stderr captured, even if stdin_mode, stdout_mode, or stderr_mode are present in the request body.

SSE Events

Tensorlake streams JSON payloads in SSE data: frames:
The first event contains handle, pid, and started_at. Output events contain line, timestamp, and stream. The final event contains exit_code or signal; if the kernel OOM killer ended the process, it includes signal: 9 and oom_killed: true.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
command
string
required
args
string[]
env
object
working_dir
string
user

Username, UID string, or uid:gid string.

timeout
number<double>

Maximum seconds to wait before killing the process.

Response

Process event stream

JSON payload carried in each Server-Sent Events data: frame from /api/v1/processes/run.

handle
integer<int64>
required
pid
integer<int32>
required
started_at
integer<int64>
required