> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hopx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Template

> Get detailed information about a specific template using the HopX Control Plane API. Retrieve template configuration, resources, build steps, and metadata for pre-built or custom templates. Learn how to use GET /v1/templates/:name endpoint to view template details before creating sandboxes. Includes request examples and response formats.

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

| Parameter | Type   | Description         |
| --------- | ------ | ------------------- |
| `name`    | string | Template name or ID |

### Example Request

Get by template name:

```bash theme={null}
curl https://api.hopx.dev/v1/templates/code-interpreter \
  -H "Authorization: Bearer $HOPX_API_KEY"
```

Get by template ID:

```bash theme={null}
curl https://api.hopx.dev/v1/templates/73 \
  -H "Authorization: Bearer $HOPX_API_KEY"
```

## Response

### Success (200 OK)

```json theme={null}
{
  "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

| Field               | Type    | Description                                      |
| ------------------- | ------- | ------------------------------------------------ |
| `id`                | string  | Template ID                                      |
| `name`              | string  | Template name (unique identifier)                |
| `display_name`      | string  | Human-readable name                              |
| `description`       | string  | Template description                             |
| `category`          | string  | Template category                                |
| `language`          | string  | Primary programming language                     |
| `default_resources` | object  | Default resource allocation                      |
| `min_resources`     | object  | Minimum resource requirements                    |
| `max_resources`     | object  | Maximum resource limits                          |
| `features`          | array   | Supported features                               |
| `tags`              | array   | Template tags for categorization                 |
| `is_active`         | boolean | Whether template is ready for use                |
| `status`            | string  | Template status (`active`, `building`, `failed`) |
| `is_public`         | boolean | Whether template is publicly available           |

## Status Codes

| Code  | Description             |
| ----- | ----------------------- |
| `200` | Success                 |
| `401` | Authentication required |
| `404` | Template not found      |

## Errors

### Template Not Found (404)

```json theme={null}
{
  "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

```bash theme={null}
curl https://api.hopx.dev/v1/templates/code-interpreter \
  -H "Authorization: Bearer $HOPX_API_KEY" | \
  jq '.default_resources'
```

### Verify Template Status

```bash theme={null}
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

```bash theme={null}
curl https://api.hopx.dev/v1/templates/code-interpreter \
  -H "Authorization: Bearer $HOPX_API_KEY" | \
  jq '.features[]'
```

### Compare Template Resources

```bash theme={null}
#!/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
```

## Related

* **SDK**: [Sandbox.get\_template()](/sdk/python/sandbox#get_template) - Python SDK method
* [CLI Template Commands](/cli/commands/template) - Template management from CLI

## Next Steps

* **[List Templates](/api/control-plane/list-templates)** - Browse all available templates
* **[Build Template](/api/control-plane/build-template)** - Create a custom template
* **[Create Sandbox](/api/control-plane/create-sandbox)** - Create a sandbox from this template
