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

# List Metrics

> List Metrics configured for the specified Project. Metrics are returned in reverse chronological order.



## OpenAPI

````yaml get /projects/{projectId}/metrics
openapi: 3.1.0
info:
  title: Scorecard API
  description: REST API for Scorecard
  version: 1.0.0
servers:
  - url: https://api2.scorecard.io/api/v2
security:
  - ApiKeyAuth: []
paths:
  /projects/{projectId}/metrics:
    get:
      summary: List Metrics
      description: >-
        List Metrics configured for the specified Project. Metrics are returned
        in reverse chronological order.
      operationId: listMetrics
      parameters:
        - in: path
          name: projectId
          description: The ID of the Project to list Metrics for.
          schema:
            type: string
            example: '314'
          required: true
        - in: query
          name: limit
          description: >-
            Maximum number of items to return (1-100). Use with `cursor` for
            pagination through large sets.
          schema:
            type: integer
            exclusiveMinimum: 0
            default: 20
            example: 20
        - in: query
          name: cursor
          description: >-
            Cursor for pagination. Pass the `nextCursor` from the previous
            response to get the next page of results.
          schema:
            type: string
            example: '123'
      responses:
        '200':
          description: Successfully retrieved Metrics.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Metric'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  hasMore:
                    type: boolean
                  total:
                    type: integer
                    minimum: 0
                required:
                  - data
                  - nextCursor
                  - hasMore
              examples:
                List Metrics:
                  summary: List Metrics
                  description: >-
                    Example response showing metrics with different evaluation
                    and output types.
                  value:
                    data:
                      - id: '456'
                        name: Response Accuracy
                        description: Evaluates if the response is factually accurate
                        outputType: boolean
                        evalType: ai
                        guidelines: >-
                          Check if the response contains factually correct
                          information
                        promptTemplate: >-
                          Please evaluate if the following response is factually
                          accurate: {{response}}
                        evalModelName: gpt-4o
                        temperature: 0.1
                      - id: '457'
                        name: Response Quality
                        description: Human review of quality
                        outputType: float
                        evalType: human
                        guidelines: Rate the coherence of the response (0-1).
                        passingThreshold: 0.8
                    nextCursor: null
                    hasMore: false
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '500':
          $ref: '#/components/responses/ServiceError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Scorecard from 'scorecard-ai';

            const client = new Scorecard({
              apiKey: 'My API Key',
            });

            // Automatically fetches more pages as needed.
            for await (const metric of client.metrics.list('314')) {
              console.log(metric);
            }
        - lang: Python
          source: |-
            from scorecard_ai import Scorecard

            client = Scorecard(
                api_key="My API Key",
            )
            page = client.metrics.list(
                project_id="314",
            )
            page = page.data[0]
            print(page)
        - lang: cURL
          source: |-
            curl https://api2.scorecard.io/api/v2/projects/$PROJECT_ID/metrics \
                -H "Authorization: Bearer $SCORECARD_API_KEY"
components:
  schemas:
    Metric:
      anyOf:
        - type: object
          properties:
            id:
              type: string
              description: The ID of the Metric.
            name:
              type: string
              description: The name of the Metric.
            description:
              type:
                - string
                - 'null'
              default: null
              description: The description of the Metric.
            evalType:
              type: string
              const: ai
              description: AI-based evaluation type.
            guidelines:
              type: string
              description: Guidelines for AI evaluation on how to score the metric.
            promptTemplate:
              type: string
              description: >-
                The complete prompt template for AI evaluation. Should include
                placeholders for dynamic content.
            evalModelName:
              type: string
              default: gpt-4o
              description: The AI model to use for evaluation.
            temperature:
              type: number
              minimum: 0
              maximum: 2
              default: 0
              description: The temperature for AI evaluation (0-2).
            outputType:
              type: string
              const: int
              description: Integer output type.
            passingThreshold:
              type: integer
              minimum: 1
              maximum: 5
              default: 4
              description: >-
                The threshold for determining pass/fail from integer scores
                (1-5).
          required:
            - id
            - name
            - description
            - evalType
            - guidelines
            - promptTemplate
            - evalModelName
            - temperature
            - outputType
            - passingThreshold
          description: A Metric with AI evaluation and integer output.
          title: AI int metric
        - type: object
          properties:
            id:
              type: string
              description: The ID of the Metric.
            name:
              type: string
              description: The name of the Metric.
            description:
              type:
                - string
                - 'null'
              default: null
              description: The description of the Metric.
            evalType:
              type: string
              const: human
              description: Human-based evaluation type.
            guidelines:
              type: string
              description: Guidelines for human evaluators.
            outputType:
              type: string
              const: int
              description: Integer output type.
            passingThreshold:
              type: integer
              minimum: 1
              maximum: 5
              default: 4
              description: >-
                The threshold for determining pass/fail from integer scores
                (1-5).
          required:
            - id
            - name
            - description
            - evalType
            - guidelines
            - outputType
            - passingThreshold
          description: A Metric with human evaluation and integer output.
          title: Human int metric
        - type: object
          properties:
            id:
              type: string
              description: The ID of the Metric.
            name:
              type: string
              description: The name of the Metric.
            description:
              type:
                - string
                - 'null'
              default: null
              description: The description of the Metric.
            evalType:
              type: string
              const: heuristic
              description: Heuristic-based evaluation type.
            guidelines:
              type: string
              description: Guidelines for heuristic evaluation logic.
            outputType:
              type: string
              const: int
              description: Integer output type.
            passingThreshold:
              type: integer
              minimum: 1
              maximum: 5
              default: 4
              description: >-
                The threshold for determining pass/fail from integer scores
                (1-5).
          required:
            - id
            - name
            - description
            - evalType
            - guidelines
            - outputType
            - passingThreshold
          description: A Metric with heuristic evaluation and integer output.
          title: Heuristic int metric
        - type: object
          properties:
            id:
              type: string
              description: The ID of the Metric.
            name:
              type: string
              description: The name of the Metric.
            description:
              type:
                - string
                - 'null'
              default: null
              description: The description of the Metric.
            evalType:
              type: string
              const: ai
              description: AI-based evaluation type.
            guidelines:
              type: string
              description: Guidelines for AI evaluation on how to score the metric.
            promptTemplate:
              type: string
              description: >-
                The complete prompt template for AI evaluation. Should include
                placeholders for dynamic content.
            evalModelName:
              type: string
              default: gpt-4o
              description: The AI model to use for evaluation.
            temperature:
              type: number
              minimum: 0
              maximum: 2
              default: 0
              description: The temperature for AI evaluation (0-2).
            outputType:
              type: string
              const: float
              description: Float output type (0-1).
            passingThreshold:
              type: number
              minimum: 0
              maximum: 1
              default: 0.9
              description: Threshold for determining pass/fail from float scores (0.0-1.0).
          required:
            - id
            - name
            - description
            - evalType
            - guidelines
            - promptTemplate
            - evalModelName
            - temperature
            - outputType
            - passingThreshold
          description: A Metric with AI evaluation and float output.
          title: AI float metric
        - type: object
          properties:
            id:
              type: string
              description: The ID of the Metric.
            name:
              type: string
              description: The name of the Metric.
            description:
              type:
                - string
                - 'null'
              default: null
              description: The description of the Metric.
            evalType:
              type: string
              const: human
              description: Human-based evaluation type.
            guidelines:
              type: string
              description: Guidelines for human evaluators.
            outputType:
              type: string
              const: float
              description: Float output type (0-1).
            passingThreshold:
              type: number
              minimum: 0
              maximum: 1
              default: 0.9
              description: Threshold for determining pass/fail from float scores (0.0-1.0).
          required:
            - id
            - name
            - description
            - evalType
            - guidelines
            - outputType
            - passingThreshold
          description: A Metric with human evaluation and float output.
          title: Human float metric
        - type: object
          properties:
            id:
              type: string
              description: The ID of the Metric.
            name:
              type: string
              description: The name of the Metric.
            description:
              type:
                - string
                - 'null'
              default: null
              description: The description of the Metric.
            evalType:
              type: string
              const: heuristic
              description: Heuristic-based evaluation type.
            guidelines:
              type: string
              description: Guidelines for heuristic evaluation logic.
            outputType:
              type: string
              const: float
              description: Float output type (0-1).
            passingThreshold:
              type: number
              minimum: 0
              maximum: 1
              default: 0.9
              description: Threshold for determining pass/fail from float scores (0.0-1.0).
          required:
            - id
            - name
            - description
            - evalType
            - guidelines
            - outputType
            - passingThreshold
          description: A Metric with heuristic evaluation and float output.
          title: Heuristic float metric
        - type: object
          properties:
            id:
              type: string
              description: The ID of the Metric.
            name:
              type: string
              description: The name of the Metric.
            description:
              type:
                - string
                - 'null'
              default: null
              description: The description of the Metric.
            evalType:
              type: string
              const: ai
              description: AI-based evaluation type.
            guidelines:
              type: string
              description: Guidelines for AI evaluation on how to score the metric.
            promptTemplate:
              type: string
              description: >-
                The complete prompt template for AI evaluation. Should include
                placeholders for dynamic content.
            evalModelName:
              type: string
              default: gpt-4o
              description: The AI model to use for evaluation.
            temperature:
              type: number
              minimum: 0
              maximum: 2
              default: 0
              description: The temperature for AI evaluation (0-2).
            outputType:
              type: string
              const: boolean
              description: Boolean output type.
          required:
            - id
            - name
            - description
            - evalType
            - guidelines
            - promptTemplate
            - evalModelName
            - temperature
            - outputType
          description: A Metric with AI evaluation and boolean output.
          title: AI boolean metric
        - type: object
          properties:
            id:
              type: string
              description: The ID of the Metric.
            name:
              type: string
              description: The name of the Metric.
            description:
              type:
                - string
                - 'null'
              default: null
              description: The description of the Metric.
            evalType:
              type: string
              const: human
              description: Human-based evaluation type.
            guidelines:
              type: string
              description: Guidelines for human evaluators.
            outputType:
              type: string
              const: boolean
              description: Boolean output type.
          required:
            - id
            - name
            - description
            - evalType
            - guidelines
            - outputType
          description: A Metric with human evaluation and boolean output.
          title: Human boolean metric
        - type: object
          properties:
            id:
              type: string
              description: The ID of the Metric.
            name:
              type: string
              description: The name of the Metric.
            description:
              type:
                - string
                - 'null'
              default: null
              description: The description of the Metric.
            evalType:
              type: string
              const: heuristic
              description: Heuristic-based evaluation type.
            guidelines:
              type: string
              description: Guidelines for heuristic evaluation logic.
            outputType:
              type: string
              const: boolean
              description: Boolean output type.
          required:
            - id
            - name
            - description
            - evalType
            - guidelines
            - outputType
          description: A Metric with heuristic evaluation and boolean output.
          title: Heuristic boolean metric
      description: >-
        A Metric defines how to evaluate system outputs against expected
        results.
    ApiError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
          x-stainless-any: true
      required:
        - code
        - message
        - details
      description: An API error.
  responses:
    UnauthenticatedError:
      description: Error indicating that the request is not authenticated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            Authentication failure:
              value:
                code: UNAUTHORIZED
                message: Invalid or missing authentication token
                details: {}
              summary: Authentication failure
              description: >-
                Error returned when authentication credentials are invalid or
                missing.
    ServiceError:
      description: >-
        An internal service error indicating an issue with the Scorecard
        service.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            Internal error:
              value:
                code: INTERNAL_ERROR
                message: An unexpected error occurred while processing your request.
                details: {}
              summary: Internal error
              description: Generic error when an unexpected internal issue occurs.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: starts with ak_

````