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

# Create template (v3)

> Create a new template

Anona builds the image with BuildKit in an isolated builder, adds the Anona runtime layer (envd), pushes it and registers it. Every `FROM` is pinned by digest, and `EXPOSE 49983` (envd) is refused.



## OpenAPI

````yaml /compute/api-reference/e2b-openapi.yaml post /v3/templates
openapi: 3.0.0
info:
  title: Anona Compute API (E2B-compatible routes)
  version: 0.1.0
  description: >-
    The E2B API operations the Anona Compute gateway serves, from the E2B spec
    pinned at e2b SDK 2.61.0 (`gateway/third_party/specs/e2b/openapi.yml`).
    Generated by `docs-site/scripts/gen_e2b_openapi.py`; do not edit by hand.
servers:
  - url: https://api.compute.anonalabs.com
security: []
tags:
  - name: sandboxes
paths:
  /v3/templates:
    post:
      tags:
        - templates
      summary: Create template (v3)
      description: >-
        Create a new template


        Anona builds the image with BuildKit in an isolated builder, adds the
        Anona runtime layer (envd), pushes it and registers it. Every `FROM` is
        pinned by digest, and `EXPOSE 49983` (envd) is refused.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateBuildRequestV3'
      responses:
        '202':
          description: The build was requested successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateRequestResponseV3'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TemplateBuildRequestV3:
      properties:
        name:
          description: >-
            Name of the template. Can include a tag with colon separator (e.g.
            "my-template" or "my-template:v1"). If tag is included, it will be
            treated as if the tag was provided in the tags array.
          type: string
          maxLength: 128
        tags:
          type: array
          description: Tags to assign to the template build
          items:
            type: string
        alias:
          description: Alias of the template. Deprecated, use name instead.
          type: string
          maxLength: 128
          deprecated: true
        teamID:
          deprecated: true
          type: string
          description: Identifier of the team, as its UUID or its public project ID (prj_)
        cpuCount:
          $ref: '#/components/schemas/CPUCount'
        memoryMB:
          $ref: '#/components/schemas/MemoryMB'
        minFreeDiskMb:
          $ref: '#/components/schemas/MinFreeDiskMb'
    TemplateRequestResponseV3:
      required:
        - templateID
        - buildID
        - public
        - aliases
        - names
        - tags
      properties:
        templateID:
          type: string
          description: Identifier of the template
        buildID:
          type: string
          description: Identifier of the last successful build for given template
        public:
          type: boolean
          description: Whether the template is public or only accessible by the team
        names:
          type: array
          description: Names of the template
          items:
            type: string
        tags:
          type: array
          description: Tags assigned to the template build
          items:
            type: string
        aliases:
          type: array
          description: Aliases of the template
          deprecated: true
          items:
            type: string
    CPUCount:
      type: integer
      format: int32
      minimum: 1
      description: CPU cores for the sandbox
    MemoryMB:
      type: integer
      format: int32
      minimum: 128
      description: Memory for the sandbox in MiB
    MinFreeDiskMb:
      type: integer
      format: int32
      minimum: 0
      description: >-
        Requested minimum free space after the template's build steps, in MiB.
        Omit to use the team's default. Set to 0 to request no minimum free-disk
        growth. The filesystem is never shrunk, including inherited or
        already-larger filesystems. Growth is best effort, so filesystem
        metadata can leave the available space slightly below the requested
        minimum.
    Error:
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          description: Error code
        error_code:
          type: string
          description: >-
            Machine-readable semantic error code. Not a closed set; initial
            values: sandbox_capacity_unavailable, sandbox_placement_timeout,
            sandbox_no_compatible_node, sandbox_create_failed (a node could not
            create the sandbox this time; retry), sandbox_create_refused (a node
            refused the sandbox for a reason no retry changes, such as a vcpu
            count out of bounds in the stored build; a server error, since no
            request field reaches that check), internal_server_error,
            secret_limit_reached, idempotency_request_mismatch,
            idempotency_in_progress, idempotency_outcome_unknown.
        message:
          type: string
          description: Error
  responses:
    '400':
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '401':
      description: Authentication error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '409':
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '429':
      description: Too many requests
      headers:
        Retry-After:
          description: >-
            When present, the number of seconds to wait before retrying the
            request.
          required: false
          schema:
            type: integer
            minimum: 0
          example: 30
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '500':
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.