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

# Create Evaluation

> ### Description
Creates a evaluation

### Details
This API can be used to create a evaluation. To use this API, review the request schema and pass in all fields that are required to create a evaluation.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/sgp/openapi.yml post /v4/evaluations
openapi: 3.1.0
info:
  title: EGP API V4
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
tags:
  - name: Models
    description: Model API.
paths:
  /v4/evaluations:
    post:
      tags:
        - Evaluations
      summary: Create Evaluation
      description: >-
        ### Description

        Creates a evaluation


        ### Details

        This API can be used to create a evaluation. To use this API, review the
        request schema and pass in all fields that are required to create a
        evaluation.
      operationId: POST-V4-/evaluations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvaluationRequestUnion'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyEvaluationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from scale_gp import SGPClient

            client = SGPClient(
                api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
            )
            evaluation = client.evaluations.create(
                account_id="account_id",
                application_spec_id="application_spec_id",
                application_variant_id="application_variant_id",
                description="description",
                evaluation_dataset_id="evaluation_dataset_id",
                name="name",
            )
            print(evaluation.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/sgp-go\"\n\t\"github.com/stainless-sdks/sgp-go/option\"\n)\n\nfunc main() {\n\tclient := sgp.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tevaluation, err := client.Evaluations.New(context.TODO(), sgp.EvaluationNewParams{\n\t\tBody: sgp.EvaluationNewParamsBodyEvaluationBuilderRequest{\n\t\t\tAccountID:            sgp.F(\"account_id\"),\n\t\t\tApplicationSpecID:    sgp.F(\"application_spec_id\"),\n\t\t\tApplicationVariantID: sgp.F(\"application_variant_id\"),\n\t\t\tDescription:          sgp.F(\"description\"),\n\t\t\tEvaluationDatasetID:  sgp.F(\"evaluation_dataset_id\"),\n\t\t\tName:                 sgp.F(\"name\"),\n\t\t\tType:                 sgp.F(sgp.EvaluationNewParamsBodyEvaluationBuilderRequestTypeBuilder),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", evaluation.ID)\n}\n"
components:
  schemas:
    EvaluationRequestUnion:
      oneOf:
        - $ref: '#/components/schemas/EvaluationBuilderRequest'
        - $ref: '#/components/schemas/DefaultEvaluationRequest'
      title: EvaluationRequestUnion
      discriminator:
        propertyName: type
        mapping:
          builder:
            $ref: '#/components/schemas/EvaluationBuilderRequest'
          default:
            $ref: '#/components/schemas/DefaultEvaluationRequest'
    LegacyEvaluationResponse:
      properties:
        name:
          type: string
          title: Name
        description:
          title: Description
          type: string
        status:
          $ref: '#/components/schemas/EvaluationORMStatusEnum'
        application_spec_id:
          type: string
          title: Application Spec Id
        application_variant_id:
          type: string
          title: Application Variant Id
        tags:
          title: Tags
          additionalProperties: true
          type: object
        evaluation_config:
          title: Evaluation Config
          additionalProperties: true
          type: object
        evaluation_config_id:
          title: Evaluation Config Id
          description: The ID of the associated evaluation config.
          type: string
        completed_at:
          title: Completed At
          description: >-
            The date and time that all test case results for the evaluation were
            completed for the evaluation in ISO format.
          type: string
          format: date-time
        total_test_case_result_count:
          type: integer
          title: Total Test Case Result Count
          description: The total number of test case results for the evaluation
        completed_test_case_result_count:
          type: integer
          title: Completed Test Case Result Count
          description: >-
            The number of test case results that have been completed for the
            evaluation
        annotation_config:
          $ref: '#/components/schemas/AnnotationConfig'
          description: Annotation configuration for tasking
          can_patch: false
        question_id_to_annotation_config:
          title: Question Id To Annotation Config
          description: >-
            Specifies the annotation configuration to use for specific
            questions.
          can_patch: false
          additionalProperties:
            $ref: '#/components/schemas/AnnotationConfig'
          type: object
        metric_config:
          $ref: '#/components/schemas/MetricConfig'
          description: Specifies the config for the metrics to be computed.
          can_patch: false
        id:
          type: string
          title: Id
          description: The unique identifier of the entity.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The date and time when the entity was created in ISO format.
        account_id:
          type: string
          title: Account Id
          description: The ID of the account that owns the given entity.
          can_patch: false
        created_by_user_id:
          type: string
          title: Created By User Id
          description: The user who originally created the entity.
        created_by_identity_type:
          $ref: '#/components/schemas/IdentifierTypeEnum'
          description: The type of identity that created the entity.
        archived_at:
          title: Archived At
          description: The date and time when the entity was archived in ISO format.
          type: string
          format: date-time
      type: object
      required:
        - name
        - description
        - status
        - application_spec_id
        - total_test_case_result_count
        - completed_test_case_result_count
        - id
        - created_at
        - account_id
        - created_by_user_id
        - created_by_identity_type
      title: LegacyEvaluationResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EvaluationBuilderRequest:
      properties:
        name:
          type: string
          title: Name
        description:
          title: Description
          type: string
        application_spec_id:
          type: string
          title: Application Spec Id
        application_variant_id:
          type: string
          title: Application Variant Id
        tags:
          title: Tags
          additionalProperties: true
          type: object
        evaluation_config:
          title: Evaluation Config
          additionalProperties: true
          type: object
        evaluation_config_id:
          title: Evaluation Config Id
          description: The ID of the associated evaluation config.
          type: string
        question_id_to_annotation_config:
          title: Question Id To Annotation Config
          description: >-
            Specifies the annotation configuration to use for specific
            questions.
          additionalProperties:
            $ref: '#/components/schemas/AnnotationConfig'
          type: object
        metric_config:
          $ref: '#/components/schemas/MetricConfig'
          description: Specifies the config for the metrics to be computed.
          can_patch: false
        account_id:
          type: string
          title: Account Id
          description: The ID of the account that owns the given entity.
          can_patch: false
        annotation_config:
          anyOf:
            - $ref: '#/components/schemas/AnnotationConfigRequestBase'
            - $ref: '#/components/schemas/AnnotationConfigGenerationRequest'
            - $ref: '#/components/schemas/AnnotationConfigMultiturnUseCaseRequest'
            - $ref: '#/components/schemas/AnnotationConfigSummarizationUseCaseRequest'
            - $ref: '#/components/schemas/AnnotationConfigTranslationUseCaseRequest'
          title: Annotation Config
          description: Annotation configuration for tasking
        type:
          type: string
          const: builder
          title: Type
          description: >-
            create standalone evaluation or build evaluation which will auto
            generate test case results
          default: builder
        evaluation_dataset_id:
          type: string
          title: Evaluation Dataset Id
        evaluation_dataset_version:
          title: Evaluation Dataset Version
          type: integer
        application_test_case_output_group_id:
          title: Application Test Case Output Group Id
          type: string
        inline_evaluation_config:
          $ref: '#/components/schemas/EvaluationConfigRequestUnion'
          description: >-
            Inline evaluation config data to create atomically with the
            evaluation. Provide this OR evaluation_config_id, not both.
      type: object
      required:
        - name
        - description
        - application_spec_id
        - application_variant_id
        - account_id
        - evaluation_dataset_id
      title: EvaluationBuilderRequest
    DefaultEvaluationRequest:
      properties:
        name:
          type: string
          title: Name
        description:
          title: Description
          type: string
        application_spec_id:
          type: string
          title: Application Spec Id
        application_variant_id:
          type: string
          title: Application Variant Id
        tags:
          title: Tags
          additionalProperties: true
          type: object
        evaluation_config:
          title: Evaluation Config
          additionalProperties: true
          type: object
        evaluation_config_id:
          title: Evaluation Config Id
          description: The ID of the associated evaluation config.
          type: string
        question_id_to_annotation_config:
          title: Question Id To Annotation Config
          description: >-
            Specifies the annotation configuration to use for specific
            questions.
          additionalProperties:
            $ref: '#/components/schemas/AnnotationConfig'
          type: object
        metric_config:
          $ref: '#/components/schemas/MetricConfig'
          description: Specifies the config for the metrics to be computed.
          can_patch: false
        account_id:
          type: string
          title: Account Id
          description: The ID of the account that owns the given entity.
          can_patch: false
        annotation_config:
          anyOf:
            - $ref: '#/components/schemas/AnnotationConfigRequestBase'
            - $ref: '#/components/schemas/AnnotationConfigGenerationRequest'
            - $ref: '#/components/schemas/AnnotationConfigMultiturnUseCaseRequest'
            - $ref: '#/components/schemas/AnnotationConfigSummarizationUseCaseRequest'
            - $ref: '#/components/schemas/AnnotationConfigTranslationUseCaseRequest'
          title: Annotation Config
          description: Annotation configuration for tasking
        type:
          type: string
          const: default
          title: Type
          description: >-
            create standalone evaluation or build evaluation which will auto
            generate test case results
          default: default
      type: object
      required:
        - name
        - description
        - application_spec_id
        - account_id
      title: DefaultEvaluationRequest
    EvaluationORMStatusEnum:
      type: string
      enum:
        - PENDING
        - COMPLETED
        - FAILED
      title: EvaluationORMStatusEnum
    AnnotationConfig:
      properties:
        annotation_config_type:
          $ref: '#/components/schemas/AnnotationConfigType'
          default: flexible
        components:
          title: Components
          items:
            items:
              $ref: '#/components/schemas/AnnotationItem'
            type: array
          type: array
        direction:
          $ref: '#/components/schemas/AnnotationConfigDirectionType'
          default: row
        llm_prompt:
          $ref: '#/components/schemas/AutoEvaluationPrompt'
      type: object
      title: AnnotationConfig
    MetricConfig:
      properties:
        components:
          items:
            $ref: '#/components/schemas/MetricItem'
          type: array
          title: Components
      type: object
      required:
        - components
      title: MetricConfig
    IdentifierTypeEnum:
      type: string
      enum:
        - user
        - service_account
      title: IdentifierTypeEnum
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AnnotationConfigRequestBase:
      properties:
        components:
          title: Components
          items:
            items:
              $ref: '#/components/schemas/AnnotationItem'
            type: array
          type: array
        direction:
          $ref: '#/components/schemas/AnnotationConfigDirectionType'
          default: row
        llm_prompt:
          $ref: '#/components/schemas/AutoEvaluationPrompt'
      type: object
      title: AnnotationConfigRequestBase
    AnnotationConfigGenerationRequest:
      properties:
        llm_prompt_template:
          type: string
          title: Llm Prompt Template
      type: object
      required:
        - llm_prompt_template
      title: AnnotationConfigGenerationRequest
    AnnotationConfigMultiturnUseCaseRequest:
      properties:
        messages_loc:
          $ref: '#/components/schemas/DataLoc'
        llm_prompt:
          $ref: '#/components/schemas/AutoEvaluationPrompt'
      type: object
      required:
        - messages_loc
      title: AnnotationConfigMultiturnUseCaseRequest
    AnnotationConfigSummarizationUseCaseRequest:
      properties:
        document_loc:
          $ref: '#/components/schemas/DataLoc'
        summary_loc:
          $ref: '#/components/schemas/DataLoc'
        expected_summary_loc:
          $ref: '#/components/schemas/DataLoc'
        llm_prompt:
          $ref: '#/components/schemas/AutoEvaluationPrompt'
      type: object
      required:
        - document_loc
        - summary_loc
      title: AnnotationConfigSummarizationUseCaseRequest
    AnnotationConfigTranslationUseCaseRequest:
      properties:
        original_text_loc:
          $ref: '#/components/schemas/DataLoc'
        translation_loc:
          $ref: '#/components/schemas/DataLoc'
        language_loc:
          $ref: '#/components/schemas/DataLoc'
        expected_translation_loc:
          $ref: '#/components/schemas/DataLoc'
        llm_prompt:
          $ref: '#/components/schemas/AutoEvaluationPrompt'
      type: object
      required:
        - original_text_loc
        - translation_loc
      title: AnnotationConfigTranslationUseCaseRequest
    EvaluationConfigRequestUnion:
      oneOf:
        - $ref: '#/components/schemas/AutoEvalEvaluationConfigRequest'
        - $ref: '#/components/schemas/ManualEvaluationConfigRequest'
      title: EvaluationConfigRequestUnion
      discriminator:
        propertyName: evaluation_type
        mapping:
          human:
            $ref: '#/components/schemas/ManualEvaluationConfigRequest'
          llm_auto:
            $ref: '#/components/schemas/AutoEvalEvaluationConfigRequest'
          llm_benchmark:
            $ref: '#/components/schemas/AutoEvalEvaluationConfigRequest'
          studio:
            $ref: '#/components/schemas/ManualEvaluationConfigRequest'
    AnnotationConfigType:
      type: string
      enum:
        - generation
        - flexible
        - summarization
        - multiturn
        - translation
      title: AnnotationConfigType
    AnnotationItem:
      properties:
        optional:
          type: boolean
          title: Optional
          default: false
        data_loc:
          $ref: '#/components/schemas/DataLoc'
        label:
          title: Label
          type: string
      type: object
      required:
        - data_loc
      title: AnnotationItem
    AnnotationConfigDirectionType:
      type: string
      enum:
        - col
        - row
      title: AnnotationConfigDirectionType
    AutoEvaluationPrompt:
      properties:
        variables:
          items:
            $ref: '#/components/schemas/PromptVariable'
          type: array
          title: Variables
        template:
          type: string
          title: Template
      type: object
      required:
        - variables
        - template
      title: AutoEvaluationPrompt
    MetricItem:
      properties:
        type:
          $ref: '#/components/schemas/MetricScorerType'
        name:
          type: string
          title: Name
        mappings:
          title: Mappings
          additionalProperties:
            $ref: '#/components/schemas/DataLoc'
          type: object
        params:
          title: Params
          additionalProperties: true
          type: object
      type: object
      required:
        - type
        - name
      title: MetricItem
    DataLoc:
      items:
        type: string
      type: array
      title: DataLoc
    AutoEvalEvaluationConfigRequest:
      properties:
        evaluation_type:
          anyOf:
            - type: string
              const: llm_auto
            - type: string
              const: llm_benchmark
          title: Evaluation Type
          description: Evaluation type
          default: llm_auto
        question_set_id:
          type: string
          title: Question Set Id
        studio_project_id:
          title: Studio Project Id
          type: string
        auto_evaluation_model:
          type: string
          enum:
            - llama-3-1-70b-instruct
            - gpt-4-turbo-2024-04-09
            - llama-3-70b-instruct-bedrock
            - gpt-4o
            - gpt-4o-mini
            - gpt-4.1
            - gpt-4.1-mini
            - gpt-4.1-nano
            - gpt-5-nano
            - gpt-5-mini
            - gpt-5
            - gpt-5.1
            - gpt-5.2
            - o1
            - o3
            - o3-mini
            - o4-mini
          title: Auto Evaluation Model
          description: The name of the model to be used for auto-evaluation
          default: gpt-4-turbo-2024-04-09
        auto_evaluation_parameters:
          $ref: '#/components/schemas/AutoEvaluationParameters'
          description: Execution parameters for auto-evaluation
        account_id:
          type: string
          title: Account Id
          description: The ID of the account that owns the given entity.
          can_patch: false
      type: object
      required:
        - question_set_id
        - account_id
      title: AutoEvalEvaluationConfigRequest
    ManualEvaluationConfigRequest:
      properties:
        evaluation_type:
          anyOf:
            - type: string
              const: studio
            - type: string
              const: human
          title: Evaluation Type
          description: Evaluation type
          default: studio
        question_set_id:
          type: string
          title: Question Set Id
        studio_project_id:
          title: Studio Project Id
          type: string
        auto_evaluation_model:
          type: 'null'
          title: Auto Evaluation Model
          description: >-
            The name of the model to be used for auto-evaluation. Not applicable
            for manual evaluations.
        auto_evaluation_parameters:
          $ref: '#/components/schemas/AutoEvaluationParameters'
          description: Execution parameters for auto-evaluation
        account_id:
          type: string
          title: Account Id
          description: The ID of the account that owns the given entity.
          can_patch: false
      type: object
      required:
        - question_set_id
        - account_id
      title: ManualEvaluationConfigRequest
    PromptVariable:
      properties:
        name:
          type: string
          title: Name
        optional:
          type: boolean
          title: Optional
          default: false
        data_loc:
          $ref: '#/components/schemas/DataLoc'
      type: object
      required:
        - name
        - data_loc
      title: PromptVariable
    MetricScorerType:
      type: string
      enum:
        - rouge
        - rouge1
        - rouge2
        - rougeL
        - bleu
        - meteor
        - cosine_similarity
        - f1
      title: MetricScorerType
    AutoEvaluationParameters:
      properties:
        temperature:
          title: Temperature
          type: number
          maximum: 2
          minimum: 0
        batch_size:
          title: Batch Size
          type: integer
          maximum: 25
          minimum: 1
      type: object
      title: AutoEvaluationParameters
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````