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

# Render a template

> Render an inline ``content`` OR a stored ``template_id`` with ``kwargs``.

Exactly one of ``content``/``template_id`` is required. A missing stored
template is a ``404``; broken client-supplied Jinja (a syntax error, a
sandbox-blocked dunder traversal → ``SecurityError``, an undefined access) is
author error → ``400``. Genuine storage failures raise other types (``500``).



## OpenAPI

````yaml /openapi.json post /api/render-template
openapi: 3.1.0
info:
  description: The operator HTTP surface served under /api/*.
  title: tai42-skeleton API
  version: 0.1.1
servers: []
security: []
paths:
  /api/render-template:
    post:
      tags:
        - templates
      summary: Render a template
      description: >-
        Render an inline ``content`` OR a stored ``template_id`` with
        ``kwargs``.


        Exactly one of ``content``/``template_id`` is required. A missing stored

        template is a ``404``; broken client-supplied Jinja (a syntax error, a

        sandbox-blocked dunder traversal → ``SecurityError``, an undefined
        access) is

        author error → ``400``. Genuine storage failures raise other types
        (``500``).
      operationId: post_api_render_template
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateRender'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data: {}
                required:
                  - data
                type: object
          description: Success.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Malformed request.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid api key.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Resource not found.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TemplateRender:
      description: >-
        Render a template — inline ``content`` OR a stored ``template_id`` —
        with

        ``kwargs``.
      properties:
        content:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Content
        kwargs:
          additionalProperties: true
          default: {}
          title: Kwargs
          type: object
        template_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Template Id
      title: TemplateRender
      type: object
    Error:
      properties:
        error:
          type: string
      required:
        - error
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````