---
title: "Execute a command synchronously"
method: POST
path: "/browsers/{id}/process/exec"
tags: ["Browser Processes"]
---

# Execute a command synchronously

`POST /browsers/{id}/process/exec`

## Path parameters

- `id` string, required

## Request body

- ProcessExecRequest — Request to execute a command synchronously.
  - `command` string, required — Executable or shell command to run.
  - `args` string[] — Command arguments.
  - `cwd` string, nullable — Working directory (absolute path) to run the command in.
  - `env` object — Environment variables to set for the process.
  - `as_user` string, nullable — Run the process as this user.
  - `as_root` boolean — Run the process with root privileges.
  - `timeout_sec` integer, nullable — Maximum execution time in seconds.

## Response `200`

Execution result

- ProcessExecResult — Result of a synchronous command execution.
  - `exit_code` integer — Process exit code.
  - `stdout_b64` string — Base64-encoded stdout buffer.
  - `stderr_b64` string — Base64-encoded stderr buffer.
  - `duration_ms` integer — Execution duration in milliseconds.

## Other responses

- `400` — Bad Request – invalid input
- `404` — Resource not found
- `500` — Internal Server Error

---

[API](https://skmtc.net/kernel/apis/kernel-api.md) · [All operations](https://skmtc.net/kernel/apis/kernel-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kernel/kernel-api/versions/9e8ce9fcf5e1/schema)
