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

# List metric template variables

> Return the catalog of `{{prefix.key}}` template variables that can be
used in LLM-judge metric prompts (e.g. `{{agent.company_name}}`,
`{{expected_output.balance}}`, `{{customer_metadata.call_id}}`). These are
substituted at evaluation time from the agent's `attributes`, the test
case's `expected_output`, and the run's `customer_metadata` respectively.




## OpenAPI

````yaml /api-reference/v1/metrics-v1.yaml get /metrics/template-variables
openapi: 3.0.3
info:
  title: Coval Metrics API
  version: 1.0.0
  description: |
    Manage custom evaluation metrics for agent testing and monitoring.
  contact:
    name: Coval API Support
    email: support@coval.dev
    url: https://docs.coval.ai
  license:
    name: Proprietary
    url: https://coval.dev/terms
servers:
  - url: https://api.coval.dev/v1
    description: Production API
security:
  - ApiKeyAuth: []
tags:
  - name: Metrics
    description: CRUD operations for custom evaluation metrics
paths:
  /metrics/template-variables:
    get:
      tags:
        - Metrics
      summary: List metric template variables
      description: >
        Return the catalog of `{{prefix.key}}` template variables that can be

        used in LLM-judge metric prompts (e.g. `{{agent.company_name}}`,

        `{{expected_output.balance}}`, `{{customer_metadata.call_id}}`). These
        are

        substituted at evaluation time from the agent's `attributes`, the test

        case's `expected_output`, and the run's `customer_metadata`
        respectively.
      operationId: listMetricTemplateVariables
      responses:
        '200':
          description: Template-variable catalog
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMetricTemplateVariablesResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    GetMetricTemplateVariablesResponse:
      type: object
      required:
        - version
        - categories
      properties:
        version:
          type: string
          description: Schema version
          example: '1.0'
        categories:
          type: array
          description: Available template-variable categories
          items:
            $ref: '#/components/schemas/MetricTemplateVariableCategory'
    MetricTemplateVariableCategory:
      type: object
      description: >-
        One category of `{{prefix.key}}` template variables usable in metric
        prompts.
      required:
        - prefix
        - display_name
        - description
        - source_field
        - supports_custom_keys
        - example_keys
      properties:
        prefix:
          type: string
          description: Variable prefix, e.g. `agent`. Used as `{{agent.<key>}}` in prompts.
          example: agent
        display_name:
          type: string
          description: Human-readable category name
          example: Agent
        description:
          type: string
          description: What this category substitutes at evaluation time
          example: Dynamic values from agent configuration attributes
        source_field:
          type: string
          description: Backend source the values are read from
          example: agent.attributes
        supports_custom_keys:
          type: boolean
          description: Whether arbitrary keys are allowed under this prefix
          example: true
        example_keys:
          type: array
          description: Example keys for discovery/autocomplete
          items:
            type: string
          example:
            - company_name
            - support_hours
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - INVALID_ARGUMENT
                - UNAUTHENTICATED
                - PERMISSION_DENIED
                - NOT_FOUND
                - ALREADY_EXISTS
                - INTERNAL
            message:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                    nullable: true
                  description:
                    type: string
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: UNAUTHENTICATED
              message: Authentication failed
              details:
                - field: X-API-Key
                  description: Invalid or missing API key
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL
              message: Internal server error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````