---
title: "Execute a command"
method: POST
path: "/process"
tags: ["process"]
---

# Execute a command

`POST /process`

Execute a command and return process information. If Accept header is text/event-stream, streams logs in SSE format and returns the process response as a final event.

## Request body

- ProcessRequest
  - `command` string, required
  - `env` object
  - `keepAlive` boolean — Disable scale-to-zero while process runs. Default timeout is 600s (10 minutes). Set timeout to 0 for infinite.
  - `maxRestarts` integer — Maximum number of restarts on failure. Set to a negative value (e.g. -1) for unlimited restarts.
  - `name` string
  - `restartOnFailure` boolean
  - `timeout` integer — Timeout in seconds. When keepAlive is true, defaults to 600s (10 minutes). Set to 0 for infinite (no auto-kill).
  - `waitForCompletion` boolean
  - `waitForPorts` integer[]
  - `workingDir` string

## Response `200`

Process information

- ProcessResponse
  - `command` string, required
  - `completedAt` string, required
  - `exitCode` integer, required
  - `keepAlive` boolean — Whether scale-to-zero is disabled for this process
  - `logs` string, required
  - `maxRestarts` integer
  - `name` string, required
  - `pid` string, required
  - `restartCount` integer
  - `restartOnFailure` boolean
  - `startedAt` string, required
  - `status` 'failed' | 'killed' | 'stopped' | 'running' | 'completed', required
  - `stderr` string, required
  - `stdout` string, required
  - `workingDir` string, required

## Other responses

- `400` — Invalid request
- `422` — Unprocessable entity
- `500` — Internal server error

---

[API](https://skmtc.net/blaxel/apis/blaxel-control-plane.md) · [All operations](https://skmtc.net/blaxel/apis/blaxel-control-plane/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/blaxel/blaxel-control-plane/versions/dfa264bc72ee/schema)
