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

# Get a Task

> Retrieve a [Task](/core-resources/task) from its `task_id`.

<Accordion title="Authentication" icon="key">
  Every request sent to Scale's API requires authentication. In short, your API Key is the Bearer token. See the [Authentication](/get-started/authentication) section for more details.
</Accordion>


## OpenAPI

````yaml GET /v2/task
openapi: 3.1.0
info:
  title: GenAI API Spec
  description: 'Data Engine: Generative AI API Specification'
  version: 0.0.1
servers:
  - url: https://api.scale.com
security:
  - bearerAuth: []
  - basicAuth: []
paths:
  /v2/task:
    get:
      tags:
        - v2
      summary: Get a Task
      description: Retrieve a [Task](/core-resources/task) from its `task_id`.
      operationId: getTask
      parameters:
        - $ref: '#/components/parameters/task_id'
        - $ref: '#/components/parameters/expand_task'
        - $ref: '#/components/parameters/opts'
      responses:
        '200':
          description: Completed task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTaskResponse'
              examples:
                Sample Eval Task:
                  $ref: '#/components/examples/SampleEvalTask'
                Sample RLHF Task:
                  $ref: '#/components/examples/SampleRlhfTask'
                Sample Rubrics Task:
                  $ref: '#/components/examples/SampleRubricsTask'
                Sample SFT Task:
                  $ref: '#/components/examples/SampleSftTask'
                Sample Pending Task:
                  $ref: '#/components/examples/SamplePendingTask'
                Sample Task w/ Expanded Project and Batch:
                  $ref: '#/components/examples/SampleExpandedTask'
        '500':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status_code:
                    type: number
                    example: 500
                  error:
                    type: string
                    example: An error has occurred.
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            API_KEY='live_...'
            TASK_ID='abc123'
            curl --request GET \
                --url "https://api.scale.com/v2/task?task_id=$TASK_ID" \
                --header "Authorization: Bearer $API_KEY"
        - lang: python
          label: Python SDK
          source: |
            import scaleapi

            API_KEY = 'live_...'
            client = scaleapi.ScaleClient(API_KEY)

            TASK_ID = 'abc123'
            response = client.v2.get_task(TASK_ID)
            print(response.to_json())
        - lang: python
          label: Python
          source: |
            import requests

            API_KEY = 'live_...'
            TASK_ID = 'abc123'

            response = requests.request(
              "GET",
              url="https://api.scale.com/v2/task",
              params={"task_id": TASK_ID},
              headers={
                "Accept": "application/json",
                "Authorization": f"Bearer {API_KEY}",
              },
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >
            const API_KEY = 'live_...';

            const TASK_ID = 'abc123';


            const params = new URLSearchParams({ task_id: TASK_ID });


            const response = await fetch('https://api.scale.com/v2/task?' +
            params.toString(), {
              method: 'GET',
              headers: {
                Accept: 'application/json',
                Authorization: `Bearer ${API_KEY}`,
              },
            });

            console.log(await response.json());
        - lang: go
          label: Go
          source: |
            package main

            import (
              "fmt"

              "io/ioutil"
              "net/http"
            )

            func main() {
              apiKey := "live_..."
              taskId := "abc123"

              url := fmt.Sprintf("https://api.scale.com/v2/task?task_id=%s", taskId)

              req, _ := http.NewRequest("GET", url, nil)

              req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", apiKey))

              res, _ := http.DefaultClient.Do(req)

              defer res.Body.Close()
              body, _ := ioutil.ReadAll(res.Body)

              fmt.Println(string(body))
            }
        - lang: java
          label: Java
          source: |
            package com.scale.api;

            import kong.unirest.HttpResponse;
            import kong.unirest.Unirest;

            public class App {
                public static void main(String[] args) {
                    String apiKey = "live_...";
                    String taskId = "abc123";

                    String url = String.format("https://api.scale.com/v2/task?task_id=%s", taskId);

                    HttpResponse<String> response = Unirest.get(url)
                      .header("Authorization", String.format("Bearer %s", apiKey))
                      .asString();

                    System.out.println(response.getBody());
                }
            }
components:
  parameters:
    task_id:
      name: task_id
      in: query
      required: true
      description: Scale's unique identifier for the task.
      schema:
        $ref: '#/components/schemas/TaskId'
    expand_task:
      name: expand
      in: query
      required: false
      description: >-
        List of fields to [expand](/api-reference/expanding-entities) in the
        response.
      schema:
        $ref: '#/components/schemas/ExpandTask'
    opts:
      name: opts
      in: query
      required: false
      description: List of properties to include in the task response.
      schema:
        $ref: '#/components/schemas/Options'
  schemas:
    GetTaskResponse:
      $ref: '#/components/schemas/Task'
    TaskId:
      type: string
      description: Unique identifier for a task
      example: task_abc123
    ExpandTask:
      type: array
      description: >-
        Entities that can be [expanded](/api-reference/expanding-entities) from
        an ID to an object.
      items:
        $ref: '#/components/schemas/ExpandableEnumTask'
    Options:
      type: array
      description: Additional properties that can be included in the annotations
      items:
        $ref: '#/components/schemas/Option'
    Task:
      type: object
      required:
        - task_id
        - project
        - created_at
        - status
      properties:
        task_id:
          $ref: '#/components/schemas/TaskId'
          description: Unique identifier for the task.
        project:
          $ref: '#/components/schemas/ExpandableProject'
          description: >-
            Project ID or [Project](/core-resources/project) associated with the
            task.
        batch:
          $ref: '#/components/schemas/ExpandableBatch'
          description: Batch ID or [Batch](/core-resources/batch) associated with the task.
        status:
          $ref: '#/components/schemas/TaskStatus'
          description: Current status of the task.
        created_at:
          $ref: '#/components/schemas/DateString'
          description: UTC timestamp when the task was created.
        completed_at:
          $ref: '#/components/schemas/DateString'
          description: UTC timestamp when the task was completed.
        metadata:
          $ref: '#/components/schemas/Metadata'
        threads:
          $ref: '#/components/schemas/Threads'
        errors:
          $ref: '#/components/schemas/Errors'
        sensitive_content_reports:
          $ref: '#/components/schemas/SensitiveContentReports'
    ExpandableEnumTask:
      type: string
      description: Entities that can be expanded from an ID to an object.
      enum:
        - project
        - batch
    Option:
      type: string
      description: Property that can be included in the annotations
      enum:
        - annotation_details
        - attachment_details
        - model_parameters
    ExpandableProject:
      description: >-
        Project ID or [Project](/core-resources/project) associated with the
        task.
      oneOf:
        - $ref: '#/components/schemas/ProjectId'
        - $ref: '#/components/schemas/Project'
    ExpandableBatch:
      description: Batch ID or [Batch](/core-resources/batch) associated with the task.
      oneOf:
        - $ref: '#/components/schemas/BatchId'
        - $ref: '#/components/schemas/Batch'
    TaskStatus:
      type: string
      enum:
        - pending
        - completed
        - canceled
        - error
      description: >-
        The current status of the task, indicating whether it is pending,
        completed, error, or canceled.
    DateString:
      type: string
      format: date-time
      description: A timestamp formatted as an ISO 8601 date-time string.
    Metadata:
      type: object
      description: Custom metadata for the entity.
      additionalProperties: true
      default: {}
    Threads:
      type: array
      description: >-
        Threads associated with the task. Tasks that do not have a `status` of
        `completed` will have an empty `threads` array.
      items:
        $ref: '#/components/schemas/Thread'
    Errors:
      type: array
      description: >-
        Errors associated with the task. Available when the task status is
        `error`
      items:
        $ref: '#/components/schemas/ErrorDetail'
    SensitiveContentReports:
      type: array
      description: >-
        Reports of sensitive content within the task. Available when the task
        status is `completed`. `threads` will not exist when the task is
        reported.
      items:
        $ref: '#/components/schemas/SensitiveContentReport'
    ProjectId:
      type: string
      description: A unique identifier for the project.
      example: project_abc123
    Project:
      type: object
      required:
        - id
        - name
        - created_at
      properties:
        id:
          $ref: '#/components/schemas/ProjectId'
          description: Unique identifier for the project
        name:
          $ref: '#/components/schemas/ProjectName'
        created_at:
          $ref: '#/components/schemas/DateString'
        types:
          type: array
          description: List of project types associated with the project.
          items:
            $ref: '#/components/schemas/GenAIProjectType'
          example:
            - 'RLHF: Pref Ranking'
        models:
          type: array
          description: List of models associated with the project.
          items:
            $ref: '#/components/schemas/Model'
          example:
            - gpt-4
            - my-model-123
    BatchId:
      type: string
      description: A unique identifier for the batch.
      example: batch_abc123
    Batch:
      type: object
      required:
        - id
        - name
        - project
        - created_at
        - status
        - metadata
      properties:
        id:
          $ref: '#/components/schemas/BatchId'
        name:
          $ref: '#/components/schemas/BatchName'
        project:
          $ref: '#/components/schemas/ExpandableProject'
          description: >-
            Project ID or [Project](/core-resources/project) associated with the
            batch.
        created_at:
          $ref: '#/components/schemas/DateString'
        completed_at:
          $ref: '#/components/schemas/DateString'
          description: UTC timestamp when the batch was completed.
        status:
          $ref: '#/components/schemas/BatchStatus'
        callback:
          $ref: '#/components/schemas/Callback'
        metadata:
          $ref: '#/components/schemas/BatchMetadata'
    Thread:
      type: object
      required:
        - id
        - turns
        - annotations
      properties:
        id:
          $ref: '#/components/schemas/ThreadId'
          description: Unique identifier for the thread.
        turns:
          $ref: '#/components/schemas/Turns'
        annotations:
          $ref: '#/components/schemas/Annotations'
          description: |
            [Annotations](/core-resources/annotation) for the entire thread.
    ErrorDetail:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
          description: Type of the error
        message:
          $ref: '#/components/schemas/ErrorMessage'
          description: Details of the error message. e.g. Locale is not supported
    SensitiveContentReport:
      type: object
      properties:
        type:
          type: string
          example: violence
        message:
          type: string
          example: The prompt in the task promotes violence.
    ProjectName:
      type: string
      description: The name of the project.
      example: My Scale Project
    GenAIProjectType:
      type: string
      enum:
        - SFT
        - 'RLHF: Pref Ranking'
        - 'RLHF: Pref Ranking with Rewrites'
        - 'RLVR: Reinforcement Learning with Verifiable Rewards'
        - Rubrics
        - Process Supervision
        - Evals
        - Prompt Generation
        - Content Understanding
        - Other
    Model:
      type: string
      description: The name of the model that generated the message.
      example: my-model-123
    BatchName:
      type: string
      description: The name of the batch.
      example: My Scale Batch
    BatchStatus:
      type: string
      enum:
        - staging
        - in_progress
        - completed
        - paused
        - cancelled
      description: Status of the batch.
    Callback:
      type: string
      description: Callback URL or email for the entity upon completion.
      example: https://example.com/callback
    BatchMetadata:
      $ref: '#/components/schemas/Metadata'
    ThreadId:
      type: string
      description: Unique identifier for a thread
      example: thread_abc123
    Turns:
      type: array
      description: |
        [Turns](/core-resources/turn) within the thread.
      items:
        $ref: '#/components/schemas/Turn'
    Annotations:
      type: array
      description: Array of annotations.
      items:
        $ref: '#/components/schemas/Annotation'
    ErrorType:
      type: string
      enum:
        - UNSUPPORTED_LANGUAGE
        - LANGUAGE_MISMATCH
        - PROMPT_LENGTH_EXCEEDED
        - INVALID_CATEGORY
        - PROMPT_INFEASIBLE
      description: Type of the error
      example: UNSUPPORTED_LANGUAGE
    ErrorMessage:
      type: string
      description: Details of the error message
      example: The specified language or locale is not supported
    Turn:
      type: object
      required:
        - id
        - messages
        - annotations
      properties:
        id:
          $ref: '#/components/schemas/TurnId'
        messages:
          type: array
          description: >-
            A list of [messages](/core-resources/message) associated with this
            turn.
          items:
            $ref: '#/components/schemas/Message'
        annotations:
          $ref: '#/components/schemas/Annotations'
          description: >
            [Annotations](/core-resources/annotation) applied to the entire
            turn.
    Annotation:
      type: object
      description: Represents a generic annotation.
      required:
        - id
        - key
        - type
      oneOf:
        - $ref: '#/components/schemas/AnnotationInteger'
        - $ref: '#/components/schemas/AnnotationBoolean'
        - $ref: '#/components/schemas/AnnotationText'
        - $ref: '#/components/schemas/AnnotationCategory'
        - $ref: '#/components/schemas/AnnotationCategoryMultiple'
        - $ref: '#/components/schemas/AnnotationFile'
        - $ref: '#/components/schemas/AnnotationWorkspaceContainer'
        - $ref: '#/components/schemas/AnnotationRankedChoices'
        - $ref: '#/components/schemas/AnnotationRankedGroups'
      discriminator:
        propertyName: type
        mapping:
          integer:
            $ref: '#/components/schemas/AnnotationInteger'
          boolean:
            $ref: '#/components/schemas/AnnotationBoolean'
          text:
            $ref: '#/components/schemas/AnnotationText'
          category:
            $ref: '#/components/schemas/AnnotationCategory'
          category_multiple:
            $ref: '#/components/schemas/AnnotationCategoryMultiple'
          file:
            $ref: '#/components/schemas/AnnotationFile'
          workspace_container:
            $ref: '#/components/schemas/AnnotationWorkspaceContainer'
          ranked_choices:
            $ref: '#/components/schemas/AnnotationRankedChoices'
          ranked_groups:
            $ref: '#/components/schemas/AnnotationRankedGroups'
    TurnId:
      type: string
      description: A unique identifier for the turn.
      example: turn_abc123
    Message:
      type: object
      required:
        - role
        - content
        - source_id
        - annotations
      properties:
        role:
          $ref: '#/components/schemas/MessageRole'
          description: The role of the sender in the conversation (e.g., user, assistant).
        content:
          $ref: '#/components/schemas/MessageContent'
          description: The content of the message, including text and any attachments.
        source_id:
          $ref: '#/components/schemas/SourceId'
          description: The ID of the source system or user that sent the message.
        model_parameters:
          $ref: '#/components/schemas/ModelParameters'
        annotations:
          $ref: '#/components/schemas/Annotations'
          description: |
            [Annotations](/core-resources/annotation) specific to this message.
    AnnotationInteger:
      title: Integer
      allOf:
        - $ref: '#/components/schemas/BaseAnnotation'
        - $ref: '#/components/schemas/AnnotationIntegerProperties'
    AnnotationBoolean:
      title: Boolean
      allOf:
        - $ref: '#/components/schemas/BaseAnnotation'
        - $ref: '#/components/schemas/AnnotationBooleanProperties'
    AnnotationText:
      title: Text
      allOf:
        - $ref: '#/components/schemas/BaseAnnotation'
        - $ref: '#/components/schemas/AnnotationTextProperties'
    AnnotationCategory:
      title: Category
      allOf:
        - $ref: '#/components/schemas/BaseAnnotation'
        - $ref: '#/components/schemas/AnnotationCategoryProperties'
    AnnotationCategoryMultiple:
      title: Category-Multiple
      allOf:
        - $ref: '#/components/schemas/BaseAnnotation'
        - $ref: '#/components/schemas/AnnotationCategoryMultipleProperties'
    AnnotationFile:
      title: File
      allOf:
        - $ref: '#/components/schemas/BaseAnnotation'
        - $ref: '#/components/schemas/AnnotationFileProperties'
    AnnotationWorkspaceContainer:
      title: Workspace Container
      allOf:
        - $ref: '#/components/schemas/BaseAnnotation'
        - $ref: '#/components/schemas/AnnotationWorkspaceContainerProperties'
    AnnotationRankedChoices:
      title: Ranked Choices
      description: >-
        A list of choices where the beginning of the list is preferred. Ties are
        not allowed.
      allOf:
        - $ref: '#/components/schemas/BaseAnnotation'
        - $ref: '#/components/schemas/AnnotationRankedChoicesProperties'
    AnnotationRankedGroups:
      title: Ranked Groups
      description: >-
        A list of choices where the beginning of the list is preferred. When
        there's a tie, multiple choices will be at the same index.
      allOf:
        - $ref: '#/components/schemas/BaseAnnotation'
        - $ref: '#/components/schemas/AnnotationRankedGroupsProperties'
    MessageRole:
      type: string
      enum:
        - system
        - user
        - assistant
        - function
      description: >-
        The role of the sender in the conversation. Possible values include
        system, user, assistant, and function.
    MessageContent:
      type: object
      properties:
        text:
          $ref: '#/components/schemas/Text'
          description: The textual content of the message.
        reference_texts:
          $ref: '#/components/schemas/ReferenceTexts'
          description: The reference texts associated with the message.
        attachments:
          $ref: '#/components/schemas/Attachments'
          description: Any files or attachments included with the message.
        chunks:
          $ref: '#/components/schemas/Chunks'
          description: |
            [Chunks](/core-resources/chunk) specific to this message.
        reasoning:
          $ref: '#/components/schemas/ReasoningList'
    SourceId:
      type: string
      description: A unique identifier for the source.
      example: source_abc123
    ModelParameters:
      type: object
      properties:
        model:
          $ref: '#/components/schemas/Model'
        temperature:
          $ref: '#/components/schemas/Temperature'
        max_completion_tokens:
          $ref: '#/components/schemas/MaxCompletionTokens'
        top_p:
          $ref: '#/components/schemas/TopP'
        top_k:
          $ref: '#/components/schemas/TopK'
    BaseAnnotation:
      type: object
      required:
        - id
        - key
        - type
      properties:
        id:
          $ref: '#/components/schemas/AnnotationId'
          description: Unique identifier for the annotation.
          example: an_abc123efg456
        key:
          $ref: '#/components/schemas/AnnotationKey'
          description: Key for the annotation.
          example: formatting
        type:
          type: string
          description: The type of the value and the possible_values, if they exist.
        title:
          $ref: '#/components/schemas/Title'
          example: Response Formatting
        description:
          $ref: '#/components/schemas/Description'
          example: Does the response contain issues with formatting?
        labels:
          type: array
          description: String representation of the possible options.
          items:
            $ref: '#/components/schemas/AnnotationLabel'
          example:
            - Major Issues
            - Minor Issues
            - No Issues
        metadata:
          $ref: '#/components/schemas/AnnotationMetadata'
    AnnotationIntegerProperties:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/IntegerValue'
        possible_values:
          type: array
          description: The possible values for this annotation.
          items:
            $ref: '#/components/schemas/IntegerValue'
            example:
              - 1
              - 2
              - 3
    AnnotationBooleanProperties:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/BooleanValue'
        possible_values:
          type: array
          description: The possible values for this annotation.
          items:
            $ref: '#/components/schemas/BooleanValue'
            example:
              - true
              - false
    AnnotationTextProperties:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/TextValue'
    AnnotationCategoryProperties:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/CategoryValue'
        possible_values:
          type: array
          description: The possible values for this annotation.
          items:
            $ref: '#/components/schemas/CategoryValue'
            example:
              - Brainstorming
              - Critical Thinking
              - Math
    AnnotationCategoryMultipleProperties:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/CategoryMultipleValue'
        possible_values:
          $ref: '#/components/schemas/CategoryMultipleValue'
          description: The possible values for this annotation.
          example:
            - Brainstorming
            - Critical Thinking
            - Math
    AnnotationFileProperties:
      type: object
      properties:
        value:
          oneOf:
            - $ref: '#/components/schemas/DetailedFile'
              title: File
            - $ref: '#/components/schemas/MultipleFiles'
              title: Multiple Attachments
    AnnotationWorkspaceContainerProperties:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/WorkspaceContainerValue'
          title: Workspace Container
    AnnotationRankedChoicesProperties:
      type: object
      properties:
        value:
          type: array
          items:
            $ref: '#/components/schemas/RankedChoice'
          example:
            - model_1
            - model_3
            - model_2
    AnnotationRankedGroupsProperties:
      type: object
      properties:
        value:
          type: array
          items:
            $ref: '#/components/schemas/RankedGroup'
          example:
            - - model_a
              - model_c
            - - model_b
    Text:
      description: A plain text field.
      type: string
    ReferenceTexts:
      type: array
      items:
        $ref: '#/components/schemas/ReferenceText'
      description: A list of files or attachments associated with the message.
    Attachments:
      type: array
      items:
        $ref: '#/components/schemas/DetailedFile'
      description: A list of files or attachments associated with the message.
    Chunks:
      type: array
      items:
        $ref: '#/components/schemas/Chunk'
    ReasoningList:
      type: array
      description: List of reasoning blocks for a message.
      items:
        $ref: '#/components/schemas/Reasoning'
    Temperature:
      type: number
      description: The temperature of the model that generated the message.
      example: 0.9
    MaxCompletionTokens:
      type: integer
      description: The maximum number of tokens the model can generate.
      example: 1000
    TopP:
      type: number
      description: The top-p value of the model that generated the message.
      example: 0.9
    TopK:
      type: integer
      description: The top-k value of the model that generated the message.
      example: 4
    AnnotationId:
      type: string
      description: Unique identifier for an annotation.
      example: overall_quality
    AnnotationKey:
      type: string
      description: Key for the annotation.
      example: formatting
    Title:
      type: string
      description: Title of the annotation.
      example: Overall Response Score
    Description:
      type: string
      description: Further details about the question.
      example: How would you rate the entire response overall?
    AnnotationLabel:
      type: string
      description: A string representation of the annotation.
    AnnotationMetadata:
      type: object
      properties:
        criteria:
          $ref: '#/components/schemas/ExpandableAnnotation'
    IntegerValue:
      description: Integer type annotation value.
      type: integer
      example: 3
    BooleanValue:
      description: Boolean type annotation value.
      type: boolean
      example: true
    TextValue:
      type: string
      description: String type annotation value.
      example: 'There were multiple issues in the response: 1. ...'
    CategoryValue:
      type: string
      description: Single-select category annotation.
      example: Critical Thinking
    CategoryMultipleValue:
      description: Multi-select category annotation.
      example:
        - Critical Thinking
        - Math
      type: array
      items:
        type: string
    DetailedFile:
      oneOf:
        - $ref: '#/components/schemas/BasicFile'
          title: File
        - $ref: '#/components/schemas/ImageFile'
          title: Detailed Image File
        - $ref: '#/components/schemas/AudioFile'
          title: Detailed Audio File
    MultipleFiles:
      type: array
      items:
        $ref: '#/components/schemas/BasicFile'
    WorkspaceContainerValue:
      type: object
      properties:
        workspace_id:
          type: string
          description: ID of the workspace.
        workspace_config:
          $ref: '#/components/schemas/WorkspaceContainerConfig'
        last_code_run_event:
          $ref: '#/components/schemas/WorkspaceExecutionData'
          type: object
        output_files:
          type: array
          items:
            $ref: '#/components/schemas/WorkspaceFile'
        stdout_output:
          $ref: '#/components/schemas/ContentAndUrl'
          description: Standard output stream of the workspace.
        stderr_output:
          $ref: '#/components/schemas/ContentAndUrl'
          description: Standard error stream of the workspace.
        test_stdout_output:
          $ref: '#/components/schemas/ContentAndUrl'
          description: Standard output stream of the workspace for test cases.
        test_stderr_output:
          $ref: '#/components/schemas/ContentAndUrl'
          description: Standard error stream of the workspace for test cases.
    RankedChoice:
      type: string
    RankedGroup:
      type: array
      items:
        type: string
    ReferenceText:
      type: object
      properties:
        content:
          type: string
          description: Content of the reference text.
        category:
          type: string
          description: Category of the reference text.
        url:
          $ref: '#/components/schemas/URL'
          description: URL source of the reference text.
    Chunk:
      oneOf:
        - $ref: '#/components/schemas/ChunkText'
          title: Text
      discriminator:
        propertyName: type
        mapping:
          text:
            $ref: '#/components/schemas/ChunkText'
    Reasoning:
      type: object
      properties:
        content:
          type: string
          description: The reasoning for the content of a message.
    ExpandableAnnotation:
      oneOf:
        - $ref: '#/components/schemas/AnnotationId'
        - type: object
          description: >-
            A full Annotation object. This is defined as a generic object to
            avoid circular references that some tools cannot handle.
    BasicFile:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/Bytes'
          description: The base64-encoded content of the file.
        mime_type:
          $ref: '#/components/schemas/MimeType'
          description: The MIME type of the file, indicating its format.
        scale_url:
          $ref: '#/components/schemas/URL'
          description: A URL pointing to the location of the file in Scale's storage.
        url:
          $ref: '#/components/schemas/URL'
          description: A URL pointing to the source location of the file.
        name:
          $ref: '#/components/schemas/FileName'
          description: The name of the file.
    ImageFile:
      type: object
      properties:
        mime_type:
          $ref: '#/components/schemas/MimeType'
          description: The MIME type of the file, indicating its format.
        scale_url:
          $ref: '#/components/schemas/URL'
          description: A URL pointing to the location of the file in Scale's storage.
        url:
          $ref: '#/components/schemas/URL'
          description: A URL pointing to the source location of the file.
        name:
          type: string
          description: The name of the image file.
        file_size_in_bytes:
          type: integer
          description: The size of the file in bytes.
    AudioFile:
      type: object
      properties:
        mime_type:
          $ref: '#/components/schemas/MimeType'
          description: The MIME type of the file, indicating its format.
        scale_url:
          $ref: '#/components/schemas/URL'
          description: A URL pointing to the scale location of the file.
        url:
          $ref: '#/components/schemas/URL'
          description: A URL pointing to the source location of the file.
        duration:
          type: number
          description: The duration of the audio file in seconds.
        transcript:
          type: string
          description: The transcript of the audio file.
        transcript_url:
          $ref: '#/components/schemas/URL'
          description: A URL pointing to the location of the transcript.
        transcript_start:
          type: number
          description: The start time of the transcript in seconds.
        transcript_end:
          type: number
          description: The end time of the transcript in seconds.
    WorkspaceContainerConfig:
      type: object
      required:
        - workspace_id
        - workspace_url
        - workspace_token
        - expires_at
        - inactivity_freeze_time
      properties:
        workspace_id:
          type: string
          description: ID of the workspace.
        workspace_url:
          $ref: '#/components/schemas/URL'
          type: string
          description: URL of the workspace.
        workspace_token:
          type: string
          description: Token of the workspace.
        expires_at:
          type: string
          description: Expiration time of the workspace.
        inactivity_freeze_time:
          type: integer
          description: Inactivity freeze time of the workspace.
        force_enable_workspace_access:
          type: boolean
          description: Force enable workspace access.
        workspace_image_version:
          type: integer
          description: Image version of the workspace.
    WorkspaceExecutionData:
      type: object
      properties:
        id:
          type: string
          description: ID of the workspace.
        result:
          type: object
          properties:
            status:
              type: object
              properties:
                code:
                  type: number
                  description: Status code of the workspace execution.
                name:
                  type: string
                  description: Execution full status.
            time:
              type: number
              description: Time taken for last execution.
            score:
              type: number
              description: Score of the output of last execution.
    WorkspaceFile:
      type: object
      required:
        - scale_url
      properties:
        file_name:
          type: string
          description: File name
        scale_url:
          $ref: '#/components/schemas/URL'
          description: A URL pointing to the scale location of the file.
        url:
          $ref: '#/components/schemas/URL'
          description: A URL pointing to the source location of the file.
        file_language:
          type: string
          description: Coding language of the file.
        file_content:
          type: string
          description: Content of the file.
    ContentAndUrl:
      type: object
      properties:
        content:
          type: string
          description: The content of the file.
        url:
          $ref: '#/components/schemas/URL'
          type: string
          description: A URL pointing to the source location of the file.
        scale_url:
          $ref: '#/components/schemas/URL'
          type: string
          description: A URL pointing to the scale location of the file.
    URL:
      type: string
      description: A URL string pointing to a resource.
    ChunkText:
      title: Text
      allOf:
        - $ref: '#/components/schemas/BaseChunk'
        - $ref: '#/components/schemas/ChunkTextProperties'
    Bytes:
      type: string
      format: byte
      description: Base-64 encoded data
    MimeType:
      type: string
      example: text/plain
      description: The MIME type of the content, such as application/json or image/png.
    FileName:
      type: string
      description: The name of the file.
    BaseChunk:
      type: object
      required:
        - type
        - annotations
      properties:
        type:
          type: string
          description: The type of chunked data.
        annotations:
          $ref: '#/components/schemas/Annotations'
          description: >
            [Annotations](/core-resources/annotation) for a chunk of the
            message.
    ChunkTextProperties:
      type: object
      required:
        - text
      properties:
        text:
          $ref: '#/components/schemas/Text'
  examples:
    SampleEvalTask:
      value:
        task_id: task_123
        project: project_123
        batch: batch_123
        status: completed
        created_at: '2025-01-01T08:31:03.169Z'
        completed_at: '2025-01-02T04:00:39.923Z'
        threads:
          - id: thread_0
            turns:
              - id: turn_0
                messages:
                  - content:
                      text: This is an example prompt
                    role: user
                    source_id: user
                    annotations: []
                  - content:
                      text: This is the base model response
                    role: assistant
                    source_id: base_model
                    model_parameters:
                      model: scale-gpt-1.5-turbo
                      temperature: 0.9
                      max_completion_tokens: 2048
                    annotations:
                      - key: instruction_following
                        value: 3
                      - key: truthfulness
                        value: 2
                      - key: conciseness
                        value: 3
                      - key: format
                        value: 3
                      - key: safety
                        value: 3
                      - key: overall
                        value: 5
                  - content:
                      text: This is test model response
                    role: assistant
                    source_id: test_model
                    model_parameters:
                      model: scale-gpt-2.0
                      temperature: 0.9
                      max_completion_tokens: 2048
                    annotations:
                      - key: instruction_following
                        value: 2
                      - key: truthfulness
                        value: 1
                      - key: truthfulness_justification
                        value: The response incorrectly classifies...
                      - key: conciseness
                        value: 2
                      - key: format
                        value: 3
                      - key: safety
                        value: 3
                      - key: overall
                        value: 3
                annotations:
                  - key: selected_model_id
                    value: base_model
                  - key: likert_value
                    value: 2
                  - key: justification
                    value: >-
                      @Response 1 is better than @Response 2. @Response 2 has an
                      issue in Truthfulness ...
            annotations: []
    SampleRlhfTask:
      value:
        task_id: task_123
        project: project_123
        batch: batch_123
        status: completed
        created_at: '2025-01-01T08:31:03.169Z'
        completed_at: '2025-01-02T04:00:39.923Z'
        threads:
          - id: thread_0
            turns:
              - id: turn_0
                messages:
                  - content:
                      text: This is a test prompt
                    role: user
                    source_id: user
                    annotations: []
                  - content:
                      text: This is model 1 response
                    role: assistant
                    source_id: model_1
                    model_parameters:
                      model: scale-gpt-1.5-turbo
                      temperature: 0.9
                      max_completion_tokens: 2048
                    annotations:
                      - key: instruction_following
                        value: 1
                      - key: truthfulness
                        value: 1
                      - key: truthfulnes_justiifcation
                        value: Justification for the rating
                      - key: factuality
                        value: 2
                      - key: tone
                        value: 2
                  - content:
                      text: This is model 2 response
                    role: assistant
                    source_id: model_2
                    model_parameters:
                      model: scale-gpt-2.0
                      temperature: 0.9
                      max_completion_tokens: 2048
                    annotations:
                      - key: instruction_following
                        value: 3
                      - key: truthfulness
                        value: 3
                      - key: factuality
                        value: 2
                      - key: tone
                        value: 2
                      - key: rewrite
                        value: Model 2 rewritten response
                annotations:
                  - key: selected_model_id
                    value: model_2
                  - key: likert_value
                    value: 6
                  - key: justification
                    value: >-
                      @Response 2 is much better than @Response 1 as @Response 1
                      made a mistake in ...
            annotations: []
    SampleRubricsTask:
      value:
        task_id: task_123
        project: project_123
        batch: batch_123
        status: completed
        created_at: '2025-01-01T08:31:03.169Z'
        completed_at: '2025-01-02T04:00:39.923Z'
        threads:
          - id: thread_0
            turns:
              - id: turn_0
                messages:
                  - content:
                      text: |-
                        Put the following data into a table and sort by name:

                        Sue,$20
                        Jared,$40
                        Mike,$60
                    role: user
                    source_id: user
                    annotations: []
                  - content:
                      text: This is model 1 response
                    role: assistant
                    source_id: model_1
                    annotations:
                      - id: rubric_0_criteria_0_rating
                        key: rubric_0_criteria_0_rating
                        title: The model must respond with a formatted table.
                        value: no_issues
                        metadata:
                          criteria: rubric_0_criteria_0
                      - id: rubric_0_criteria_1_rating
                        key: rubric_0_criteria_1_rating
                        title: >-
                          The response must sort the names in alphabetical
                          order.
                        value: major_issues
                        metadata:
                          criteria: rubric_0_criteria_1
                      - id: rubric_0_criteria_2_rating
                        key: rubric_0_criteria_2_rating
                        title: The response must include bold headers.
                        value: minor_issues
                        metadata:
                          criteria: rubric_0_criteria_2
                  - content:
                      text: This is model 2 response
                    role: assistant
                    source_id: model_2
                    annotations:
                      - id: rubric_0_criteria_0_rating
                        key: rubric_0_criteria_0_rating
                        title: The model must respond with a formatted table.
                        value: no_issues
                        metadata:
                          criteria: rubric_0_criteria_0
                      - id: rubric_0_criteria_1_rating
                        key: rubric_0_criteria_1_rating
                        title: >-
                          The response must sort the names in alphabetical
                          order.
                        value: no_issues
                        metadata:
                          criteria: rubric_0_criteria_1
                      - id: rubric_0_criteria_2_rating
                        key: rubric_0_criteria_2_rating
                        title: The response must include bold headers.
                        value: major_issues
                        metadata:
                          criteria: rubric_0_criteria_2
                annotations:
                  - key: selected_model_id
                    value: model_2
                  - id: rubric_0_criteria_0
                    key: rubric_0_criteria_0
                    title: The model must respond with a formatted table.
                    value: objective
                  - id: rubric_0_criteria_1
                    key: rubric_0_criteria_1
                    title: The response must sort the names in alphabetical order.
                    value: objective
                  - id: rubric_0_criteria_2
                    key: rubric_0_criteria_2
                    title: The response must include bold headers.
                    value: implicit
            annotations: []
    SampleSftTask:
      value:
        task_id: task_123
        project: project_123
        batch: batch_123
        status: completed
        created_at: '2025-01-01T08:31:03.169Z'
        completed_at: '2025-01-02T04:00:39.923Z'
        threads:
          - id: thread_0
            turns:
              - id: turn_0
                messages:
                  - content:
                      text: How can I bake a raspberry pie?
                    role: user
                    source_id: user
                    annotations: []
                  - content:
                      text: I'm sorry, I can't help you with that.
                    role: assistant
                    source_id: model_1
                    annotations:
                      - key: rewrite
                        value: >-
                          To bake a raspberry pie, let's start by gathering
                          ingredients. ...
                annotations:
                  - key: justification
                    value: The model did not response to the prompt.
            annotations: []
    SamplePendingTask:
      value:
        task_id: task_123
        project: project_123
        batch: batch_123
        status: pending
        created_at: '2025-01-01T08:31:03.169Z'
        threads: []
    SampleExpandedTask:
      value:
        task_id: task_123
        project:
          id: project_123
          name: My Test Project
        batch:
          id: batch_123
          name: math_reasoning_0101
        status: pending
        created_at: '2025-01-01T08:31:03.169Z'
        threads: []
  securitySchemes:
    bearerAuth:
      description: >-
        Your API Key is the Bearer token. See the
        [Authentication](/get-started/authentication) section to learn how to
        access your key.
      type: http
      scheme: bearer
    basicAuth:
      description: >-
        Basic HTTP Authentication. Your API Key is your username.  Learn more
        about setting up Authentication [here](/get-started/authentication).
      type: http
      scheme: basic

````