> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vers.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute one bounded process inside a computer.

> An admitted checkpoint restore may still be starting: waits up to the
configured boot timeout before starting the command.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/computers/{computer_id}/exec
openapi: 3.1.0
info:
  title: Vers API
  description: >-
    REST API for creating, checkpointing, branching, and managing Vers computers
    and projects.
  version: 2.0.0
servers:
  - url: https://api.vers.sh
    description: Vers API
security:
  - bearerAuth: []
tags:
  - name: Computers
    description: Create, inspect, execute commands in, sleep, wake, and delete computers.
  - name: Branches
    description: Branch one or more computers from a live computer, checkpoint, or tag.
  - name: Checkpoints
    description: Capture, inspect, tag, and delete whole-computer checkpoints.
  - name: Projects
    description: >-
      Organize computers into projects with private service networks and grouped
      restores.
  - name: Operations
    description: Inspect and stream status events for asynchronous durable operations.
  - name: Images
    description: >-
      Import and manage custom OCI images, system images, and registry
      artifacts.
  - name: Repositories
    description: Manage checkpoint repositories, tags, and public catalog entries.
  - name: Domains
    description: Register and manage custom domains.
  - name: Environment Variables
    description: Manage account-level environment variables applied to new computers.
  - name: Account & System
    description: Inspect API key identity, usage, and control-plane health.
paths:
  /api/v2/computers/{computer_id}/exec:
    post:
      tags:
        - Computers
      summary: Execute one bounded process inside a computer.
      description: |-
        An admitted checkpoint restore may still be starting: waits up to the
        configured boot timeout before starting the command.
      operationId: exec_computer
      parameters:
        - name: computer_id
          in: path
          description: Computer identity
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VmExecRequest'
        required: true
      responses:
        '200':
          description: Process completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VmExecResponse'
        '401':
          description: Missing or invalid API key
        '404':
          description: Computer not found or not visible to the caller
        '408':
          description: Process timed out
        '409':
          description: Computer cannot currently execute a process
        '422':
          description: Process could not be started
        '501':
          description: Process execution is unsupported
        '502':
          description: Computer process service is unavailable
        '503':
          description: Checkpoint restore wait timed out; no process was started
components:
  schemas:
    VmExecRequest:
      type: object
      description: |-
        Request body for `POST /api/v2/computers/{computer_id}/exec` and its
        streaming variant.
      required:
        - command
      properties:
        command:
          type: array
          items:
            type: string
          description: Command and arguments to execute.
        env:
          type:
            - object
            - 'null'
          description: Optional environment variables to set for the process.
          additionalProperties:
            type: string
          propertyNames:
            type: string
        exec_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Optional exec identifier for tracking.
        keep_background:
          type: boolean
          description: >-
            Keep processes the command leaves running (for example `server &`)

            after it exits, as `docker exec` does. By default they are killed
            when

            the command exits. The reply arrives once the command exits; output

            the kept processes write afterwards is retained in the exec logs.
        stdin:
          type:
            - string
            - 'null'
          description: Optional stdin payload passed to the command.
        timeout_secs:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            Timeout in seconds. Omitted or zero uses 300 seconds; larger values
            are

            capped at 3600 seconds.
          minimum: 0
        working_dir:
          type:
            - string
            - 'null'
          description: Optional working directory for the command.
    VmExecResponse:
      type: object
      description: Response body for `POST /api/v2/computers/{computer_id}/exec`.
      required:
        - exit_code
        - stdout
        - stderr
      properties:
        exec_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Exec identifier associated with this run.
        exit_code:
          type: integer
          format: int32
          description: Exit code returned by the command.
        stderr:
          type: string
          description: UTF-8 decoded stderr (lossy).
        stdout:
          type: string
          description: UTF-8 decoded stdout (lossy).
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Vers API key (`VERS_API_KEY`) sent as `Authorization: Bearer <key>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.