> ## 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.

# Getting Details

> Get detailed information about templates in HopX. View template configuration, resources (vCPU, memory, disk), build steps, pre-installed packages, and metadata. Essential for choosing the right template and understanding available resources. Includes Python and JavaScript SDK examples and REST API endpoints.

Retrieve detailed information about a specific template, including full configuration, resources, features, and build information.

## Overview

Getting template details helps you:

* View complete template configuration
* Check resource specifications (min/max/default)
* Review available features and capabilities
* Access build information and status
* Verify template availability before use

<Note>
  Template details include more information than the list view, including full configuration, build steps, and organization-specific details.
</Note>

## Get Template by Name

Get detailed information about a specific template:

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from hopx_ai import Sandbox

    # Get template details
    template = Sandbox.get_template("code-interpreter")

    print(f"Template: {template.display_name}")
    print(f"Name: {template.name}")
    print(f"Description: {template.description}")
    print(f"Category: {template.category}")
    print(f"Language: {template.language}")
    print(f"Status: {template.status}")
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    import { Sandbox } from '@hopx-ai/sdk';

    // Get template details
    const template = await Sandbox.getTemplate('code-interpreter');

    console.log(`Template: ${template.displayName}`);
    console.log(`Name: ${template.name}`);
    console.log(`Description: ${template.description}`);
    console.log(`Category: ${template.category}`);
    console.log(`Language: ${template.language}`);
    console.log(`Status: ${template.status}`);
    ```
  </Tab>
</Tabs>

## Resource Specifications

View resource specifications (default, min, max):

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from hopx_ai import Sandbox

    template = Sandbox.get_template("code-interpreter")

    # Default resources
    if template.default_resources:
        res = template.default_resources
        print(f"Default Resources:")
        print(f"  vCPU: {res.vcpu}")
        print(f"  Memory: {res.memory_mb}MB")
        print(f"  Disk: {res.disk_gb}GB")

    # Minimum resources
    if template.min_resources:
        min_res = template.min_resources
        print(f"\nMinimum Resources:")
        print(f"  vCPU: {min_res.vcpu}")
        print(f"  Memory: {min_res.memory_mb}MB")
        print(f"  Disk: {min_res.disk_gb}GB")

    # Maximum resources
    if template.max_resources:
        max_res = template.max_resources
        print(f"\nMaximum Resources:")
        print(f"  vCPU: {max_res.vcpu}")
        print(f"  Memory: {max_res.memory_mb}MB")
        print(f"  Disk: {max_res.disk_gb}GB")
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    import { Sandbox } from '@hopx-ai/sdk';

    const template = await Sandbox.getTemplate('code-interpreter');

    // Default resources
    if (template.defaultResources) {
      const res = template.defaultResources;
      console.log('Default Resources:');
      console.log(`  vCPU: ${res.vcpu}`);
      console.log(`  Memory: ${res.memoryMb}MB`);
      console.log(`  Disk: ${res.diskGb}GB`);
    }

    // Minimum resources
    if (template.minResources) {
      const minRes = template.minResources;
      console.log('\nMinimum Resources:');
      console.log(`  vCPU: ${minRes.vcpu}`);
      console.log(`  Memory: ${minRes.memoryMb}MB`);
      console.log(`  Disk: ${minRes.diskGb}GB`);
    }

    // Maximum resources
    if (template.maxResources) {
      const maxRes = template.maxResources;
      console.log('\nMaximum Resources:');
      console.log(`  vCPU: ${maxRes.vcpu}`);
      console.log(`  Memory: ${maxRes.memoryMb}MB`);
      console.log(`  Disk: ${maxRes.diskGb}GB`);
    }
    ```
  </Tab>
</Tabs>

## Features and Tags

View template features and tags:

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from hopx_ai import Sandbox

    template = Sandbox.get_template("code-interpreter")

    # Features
    if template.features:
        print("Features:")
        for feature in template.features:
            print(f"  • {feature}")

    # Tags
    if template.tags:
        print("\nTags:")
        for tag in template.tags:
            print(f"  • {tag}")

    # Popularity
    if template.popularity_score:
        print(f"\nPopularity Score: {template.popularity_score}")
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    import { Sandbox } from '@hopx-ai/sdk';

    const template = await Sandbox.getTemplate('code-interpreter');

    // Features
    if (template.features) {
      console.log('Features:');
      for (const feature of template.features) {
        console.log(`  • ${feature}`);
      }
    }

    // Tags
    if (template.tags) {
      console.log('\nTags:');
      for (const tag of template.tags) {
        console.log(`  • ${tag}`);
      }
    }

    // Popularity
    if (template.popularityScore) {
      console.log(`\nPopularity Score: ${template.popularityScore}`);
    }
    ```
  </Tab>
</Tabs>

## Template Status and Availability

Check template status and availability:

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from hopx_ai import Sandbox
    from hopx_ai.errors import NotFoundError

    try:
        template = Sandbox.get_template("code-interpreter")
        
        print(f"Status: {template.status}")
        print(f"Active: {template.is_active}")
        print(f"Public: {template.is_public}")
        
        if template.status == "active":
            print("✅ Template is available for use")
        elif template.status == "building":
            print("⏳ Template is currently being built")
        elif template.status == "failed":
            print("❌ Template build failed")
        else:
            print(f"⚠️ Template status: {template.status}")
            
    except NotFoundError:
        print("❌ Template not found")
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    import { Sandbox } from '@hopx-ai/sdk';
    import { NotFoundError } from '@hopx-ai/sdk';

    try {
      const template = await Sandbox.getTemplate('code-interpreter');
      
      console.log(`Status: ${template.status}`);
      console.log(`Active: ${template.isActive}`);
      console.log(`Public: ${template.isPublic}`);
      
      if (template.status === 'active') {
        console.log('✅ Template is available for use');
      } else if (template.status === 'building') {
        console.log('⏳ Template is currently being built');
      } else if (template.status === 'failed') {
        console.log('❌ Template build failed');
      } else {
        console.log(`⚠️ Template status: ${template.status}`);
      }
    } catch (error) {
      if (error instanceof NotFoundError) {
        console.log('❌ Template not found');
      } else {
        throw error;
      }
    }
    ```
  </Tab>
</Tabs>

## Organization-Specific Templates

Check if template is organization-specific:

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from hopx_ai import Sandbox

    template = Sandbox.get_template("my-custom-template")

    if template.organization_id:
        print(f"Organization Template: {template.organization_id}")
        print("This is a custom template for your organization")
    else:
        print("Public Template")
        print("Available to all users")
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    import { Sandbox } from '@hopx-ai/sdk';

    const template = await Sandbox.getTemplate('my-custom-template');

    if (template.organizationId) {
      console.log(`Organization Template: ${template.organizationId}`);
      console.log('This is a custom template for your organization');
    } else {
      console.log('Public Template');
      console.log('Available to all users');
    }
    ```
  </Tab>
</Tabs>

## Complete Example

Here's a complete example showing template details:

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from hopx_ai import Sandbox
    from hopx_ai.errors import NotFoundError

    def show_template_details(template_name: str):
        try:
            template = Sandbox.get_template(template_name)
            
            print(f"📋 {template.display_name}")
            print(f"   Name: {template.name}")
            print(f"   ID: {template.id}")
            print()
            
            if template.description:
                print(f"📝 Description:")
                print(f"   {template.description}")
                print()
            
            print(f"🏷️  Metadata:")
            print(f"   Category: {template.category or 'N/A'}")
            print(f"   Language: {template.language or 'N/A'}")
            print(f"   Status: {template.status}")
            print(f"   Active: {template.is_active}")
            print(f"   Public: {template.is_public}")
            print()
            
            if template.default_resources:
                res = template.default_resources
                print(f"💻 Default Resources:")
                print(f"   vCPU: {res.vcpu}")
                print(f"   Memory: {res.memory_mb}MB")
                print(f"   Disk: {res.disk_gb}GB")
                print()
            
            if template.min_resources or template.max_resources:
                print(f"📊 Resource Limits:")
                if template.min_resources:
                    min_res = template.min_resources
                    print(f"   Min: {min_res.vcpu}vCPU, {min_res.memory_mb}MB RAM")
                if template.max_resources:
                    max_res = template.max_resources
                    print(f"   Max: {max_res.vcpu}vCPU, {max_res.memory_mb}MB RAM")
                print()
            
            if template.features:
                print(f"✨ Features:")
                for feature in template.features:
                    print(f"   • {feature}")
                print()
            
            if template.tags:
                print(f"🏷️  Tags:")
                for tag in template.tags:
                    print(f"   • {tag}")
                print()
            
            if template.docs_url:
                print(f"📚 Documentation: {template.docs_url}")
                print()
            
            if template.organization_id:
                print(f"🏢 Organization: {template.organization_id}")
                print("   (Custom template)")
            
        except NotFoundError:
            print(f"❌ Template '{template_name}' not found")

    # Show details for a template
    show_template_details("code-interpreter")
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    import { Sandbox } from '@hopx-ai/sdk';
    import { NotFoundError } from '@hopx-ai/sdk';

    async function showTemplateDetails(templateName) {
      try {
        const template = await Sandbox.getTemplate(templateName);
        
        console.log(`📋 ${template.displayName}`);
        console.log(`   Name: ${template.name}`);
        console.log(`   ID: ${template.id}`);
        console.log();
        
        if (template.description) {
          console.log('📝 Description:');
          console.log(`   ${template.description}`);
          console.log();
        }
        
        console.log('🏷️  Metadata:');
        console.log(`   Category: ${template.category || 'N/A'}`);
        console.log(`   Language: ${template.language || 'N/A'}`);
        console.log(`   Status: ${template.status}`);
        console.log(`   Active: ${template.isActive}`);
        console.log(`   Public: ${template.isPublic}`);
        console.log();
        
        if (template.defaultResources) {
          const res = template.defaultResources;
          console.log('💻 Default Resources:');
          console.log(`   vCPU: ${res.vcpu}`);
          console.log(`   Memory: ${res.memoryMb}MB`);
          console.log(`   Disk: ${res.diskGb}GB`);
          console.log();
        }
        
        if (template.minResources || template.maxResources) {
          console.log('📊 Resource Limits:');
          if (template.minResources) {
            const minRes = template.minResources;
            console.log(`   Min: ${minRes.vcpu}vCPU, ${minRes.memoryMb}MB RAM`);
          }
          if (template.maxResources) {
            const maxRes = template.maxResources;
            console.log(`   Max: ${maxRes.vcpu}vCPU, ${maxRes.memoryMb}MB RAM`);
          }
          console.log();
        }
        
        if (template.features) {
          console.log('✨ Features:');
          for (const feature of template.features) {
            console.log(`   • ${feature}`);
          }
          console.log();
        }
        
        if (template.tags) {
          console.log('🏷️  Tags:');
          for (const tag of template.tags) {
            console.log(`   • ${tag}`);
          }
          console.log();
        }
        
        if (template.docsUrl) {
          console.log(`📚 Documentation: ${template.docsUrl}`);
          console.log();
        }
        
        if (template.organizationId) {
          console.log(`🏢 Organization: ${template.organizationId}`);
          console.log('   (Custom template)');
        }
      } catch (error) {
        if (error instanceof NotFoundError) {
          console.log(`❌ Template '${templateName}' not found`);
        } else {
          throw error;
        }
      }
    }

    // Show details for a template
    await showTemplateDetails('code-interpreter');
    ```
  </Tab>
</Tabs>

## Best Practices

<Steps>
  <Step title="1. Get Details Before Use">
    Always get template details to verify resources and features before creating sandboxes.
  </Step>

  <Step title="2. Check Status">
    Verify template status is "active" before using it to create sandboxes.
  </Step>

  <Step title="3. Review Resources">
    Check default, min, and max resources to ensure they meet your requirements.
  </Step>

  <Step title="4. Verify Features">
    Review features list to confirm template has capabilities you need.
  </Step>

  <Step title="5. Handle Not Found">
    Always handle NotFoundError when getting template details.
  </Step>
</Steps>

## Related

* **[Listing Templates](/core-concepts/templates/listing)** - List all available templates
* **[Creating Sandboxes](/core-concepts/sandboxes/creating)** - Create sandboxes from templates
* **SDK**: [Sandbox.get\_template()](/sdk/python/sandbox#get_template) - Python SDK method
* **API**: [GET /v1/templates/:name](/api/control-plane/get-template) - Control Plane API endpoint
* [CLI Template Commands](/cli/commands/template) - Template management from CLI

## Next Steps

* Learn about [Listing Templates](/core-concepts/templates/listing) to discover available templates
* Explore [Building Templates](/core-concepts/templates/building) to create custom templates
* Review [Template Configuration](/core-concepts/templates/configuration) for advanced setup
