---
title: "execute"
method: PUT
path: "/api/v0/instances/command/{id}/"
tags: ["Instances"]
---

# execute

`PUT /api/v0/instances/command/{id}/`

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>`

## Path parameters

- `id` integer, required

## Request body

- object
  - `command` string, required — Command to execute on the instance

## Response `200`

Command queued successfully

- object
  - `success` boolean
  - `writeable_path` string — Container writeable path
  - `result_url` string — URL to fetch command execution results
  - `msg` string

## Other responses

- `400` — Invalid request parameters
- `401` — Unauthorized - Invalid or missing API key
- `403` — Forbidden - User is blacklisted
- `429` — Too Many Requests
- `483` — Invalid JSON body

---

[API](https://skmtc.net/vast/apis/vast-ai-api.md) · [All operations](https://skmtc.net/vast/apis/vast-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vast/vast-ai-api/revisions/4ed14f79f796/schema)
