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

# List knowledge-base metadata filters

> Discover metadata-filter fields, supported operators, bounds, and optional categorical values for the knowledge base selected by the server URL. Fields depend on its domain; values depend on its corpus.



## OpenAPI

````yaml /openapi.json get /metadata-filters
openapi: 3.1.0
info:
  title: AI Baseline API
  description: >-
    REST v2 contract for querying a selected knowledge base, discovering
    metadata filters, and reading corpus orientation. The S&P 500 requests are
    worked examples; fields and available material depend on the selected base
    and its domain.
  version: v2
servers:
  - url: https://api.ai-baseline.dev/{org}/{base}/v2
    description: Knowledge-base REST API (defaults to the S&P 500 example)
    variables:
      org:
        default: baseline
        description: Exact identifier of the organization that owns the knowledge base.
      base:
        default: sandp500
        description: >-
          Exact identifier of the knowledge base within the owning organization.
          The API key must grant access to this base.
security:
  - ApiKeyAuth: []
paths:
  /metadata-filters:
    get:
      tags:
        - Metadata
      summary: List knowledge-base metadata filters
      description: >-
        Discover metadata-filter fields, supported operators, bounds, and
        optional categorical values for the knowledge base selected by the
        server URL. Fields depend on its domain; values depend on its corpus.
      operationId: listMetadataFilters
      parameters:
        - name: include_values
          in: query
          required: false
          schema:
            type: boolean
            description: Include allowed categorical values and alias text when available.
            default: false
            title: Include Values
          description: Include allowed categorical values and alias text when available.
        - name: field
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Return one public metadata-filter field by name.
            title: Field
          description: Return one public metadata-filter field by name.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetadataFiltersResponse'
        '404':
          description: Unknown domain
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Request body too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestFailureResponse'
        '502':
          description: An AI upstream returned output that failed validation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestFailureResponse'
        '503':
          description: Service, AI dependency, or local capacity temporarily unavailable
          headers:
            Retry-After:
              description: Advisory delay in seconds for retryable failures
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              examples:
                capacity_queue_full:
                  summary: The bounded capacity waiting room is full
                  value:
                    status_code: 503
                    message: Service temporarily at capacity
                    detail:
                      code: CAPACITY_UNAVAILABLE
                      retryable: true
                      reason: queue_full
                      retry_after_seconds: 5
                capacity_wait_timeout:
                  summary: Capacity was not acquired before the wait timeout
                  value:
                    status_code: 503
                    message: Service temporarily at capacity
                    detail:
                      code: CAPACITY_UNAVAILABLE
                      retryable: true
                      reason: wait_timeout
                      retry_after_seconds: 5
                dependency_unavailable:
                  summary: A required AI upstream service is unavailable
                  value:
                    status_code: 503
                    message: >-
                      A required AI upstream service is temporarily unavailable.
                      Please retry.
                    detail:
                      code: DEPENDENCY_UNAVAILABLE
                      retryable: true
                      retry_after_seconds: 10
                service_unavailable:
                  summary: Application services are unavailable
                  value:
                    status_code: 503
                    message: Service unavailable
                    detail:
                      code: SERVICE_UNAVAILABLE
                      retryable: false
              schema:
                $ref: '#/components/schemas/RequestFailureResponse'
        '504':
          description: The admitted request exceeded its execution deadline
          headers:
            Retry-After:
              description: Advisory delay in seconds before retrying
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestFailureResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    MetadataFiltersResponse:
      properties:
        domain:
          type: string
          title: Domain
          description: >-
            Configured domain ID of the selected knowledge base, not its base
            identifier. For the baseline/sandp500 example this is sandp_500.
        schema_version:
          type: string
          title: Schema Version
        fields:
          items:
            $ref: '#/components/schemas/MetadataFilterField'
          type: array
          title: Fields
      additionalProperties: false
      type: object
      required:
        - domain
        - schema_version
        - fields
      title: MetadataFiltersResponse
    ErrorResponse:
      properties:
        status_code:
          type: integer
          title: Status Code
        message:
          type: string
          title: Message
        detail:
          anyOf:
            - {}
            - type: 'null'
          title: Detail
      type: object
      required:
        - status_code
        - message
      title: ErrorResponse
    RequestFailureResponse:
      properties:
        status_code:
          type: integer
          enum:
            - 500
            - 502
            - 503
            - 504
          title: Status Code
        message:
          type: string
          title: Message
        detail:
          $ref: '#/components/schemas/RequestFailureDetail'
      additionalProperties: false
      type: object
      required:
        - status_code
        - message
        - detail
      title: RequestFailureResponse
    MetadataFilterField:
      properties:
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        value_type:
          type: string
          title: Value Type
        operators:
          items:
            type: string
          type: array
          title: Operators
        has_values:
          type: boolean
          title: Has Values
        source_required:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Source Required
        constraints:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Constraints
        numeric_bounds:
          anyOf:
            - $ref: '#/components/schemas/MetadataFilterNumericBounds'
            - type: 'null'
        max_values_per_condition:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Values Per Condition
        max_value_length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Value Length
        allowed_values:
          anyOf:
            - items:
                $ref: '#/components/schemas/MetadataFilterAllowedValue'
              type: array
            - type: 'null'
          title: Allowed Values
      additionalProperties: false
      type: object
      required:
        - name
        - description
        - value_type
        - operators
        - has_values
        - source_required
        - constraints
      title: MetadataFilterField
    RequestFailureDetail:
      properties:
        code:
          $ref: '#/components/schemas/FailureCode'
        retryable:
          type: boolean
          title: Retryable
        reason:
          anyOf:
            - type: string
              enum:
                - queue_full
                - wait_timeout
            - type: 'null'
          title: Reason
        retry_after_seconds:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Retry After Seconds
      additionalProperties: false
      type: object
      required:
        - code
        - retryable
      title: RequestFailureDetail
    MetadataFilterNumericBounds:
      properties:
        min:
          type: number
          title: Min
        max:
          type: number
          title: Max
      additionalProperties: false
      type: object
      required:
        - min
        - max
      title: MetadataFilterNumericBounds
    MetadataFilterAllowedValue:
      properties:
        value:
          type: string
          title: Value
        display_value:
          type: string
          title: Display Value
        aliases:
          items:
            type: string
          type: array
          title: Aliases
      additionalProperties: false
      type: object
      required:
        - value
        - display_value
        - aliases
      title: MetadataFilterAllowedValue
    FailureCode:
      type: string
      enum:
        - CAPACITY_UNAVAILABLE
        - DEPENDENCY_UNAVAILABLE
        - SERVICE_UNAVAILABLE
        - INVALID_UPSTREAM_RESPONSE
        - EXECUTION_DEADLINE_EXCEEDED
        - EXECUTION_WORK_LIMIT_EXCEEDED
        - INTERNAL_SERVER_ERROR
      title: FailureCode
  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.