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

# Get Metric

> Retrieve a specific Metric by ID.



## OpenAPI

````yaml get /metrics/{metricId}
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:
  /metrics/{metricId}:
    get:
      summary: Get Metric
      description: Retrieve a specific Metric by ID.
      operationId: getMetric
      parameters:
        - in: path
          name: metricId
          description: The ID of the Metric to retrieve.
          schema:
            type: string
            example: '321'
          required: true
      responses:
        '200':
          description: Successfully retrieved Metric.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Metric'
              examples:
                AI Metric:
                  summary: AI Metric
                  description: Example response showing an AI metric with boolean output.
                  value:
                    id: '654'
                    name: Response Accuracy
                    description: Evaluates factual correctness
                    evalType: ai
                    guidelines: Check if the response is factually correct.
                    promptTemplate: >-
                      Evaluate if the following response is factually correct:
                      {{outputs.response}}
                    evalModelName: gpt-4o
                    temperature: 0.1
                    outputType: boolean
                Human Float Metric:
                  summary: Human Float Metric
                  description: >-
                    Example response showing a human evaluated metric with float
                    output.
                  value:
                    id: '655'
                    name: Response Quality
                    description: Human review of response quality
                    evalType: human
                    guidelines: Rate the response quality between 0 and 1.
                    outputType: float
                    passingThreshold: 0.85
        '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',
            });

            const metric = await client.metrics.get('321');

            console.log(metric);
        - lang: Python
          source: |-
            from scorecard_ai import Scorecard

            client = Scorecard(
                api_key="My API Key",
            )
            metric = client.metrics.get(
                "321",
            )
            print(metric)
        - lang: cURL
          source: |-
            curl https://api2.scorecard.io/api/v2/metrics/$METRIC_ID \
                -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_

````