---
title: "Exec Browser Command"
method: POST
path: "/browser-sessions/{session_id}/exec"
---

# Exec Browser Command

`POST /browser-sessions/{session_id}/exec`

## Path parameters

- `session_id` string, required

## Request body

- ExecRequest — Run one command inside a sandbox.
  - `command` string, required
  - `timeout` integer
  - `shell` 'login' | 'raw'
  - `cwd` string, nullable — Absolute working directory in the guest.
  - `env` object

## Response `200`

Successful Response

- ExecResponse — Captured command result. Non-zero exits are successful HTTP responses.
  - `exit_code` integer, required
  - `stdout` string, required
  - `stderr` string, required
  - `duration_ms` integer

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-13** `1c971ff55cd2` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/celestoai/apis/smolvm/changes/browser-sessions/:session_id/exec/post.md)

---

[API](https://skmtc.dev/celestoai/apis/smolvm.md) · [All operations](https://skmtc.dev/celestoai/apis/smolvm/llms.txt) · [OpenAPI document](https://skmtc.dev/celestoai/apis/smolvm/revisions/4d88cab246b2?raw)
