Skip to navigation

Run a command

Run one command inside the running instance’s workload container, as root, and receive its output. Each call starts a fresh /bin/sh, so chain steps with && or run a script. Stdout and stderr are returned up to 1 MiB each; stdout_truncated or stderr_truncated is set when output was cut.

A command stops after timeout_seconds (default 60, up to 300). Up to 2 commands run at once per instance and 4 per account. Running commands has no separate charge.

Authentication

AuthorizationBearer

Pass your EmpirioLabs API key as a bearer token. The Anthropic-style x-api-key header is also accepted on every endpoint.

Path parameters

instance_idstringRequiredformat: "^[0-9a-f]{16}$"
GPU instance id.

Request

This endpoint expects an object.
commandstringRequired1-16384 characters
The shell command to run, up to 16384 bytes.
timeout_secondsintegerOptional1-300Defaults to 60
Seconds before the command is stopped.

Response

The command ran. A non-zero exit_code is the command’s own result.

exit_codeinteger or nullOptional
The command's exit status, or null when it was stopped at the deadline.
stdoutstringOptional
stderrstringOptional
stdout_truncatedbooleanOptional
stderr_truncatedbooleanOptional
timed_outbooleanOptional
duration_msintegerOptional

Errors

400
Bad Request Error
404
Not Found Error
409
Conflict Error
413
Content Too Large Error
429
Too Many Requests Error
503
Service Unavailable Error