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

# Load a stored resource by id, optionally rendering it

> Load a stored resource by its id, optionally rendering it as a template.

Args:
    resource_id: The id (path) of the resource to load.
    template_kwargs: When omitted, the resource's loaded content is returned
        as-is. When provided (any dict, incl. ``{}``), text is rendered as a
        Jinja template with these variables; media raises loudly (``400``).

Returns:
    The loaded (and optionally rendered) content — text or a ``MediaBlock``.

A missing resource is a ``404``; a traversal-escaping id, a render of media, or
broken client-supplied Jinja is a ``400``. Genuine storage/transport failures
raise other types and propagate as a ``500``.



## OpenAPI

````yaml /openapi.json get /api/resources/get
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/resources/get:
    get:
      tags:
        - resources
      summary: Load a stored resource by id, optionally rendering it
      description: >-
        Load a stored resource by its id, optionally rendering it as a template.


        Args:
            resource_id: The id (path) of the resource to load.
            template_kwargs: When omitted, the resource's loaded content is returned
                as-is. When provided (any dict, incl. ``{}``), text is rendered as a
                Jinja template with these variables; media raises loudly (``400``).

        Returns:
            The loaded (and optionally rendered) content — text or a ``MediaBlock``.

        A missing resource is a ``404``; a traversal-escaping id, a render of
        media, or

        broken client-supplied Jinja is a ``400``. Genuine storage/transport
        failures

        raise other types and propagate as a ``500``.
      operationId: get_api_resources_get
      parameters:
        - in: query
          name: resource_id
          required: true
          schema:
            title: Resource Id
            type: string
        - in: query
          name: template_kwargs
          required: false
          schema:
            anyOf:
              - additionalProperties: true
                type: object
              - type: 'null'
            default: null
            title: Template Kwargs
      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:
    Error:
      properties:
        error:
          type: string
      required:
        - error
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````