Skip to main content
Get detailed information about a specific sandbox, including its current status, resources, and connection details.

Endpoint

GET /v1/sandboxes/{sandbox_id}

Request

Headers

X-API-Key: your_api_key_here

Path Parameters

ParameterTypeDescription
sandbox_idstringThe ID of the sandbox

Response

Success (200 OK)

{
  "id": "1761048129dsaqav4n",
  "organization_id": "org-abc123",
  "status": "running",
  "public_host": "https://1761048129dsaqav4n.hopx.dev",
  "template_name": "code-interpreter",
  "created_at": "2025-01-15T10:30:00Z",
  "resources": {
    "vcpu": 2,
    "memory_mb": 2048,
    "disk_gb": 10
  }
}

Error Responses

404 Not Found:
{
  "error": "Sandbox not found",
  "code": "NOT_FOUND"
}
403 Forbidden:
{
  "error": "Forbidden",
  "code": "PERMISSION_DENIED"
}

Examples

cURL

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

Python

import os
import requests

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

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

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

if response.status_code == 200:
    sandbox = response.json()
    print(f"Sandbox ID: {sandbox['id']}")
    print(f"Status: {sandbox['status']}")
    print(f"Public Host: {sandbox['public_host']}")
    print(f"Resources: {sandbox['resources']}")
else:
    print(f"Error: {response.status_code}")
    print(response.json())

JavaScript

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

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

if (response.ok) {
  const sandbox = await response.json();
  console.log(`Sandbox ID: ${sandbox.id}`);
  console.log(`Status: ${sandbox.status}`);
  console.log(`Public Host: ${sandbox.public_host}`);
  console.log(`Resources:`, sandbox.resources);
} else {
  const error = await response.json();
  console.error('Error:', error);
}