Skip to main content
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"
}

Documentation Index

Fetch the complete documentation index at: https://vastai-80aa3a82-fix-stale-links.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

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 string 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"