Related
- CLI Template Commands - Template management from CLI
What You’ll Learn
- How to list and view available templates
- How to get detailed template information
- How to build custom templates from Docker images
- How to configure template resources and settings
- How to cache and optimize templates
Template Management Overview
| Operation | SDK Method | API Endpoint |
|---|---|---|
| Listing | Sandbox.list_templates() | GET /v1/templates |
| Getting Details | Sandbox.get_template() | GET /v1/templates/:name |
| Building | TemplateBuilder | POST /v1/templates/build |
| Configuration | TemplateBuilder.configure() | Template configuration |
| Caching | Template caching | Cache management |
Core Concepts
Listing Templates
Discover available pre-built and custom templates.- Listing Templates - List available templates
- SDK: Python: Sandbox.list_templates() | JavaScript: Sandbox.listTemplates()
- API: GET /v1/templates
Getting Template Details
View detailed information about specific templates.- Getting Template Details - View template information
- SDK: Python: Sandbox.get_template() | JavaScript: Sandbox.getTemplate()
- API: GET /v1/templates/:name
Building Templates
Create custom templates from Docker images and build steps.- Building Templates - Build custom templates
- SDK: Python: TemplateBuilder | JavaScript: TemplateBuilder
- API: POST /v1/templates/build
Template Configuration
Configure template resources, environment, and build steps.- Template Configuration - Configure templates
- SDK: Python: TemplateBuilder.configure() | JavaScript: TemplateBuilder.configure()
- API: Template configuration in build endpoint
Template Caching
Optimize template loading with caching strategies.- Template Caching - Cache templates for faster creation
- SDK: Template caching options | API: Cache management endpoints
SDK Reference
Python SDK
Complete reference for Python template operations.- Sandbox.list_templates() - List templates
- Sandbox.get_template() - Get template details
- TemplateBuilder - Build custom templates
from_image()- Create from Docker imageconfigure()- Configure resourcesbuild()- Build template
JavaScript SDK
Complete reference for JavaScript/TypeScript template operations.- Sandbox.listTemplates() - List templates
- Sandbox.getTemplate() - Get template details
- TemplateBuilder - Build custom templates
fromImage()- Create from Docker imageconfigure()- Configure resourcesbuild()- Build template
API Reference
Control Plane API
REST API endpoints for template operations.- Control Plane API Overview - API overview
- List Templates -
GET /v1/templates- List all templates - Get Template -
GET /v1/templates/:name- Get template details - Build Template -
POST /v1/templates/build- Build custom template
Quick Start
If you’re new to templates, start here:- Listing Templates - Discover available templates
- Getting Template Details - View template information
- Building Templates - Create your first custom template
Related Topics
- Sandboxes - Create sandboxes from templates
- Code Execution - Execute code in template environments
- Environment Variables - Configure template environments
- File Operations - Work with files in template-based sandboxes
Next Steps
- Learn about Creating Sandboxes from templates
- Explore Building Templates for custom environments
- Review Template Configuration for advanced setup
- Check out Template Caching for optimization

