Skip to main content
Get detailed information about a specific template, including its configuration, resources, features, and availability.

Endpoint

GET /v1/templates/:name

Request

Headers

Authorization: Bearer $HOPX_API_KEY

Path Parameters

ParameterTypeDescription
namestringTemplate name or ID

Example Request

Get by template name:
curl https://api.hopx.dev/v1/templates/code-interpreter \
  -H "Authorization: Bearer $HOPX_API_KEY"
Get by template ID:
curl https://api.hopx.dev/v1/templates/73 \
  -H "Authorization: Bearer $HOPX_API_KEY"

Response

Success (200 OK)

{
  "id": "73",
  "object": "template",
  "name": "code-interpreter",
  "display_name": "Code Interpreter",
  "description": "Pre-built environment for Python, JavaScript, and Bash execution with common packages pre-installed",
  "category": "python",
  "language": "python",
  "icon": "python",
  "default_resources": {
    "vcpu": 2,
    "memory_mb": 4096,
    "disk_gb": 10
  },
  "min_resources": {
    "vcpu": 1,
    "memory_mb": 512,
    "disk_gb": 1
  },
  "max_resources": {
    "vcpu": 8,
    "memory_mb": 16384,
    "disk_gb": 100
  },
  "features": [
    "python",
    "javascript",
    "bash",
    "desktop",
    "internet"
  ],
  "tags": [
    "code-execution",
    "multi-language",
    "data-science"
  ],
  "popularity_score": 950,
  "docs_url": "https://docs.hopx.dev/templates/code-interpreter",
  "is_active": true,
  "status": "active",
  "build_id": "build_abc123",
  "is_public": true,
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2025-01-15T00:00:00Z",
  "request_id": "req_abc123"
}

Response Fields

FieldTypeDescription
idstringTemplate ID
namestringTemplate name (unique identifier)
display_namestringHuman-readable name
descriptionstringTemplate description
categorystringTemplate category
languagestringPrimary programming language
default_resourcesobjectDefault resource allocation
min_resourcesobjectMinimum resource requirements
max_resourcesobjectMaximum resource limits
featuresarraySupported features
tagsarrayTemplate tags for categorization
is_activebooleanWhether template is ready for use
statusstringTemplate status (active, building, failed)
is_publicbooleanWhether template is publicly available

Status Codes

CodeDescription
200Success
401Authentication required
404Template not found

Errors

Template Not Found (404)

{
  "error": "Template not found",
  "code": "RESOURCE_NOT_FOUND",
  "request_id": "req_abc123"
}
Cause: The template name or ID doesn’t exist or is not accessible to your organization. Fix: List available templates using GET /v1/templates to find valid template names or IDs.

Template Features

Common template features:
  • python - Python runtime available
  • javascript - JavaScript/Node.js runtime available
  • bash - Bash shell available
  • desktop - Desktop environment with VNC support
  • internet - Internet access enabled
  • gpu - GPU support (for ML/AI workloads)

Use Cases

Check Template Resources

curl https://api.hopx.dev/v1/templates/code-interpreter \
  -H "Authorization: Bearer $HOPX_API_KEY" | \
  jq '.default_resources'

Verify Template Status

STATUS=$(curl -s https://api.hopx.dev/v1/templates/my-custom-template \
  -H "Authorization: Bearer $HOPX_API_KEY" | jq -r '.status')

if [ "$STATUS" == "active" ]; then
  echo "Template is ready"
else
  echo "Template is not ready: $STATUS"
fi

Check Template Features

curl https://api.hopx.dev/v1/templates/code-interpreter \
  -H "Authorization: Bearer $HOPX_API_KEY" | \
  jq '.features[]'

Compare Template Resources

#!/bin/bash
TEMPLATES=("code-interpreter" "python-3.11" "nodejs-18")

for TEMPLATE in "${TEMPLATES[@]}"; do
  echo "=== $TEMPLATE ==="
  curl -s "https://api.hopx.dev/v1/templates/$TEMPLATE" \
    -H "Authorization: Bearer $HOPX_API_KEY" | \
    jq '{name: .name, resources: .default_resources}'
done

Next Steps