Skip to main content
Stop a sandbox that is in the running or paused state. The sandbox will transition to stopped and billing will stop.

Endpoint

POST /v1/sandboxes/{sandbox_id}/stop

Request

Headers

X-API-Key: your_api_key_here

Path Parameters

ParameterTypeDescription
sandbox_idstringThe ID of the sandbox to stop

Response

Success (200 OK)

{
  "status": "stopped",
  "id": "1761048129dsaqav4n"
}

Examples

cURL

curl -X POST \
     -H "X-API-Key: your_api_key_here" \
     https://api.hopx.dev/v1/sandboxes/1761048129dsaqav4n/stop

Python

import os
import requests

api_key = os.environ.get("HOPX_API_KEY")
sandbox_id = "1761048129dsaqav4n"

headers = {
    "X-API-Key": api_key
}

response = requests.post(
    f"https://api.hopx.dev/v1/sandboxes/{sandbox_id}/stop",
    headers=headers
)

if response.status_code == 200:
    result = response.json()
    print(f"Sandbox {result['id']} stopped: {result['status']}")

JavaScript

const apiKey = process.env.HOPX_API_KEY;
const sandboxId = '1761048129dsaqav4n';

const response = await fetch(
  `https://api.hopx.dev/v1/sandboxes/${sandboxId}/stop`,
  {
    method: 'POST',
    headers: {
      'X-API-Key': apiKey
    }
  }
);

if (response.ok) {
  const result = await response.json();
  console.log(`Sandbox ${result.id} stopped: ${result.status}`);
}