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

# Score a complete multi-agent trajectory

> Runs the authoritative versioned trajectory scorer. Incomplete or malformed evidence fails closed.



## OpenAPI

````yaml /api-reference/openapi.json post /api/trajectory-analysis/{trajectoryId}/score
openapi: 3.1.0
info:
  title: EvalGate API
  version: 3.7.6
  description: EvalGate API. See docs/api-contract.md for stability commitments.
servers:
  - url: https://evalgate.com
    description: Production
  - url: http://localhost:3000
    description: Local
security: []
paths:
  /api/trajectory-analysis/{trajectoryId}/score:
    post:
      tags:
        - trajectory analysis
      summary: Score a complete multi-agent trajectory
      description: >-
        Runs the authoritative versioned trajectory scorer. Incomplete or
        malformed evidence fails closed.
      operationId: scoreTrajectoryAnalysis
      parameters:
        - name: trajectoryId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/PostApiTrajectoryAnalysisTrajectoryIdScoreRequest
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostApiTrajectoryAnalysisTrajectoryIdScoreResponse201ApplicationJson
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth:
            - runs:write
components:
  schemas:
    PostApiTrajectoryAnalysisTrajectoryIdScoreRequest:
      type: object
      properties:
        ideal:
          type: object
          properties:
            expectedSteps:
              type: number
            expectedToolCalls:
              type: number
            requiredTools:
              type: array
              items:
                type: string
            forbiddenTools:
              type: array
              items:
                type: string
            allowParallel:
              oneOf:
                - type: boolean
                  enum:
                    - false
                - type: boolean
                  enum:
                    - true
            maxRedundantSteps:
              type: number
          additionalProperties: false
          required:
            - expectedSteps
            - expectedToolCalls
        scorerKey:
          type: string
        scorerVersion:
          type: string
      additionalProperties: false
      required:
        - ideal
    PostApiTrajectoryAnalysisTrajectoryIdScoreResponse201ApplicationJson:
      type: object
      properties:
        id:
          type: string
        createdAt:
          type: string
          format: date-time
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        createdBy:
          type: string
        inputHash:
          type: string
        result:
          type: object
          properties:
            schemaVersion:
              type: number
            trajectoryId:
              type: string
            behavior:
              oneOf:
                - type: string
                  enum:
                    - tool_use
                - type: string
                  enum:
                    - classification
                - type: string
                  enum:
                    - retrieval
                - type: string
                  enum:
                    - extraction
                - type: string
                  enum:
                    - multi_step_reasoning
            taskType:
              type: string
            valid:
              type: boolean
            score:
              oneOf:
                - type: 'null'
                - type: number
            baselineVersion:
              oneOf:
                - type: 'null'
                - type: string
            failureModes:
              type: array
              items:
                oneOf:
                  - type: string
                    enum:
                      - inefficient_path
                  - type: string
                    enum:
                      - unnecessary_tool_call
                  - type: string
                    enum:
                      - missed_tool_call
                  - type: string
                    enum:
                      - looping_behavior
                  - type: string
                    enum:
                      - non_parallel_execution
                  - type: string
                    enum:
                      - premature_termination
            metrics:
              oneOf:
                - type: 'null'
                - type: object
                  properties:
                    actualSteps:
                      type: number
                    actualToolCalls:
                      type: number
                    actualDurationMs:
                      type: number
                    redundancyRatio:
                      type: number
                    redundancySteps:
                      type: number
                    sequenceSimilarity:
                      type: number
                    efficiency:
                      type: number
                    toolUsage:
                      type: number
                    redundancy:
                      type: number
                    latency:
                      type: number
                    parallelizationPenalty:
                      type: number
                    parallelizationScore:
                      type: number
                    requiredToolsMissing:
                      type: array
                      items:
                        type: string
                    forbiddenToolsUsed:
                      type: array
                      items:
                        type: string
                    extraToolsUsed:
                      type: array
                      items:
                        type: string
                    selectedBaselineVersion:
                      oneOf:
                        - type: 'null'
                        - type: string
                    baselineStepP50:
                      type: number
                    baselineStepP75:
                      type: number
                    baselineToolCallP50:
                      type: number
                    baselineToolCallP75:
                      type: number
                    baselineDurationP50:
                      type: number
                    baselineDurationP75:
                      type: number
                    idealExpectedSteps:
                      type: number
                    idealExpectedToolCalls:
                      type: number
                  additionalProperties: false
                  required:
                    - actualSteps
                    - actualToolCalls
                    - actualDurationMs
                    - redundancyRatio
                    - redundancySteps
                    - sequenceSimilarity
                    - efficiency
                    - toolUsage
                    - redundancy
                    - latency
                    - parallelizationPenalty
                    - parallelizationScore
                    - requiredToolsMissing
                    - forbiddenToolsUsed
                    - extraToolsUsed
          additionalProperties: false
          required:
            - schemaVersion
            - valid
            - score
            - failureModes
            - metrics
        trajectoryId:
          type: string
        scorerKey:
          type: string
        scorerVersion:
          type: string
      additionalProperties: false
      required:
        - id
        - createdAt
        - organizationId
        - createdBy
        - inputHash
        - result
        - trajectoryId
        - scorerKey
        - scorerVersion
    OrganizationId:
      type: string
      format: uuid
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - UNAUTHORIZED
                - FORBIDDEN
                - NOT_FOUND
                - VALIDATION_ERROR
                - RATE_LIMITED
                - CONFLICT
                - INTERNAL_ERROR
                - SERVICE_UNAVAILABLE
                - QUOTA_EXCEEDED
                - NO_ORG_MEMBERSHIP
                - CROSS_ORG_REFERENCE
                - INCOMPLETE
                - MALFORMED
            message:
              type: string
            details: {}
            requestId:
              type: string
              format: uuid
          required:
            - code
            - message
      required:
        - error
  responses:
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Conflict:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    RateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key or Session Token

````