v1

latestOpenAPI 3.1.02026-07-13897404.3 KB
Instances

execute

Executes a constrained remote command on a specified instance. The command output can be retrieved from the returned result URL.

CLI Usage: vastai execute <instance_id> <command>

put/api/v0/instances/command/{id}/

Path parameters

idinteger required
Example:12345

ID of the instance to execute command on

Request body

commandstring required

Command to execute on the instance

Example request

{
  "command": "ls -l"
}

Response

Command queued successfully

successboolean
writeable_pathstring

Container writeable path

result_urlstring

URL to fetch command execution results

msgstring

Example response

{
  "success": true,
  "writeable_path": "/workspace",
  "result_url": "https://s3.amazonaws.com/vast.ai/instance_logs/abc123.log",
  "msg": "Command is executing, wait a few seconds and then view the result_url"
}