PUT
/
api
/
v0
/
instances
/
command
/
{id}
/
execute
curl --request PUT \
  --url https://console.vast.ai/api/v0/instances/command/{id}/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "command": "ls -l"
}'
{
  "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"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
integer
required

ID of the instance to execute command on

Example:

12345

Body

application/json
command
string
required

Command to execute on the instance

Maximum length: 512
Example:

"ls -l"

Response

Command queued successfully

success
boolean
Example:

true

writeable_path
string

Container writeable path

Example:

"/workspace"

result_url
string

URL to fetch command execution results

Example:

"https://s3.amazonaws.com/vast.ai/instance_logs/abc123.log"

msg
string
Example:

"Command is executing, wait a few seconds and then view the result_url"