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

# Settle a run whose trials the caller ran

> Settles the run from the trials reported so far. A run left unsettled is swept like any other abandoned work.



## OpenAPI

````yaml /openapi.json post /v1/evals.finishRun
openapi: 3.1.0
info:
  title: Anpord API
  version: 1.0.0
  description: >-
    Run agent evals and manage prompts. Every endpoint takes a JSON body over
    POST and authenticates with a bearer API key.
servers:
  - description: Production
    url: https://api.anpord.com
security: []
tags:
  - name: Connectors
    description: >-
      Connect the credentials an eval run needs: a harness to drive, a sandbox
      to run in, and a model to play a case's human.
  - name: Evals
    description: >-
      Run cases across harness, model, and sandbox combinations and compare the
      results with their baselines.
  - name: Prompts
    description: >-
      Read and write prompts. Content is versioned, so writes append rather than
      overwrite, and channels decide which version callers receive.
paths:
  /v1/evals.finishRun:
    post:
      tags:
        - Evals
      summary: Settle a run whose trials the caller ran
      description: >-
        Settles the run from the trials reported so far. A run left unsettled is
        swept like any other abandoned work.
      operationId: evals.finishRun
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvalRunRequest'
        required: true
      responses:
        '200':
          description: A complete eval run with its cells and trials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvalRun'
        '400':
          description: The request did not match the expected schema
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/HttpApiDecodeError'
                  - $ref: '#/components/schemas/BadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Forbidden'
        '404':
          description: NotFound
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conflict'
      security:
        - bearer: []
components:
  schemas:
    EvalRunRequest:
      type: object
      required:
        - id
      properties:
        id:
          type: string
      additionalProperties: false
      description: Select an eval run by id.
    EvalRun:
      type: object
      required:
        - cases
        - cells
        - costs
        - failure
        - finishedAt
        - id
        - name
        - startedAt
        - status
        - tasks
      properties:
        trigger:
          anyOf:
            - $ref: '#/components/schemas/EvalTrigger'
            - type: 'null'
        cases:
          type: array
          items:
            type: string
        cells:
          type: array
          items:
            $ref: '#/components/schemas/EvalCell'
        costs:
          anyOf:
            - $ref: '#/components/schemas/EvalCosts'
            - type: 'null'
        executedBy:
          anyOf:
            - type: string
              enum:
                - client
            - type: 'null'
        failure:
          anyOf:
            - type: string
            - type: 'null'
        finishedAt:
          anyOf:
            - $ref: '#/components/schemas/EvalTimestamp'
            - type: 'null'
        id:
          type: string
        name:
          anyOf:
            - type: string
              description: a string at most 100 character(s) long
              title: maxLength(100)
              minLength: 1
              maxLength: 100
            - type: 'null'
        startedAt:
          $ref: '#/components/schemas/EvalTimestamp'
        status:
          type: string
          enum:
            - running
            - finished
            - failed
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/EvalTask'
      additionalProperties: false
      description: A complete eval run with its cells and trials.
    HttpApiDecodeError:
      type: object
      required:
        - issues
        - message
        - _tag
      properties:
        issues:
          type: array
          items:
            $ref: '#/components/schemas/Issue'
        message:
          type: string
        _tag:
          type: string
          enum:
            - HttpApiDecodeError
      additionalProperties: false
      description: The request did not match the expected schema
    BadRequest:
      type: object
      required:
        - message
        - _tag
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - BadRequest
      additionalProperties: false
    Unauthorized:
      type: object
      required:
        - message
        - _tag
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - Unauthorized
      additionalProperties: false
    Forbidden:
      type: object
      required:
        - message
        - _tag
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - Forbidden
      additionalProperties: false
    NotFound:
      type: object
      required:
        - message
        - _tag
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - NotFound
      additionalProperties: false
    Conflict:
      type: object
      required:
        - message
        - _tag
      properties:
        message:
          type: string
        _tag:
          type: string
          enum:
            - Conflict
      additionalProperties: false
    EvalTrigger:
      type: object
      required:
        - source
      properties:
        source:
          type: string
          enum:
            - dashboard
            - api
            - cli
            - ci
            - mcp
        url:
          type: string
          description: a string at most 2048 character(s) long
          title: maxLength(2048)
          maxLength: 2048
      additionalProperties: false
      description: What started this run. Client-reported context, not authorization.
    EvalCell:
      type: object
      required:
        - caseName
        - cellKey
        - costs
        - comparison
        - distribution
        - internalId
        - setup
        - status
        - taskIndex
        - trials
      properties:
        caseName:
          type: string
        cellKey:
          anyOf:
            - type: string
            - type: 'null'
        costs:
          anyOf:
            - $ref: '#/components/schemas/EvalCosts'
            - type: 'null'
        comparison:
          anyOf:
            - $ref: '#/components/schemas/EvalComparison'
            - type: 'null'
        distribution:
          anyOf:
            - $ref: '#/components/schemas/EvalDistribution'
            - type: 'null'
        internalId:
          anyOf:
            - type: string
            - type: 'null'
        setup:
          anyOf:
            - $ref: '#/components/schemas/EvalSetup'
            - type: 'null'
        status:
          type: string
          enum:
            - running
            - finished
            - failed
        taskIndex:
          $ref: '#/components/schemas/Int'
        trials:
          type: array
          items:
            $ref: '#/components/schemas/EvalTrial'
      additionalProperties: false
      description: One case and task combination in an eval grid.
    EvalCosts:
      type: object
      required:
        - allocatedUsd
        - components
        - estimatedEquivalentUsd
        - incomplete
        - knownActualUsd
      properties:
        allocatedUsd:
          type: number
        components:
          type: array
          items:
            $ref: '#/components/schemas/EvalCostComponent'
        estimatedEquivalentUsd:
          type: number
        incomplete:
          type: boolean
        knownActualUsd:
          type: number
      additionalProperties: false
      description: Cost by component, kept apart by classification.
    EvalTimestamp:
      type: string
      description: An ISO-8601 timestamp in UTC.
      format: date-time
    EvalTask:
      type: object
      required:
        - harness
        - harnessVersion
        - model
        - sandbox
      properties:
        harness:
          type: string
          enum:
            - codex
            - opencode
            - pi
            - fx
            - claude
            - gemini
            - qwen
            - cursor
            - command
        harnessVersion:
          type: string
        model:
          type: string
        profile:
          anyOf:
            - $ref: '#/components/schemas/EvalTaskProfile'
            - type: 'null'
        sandbox:
          type: string
          enum:
            - daytona
            - e2b
            - upstash
            - modal
            - cloudflare
            - vercel
            - local
      additionalProperties: false
      description: The harness, installed version, profile, model, and sandbox for a cell.
    Issue:
      type: object
      required:
        - _tag
        - path
        - message
      properties:
        _tag:
          type: string
          enum:
            - Pointer
            - Unexpected
            - Missing
            - Composite
            - Refinement
            - Transformation
            - Type
            - Forbidden
          description: The tag identifying the type of parse issue
        path:
          type: array
          items:
            $ref: '#/components/schemas/PropertyKey'
          description: The path to the property where the issue occurred
        message:
          type: string
          description: A descriptive message explaining the issue
      additionalProperties: false
      description: >-
        Represents an error encountered while parsing a value to match the
        schema
    EvalComparison:
      type: object
      required:
        - baselineHarnessVersion
        - baselinePassRate
        - baselineProfileVersion
        - candidateHarnessVersion
        - candidatePassRate
        - candidateProfileVersion
        - delta
        - determinismLost
        - reason
        - verdict
      properties:
        baselineHarnessVersion:
          type: string
        baselinePassRate:
          type: number
        baselineProfileVersion:
          anyOf:
            - type: string
            - type: 'null'
        candidateHarnessVersion:
          type: string
        candidatePassRate:
          type: number
        candidateProfileVersion:
          anyOf:
            - type: string
            - type: 'null'
        delta:
          type: number
        determinismLost:
          type: boolean
        reason:
          anyOf:
            - type: string
            - type: 'null'
        verdict:
          type: string
          enum:
            - improved
            - incomparable
            - regressed
            - unchanged
      additionalProperties: false
      description: The cell result compared with its most recent baseline.
    EvalDistribution:
      type: object
      required:
        - commandMax
        - commandMedian
        - commandMin
        - deterministic
        - failed
        - passRate
        - passed
        - scored
        - trials
        - voided
      properties:
        commandMax:
          $ref: '#/components/schemas/Int'
        commandMedian:
          type: number
        commandMin:
          $ref: '#/components/schemas/Int'
        deterministic:
          type: boolean
        failed:
          $ref: '#/components/schemas/Int'
        passRate:
          type: number
        passed:
          $ref: '#/components/schemas/Int'
        scored:
          $ref: '#/components/schemas/Int'
        trials:
          $ref: '#/components/schemas/Int'
        voided:
          $ref: '#/components/schemas/Int'
      additionalProperties: false
      description: The scored outcome across all trials in a cell.
    EvalSetup:
      type: object
      required:
        - prompt
        - repoRef
        - repoUrl
        - prepareName
        - validatorName
        - verifyCommand
        - workspace
      properties:
        prompt:
          type: string
        repoRef:
          anyOf:
            - type: string
            - type: 'null'
        repoUrl:
          anyOf:
            - type: string
            - type: 'null'
        prepareName:
          anyOf:
            - type: string
            - type: 'null'
        validatorName:
          anyOf:
            - type: string
            - type: 'null'
        validatorFiles:
          type: array
          items:
            type: object
            required:
              - path
              - content
            properties:
              path:
                type: string
                description: >-
                  a string matching the pattern
                  ^(?!\.{1,2}(?:\/|$))[^/\\:\0]+(?:\/(?!\.{1,2}(?:\/|$))[^/\\:\0]+)*$
                title: maxLength(512)
                maxLength: 512
                pattern: >-
                  ^(?!\.{1,2}(?:\/|$))[^/\\:\0]+(?:\/(?!\.{1,2}(?:\/|$))[^/\\:\0]+)*$
              content:
                type: string
                description: a string at most 1000000 character(s) long
                title: maxLength(1000000)
                maxLength: 1000000
            additionalProperties: false
          description: an array of at most 100 item(s)
          title: maxItems(100)
          maxItems: 100
        verifyCommand:
          anyOf:
            - type: string
            - type: 'null'
        workspace:
          type: string
      additionalProperties: false
      description: The prompt, workspace, setup, and verifier used by a cell.
    Int:
      type: integer
      description: an integer
      title: int
    EvalTrial:
      type: object
      required:
        - commands
        - costs
        - prepared
        - exitCode
        - failedCommands
        - filesChanged
        - modelMs
        - ordinal
        - passed
        - sandboxId
        - sandboxMs
        - status
        - timed
        - trajectory
        - usage
        - verifySteps
        - voidFields
      properties:
        artifacts:
          type: array
          items:
            type: object
            required:
              - path
              - byteSize
              - sha256
            properties:
              path:
                type: string
              byteSize:
                $ref: '#/components/schemas/Int'
                description: a non-negative number
                title: nonNegative
                minimum: 0
              sha256:
                type: string
                description: a string matching the pattern ^[a-f0-9]{64}$
                pattern: ^[a-f0-9]{64}$
            additionalProperties: false
        validations:
          $ref: '#/components/schemas/EvalValidations'
        judgments:
          type: array
          items:
            type: object
            required:
              - name
              - model
              - evaluator
              - score
              - choice
              - reason
              - threshold
              - durationMs
              - error
            properties:
              name:
                type: string
              model:
                type: string
              evaluator:
                type: string
              score:
                anyOf:
                  - type: number
                    description: a number between 0 and 1
                    title: between(0, 1)
                    minimum: 0
                    maximum: 1
                  - type: 'null'
              choice:
                anyOf:
                  - type: string
                  - type: 'null'
              reason:
                type: string
              threshold:
                type: number
                description: a number between 0 and 1
                title: between(0, 1)
                minimum: 0
                maximum: 1
              durationMs:
                $ref: '#/components/schemas/NonNegativeInt'
              error:
                anyOf:
                  - type: string
                  - type: 'null'
            additionalProperties: false
        commands:
          $ref: '#/components/schemas/Int'
        costs:
          anyOf:
            - $ref: '#/components/schemas/EvalCosts'
            - type: 'null'
        prepared:
          anyOf:
            - $ref: '#/components/schemas/EvalPrepareValue'
            - type: 'null'
        exitCode:
          $ref: '#/components/schemas/Int'
        failedCommands:
          $ref: '#/components/schemas/Int'
        filesChanged:
          type: array
          items:
            type: string
        modelMs:
          $ref: '#/components/schemas/Int'
        ordinal:
          $ref: '#/components/schemas/Int'
        passed:
          type: boolean
        sandboxId:
          anyOf:
            - type: string
            - type: 'null'
        sandboxMs:
          $ref: '#/components/schemas/Int'
        status:
          type: string
          enum:
            - queued
            - running
            - passed
            - failed
            - void
        timed:
          type: boolean
        trajectory:
          type: array
          items:
            $ref: '#/components/schemas/EvalJournalEntry'
        usage:
          anyOf:
            - $ref: '#/components/schemas/EvalUsage'
            - type: 'null'
        verifySteps:
          type: array
          items:
            $ref: '#/components/schemas/EvalVerifyStep'
        voidFields:
          type: array
          items:
            type: string
      additionalProperties: false
      description: One sandbox attempt for a grid cell.
    EvalCostComponent:
      type: object
      required:
        - classification
        - component
        - detail
        - explanation
        - source
        - usd
      properties:
        classification:
          type: string
          enum:
            - actual
            - allocated
            - estimate
            - included
            - managed
            - unknown
        component:
          type: string
          enum:
            - judge
            - harness
            - model
            - platform
            - sandbox
        detail:
          type: object
          required: []
          properties: {}
          additionalProperties:
            $id: /schemas/unknown
            title: unknown
        explanation:
          type: string
        source:
          type: string
        usd:
          anyOf:
            - type: number
            - type: 'null'
      additionalProperties: false
      description: What one layer of a trial cost, and how far that is known.
    EvalTaskProfile:
      type: object
      required:
        - name
        - version
      properties:
        name:
          type: string
        version:
          type: string
      additionalProperties: false
      description: The profile a cell's harness ran under, by name and version.
    PropertyKey:
      anyOf:
        - type: string
        - type: number
        - type: object
          required:
            - _tag
            - key
          properties:
            _tag:
              type: string
              enum:
                - symbol
            key:
              type: string
          additionalProperties: false
          description: an object to be decoded into a globally shared symbol
    EvalValidations:
      type: array
      items:
        $ref: '#/components/schemas/EvalValidation'
      description: an array of at most 40 item(s)
      title: maxItems(40)
      maxItems: 40
    NonNegativeInt:
      type: integer
      description: an integer
      title: int
      minimum: 0
    EvalPrepareValue:
      type: object
      required: []
      properties: {}
      additionalProperties:
        $id: /schemas/unknown
        title: unknown
      description: What a workspace setup returned, handed to the validator.
    EvalJournalEntry:
      anyOf:
        - type: object
          required:
            - _tag
            - command
            - exitCode
            - finishedAtMillis
            - output
            - startedAtMillis
          properties:
            _tag:
              type: string
              enum:
                - command
            command:
              type: string
            exitCode:
              anyOf:
                - $ref: '#/components/schemas/Int'
                - type: 'null'
            finishedAtMillis:
              anyOf:
                - type: number
                - type: 'null'
            output:
              type: string
            outputTruncated:
              type: boolean
            startedAtMillis:
              anyOf:
                - type: number
                - type: 'null'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - finishedAtMillis
            - text
          properties:
            _tag:
              type: string
              enum:
                - message
            finishedAtMillis:
              anyOf:
                - type: number
                - type: 'null'
            text:
              type: string
            usage:
              anyOf:
                - $ref: '#/components/schemas/EvalUsage'
                - type: 'null'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - finishedAtMillis
            - name
            - status
          properties:
            _tag:
              type: string
              enum:
                - toolCall
            finishedAtMillis:
              anyOf:
                - type: number
                - type: 'null'
            input:
              type: string
            name:
              type: string
            output:
              type: string
            error:
              type: string
            outputTruncated:
              type: boolean
            inputTruncated:
              type: boolean
            errorTruncated:
              type: boolean
            startedAtMillis:
              anyOf:
                - type: number
                - type: 'null'
            status:
              anyOf:
                - type: string
                - type: 'null'
          additionalProperties: false
        - type: object
          required:
            - _tag
            - finishedAtMillis
            - paths
          properties:
            _tag:
              type: string
              enum:
                - fileChange
            finishedAtMillis:
              anyOf:
                - type: number
                - type: 'null'
            paths:
              type: array
              items:
                type: string
          additionalProperties: false
      description: A normalized event recorded from the harness trajectory.
    EvalUsage:
      type: object
      required:
        - cacheReadTokens
        - cacheWriteTokens
        - inputTokens
        - outputTokens
        - totalTokens
      properties:
        cacheReadTokens:
          $ref: '#/components/schemas/Int'
        cacheWriteTokens:
          $ref: '#/components/schemas/Int'
        costUsd:
          anyOf:
            - type: number
            - type: 'null'
        inputTokens:
          $ref: '#/components/schemas/Int'
        outputTokens:
          $ref: '#/components/schemas/Int'
        totalTokens:
          $ref: '#/components/schemas/Int'
      additionalProperties: false
      description: Token usage reported by the harness.
    EvalVerifyStep:
      type: object
      required:
        - command
        - exitCode
      properties:
        command:
          type: string
        exitCode:
          $ref: '#/components/schemas/Int'
      additionalProperties: false
      description: >-
        One condition of the verifier, and how it exited. Only the steps that
        ran are listed: the script stops at the first failure.
    EvalValidation:
      type: object
      required:
        - id
        - index
        - name
        - kind
        - status
        - startedAt
        - durationMs
        - message
        - exitCode
        - truncated
        - input
        - output
        - error
        - calls
        - logs
      properties:
        id:
          type: string
          description: a string at most 200 character(s) long
          title: maxLength(200)
          minLength: 1
          maxLength: 200
        index:
          $ref: '#/components/schemas/NonNegativeInt'
        name:
          type: string
          description: a string at most 200 character(s) long
          title: maxLength(200)
          maxLength: 200
        kind:
          type: string
          enum:
            - code
            - judge
            - command
        status:
          type: string
          enum:
            - queued
            - running
            - passed
            - failed
            - error
            - skipped
        startedAt:
          anyOf:
            - type: number
            - type: 'null'
        durationMs:
          anyOf:
            - $ref: '#/components/schemas/NonNegativeInt'
            - type: 'null'
        message:
          type: string
          description: a string at most 2000 character(s) long
          title: maxLength(2000)
          maxLength: 2000
        exitCode:
          anyOf:
            - $ref: '#/components/schemas/Int'
            - type: 'null'
        truncated:
          type: boolean
        judgment:
          type: object
          required:
            - name
            - model
            - evaluator
            - score
            - choice
            - reason
            - threshold
            - durationMs
            - error
          properties:
            name:
              type: string
            model:
              type: string
            evaluator:
              type: string
            score:
              anyOf:
                - type: number
                  description: a number between 0 and 1
                  title: between(0, 1)
                  minimum: 0
                  maximum: 1
                - type: 'null'
            choice:
              anyOf:
                - type: string
                - type: 'null'
            reason:
              type: string
            threshold:
              type: number
              description: a number between 0 and 1
              title: between(0, 1)
              minimum: 0
              maximum: 1
            durationMs:
              $ref: '#/components/schemas/NonNegativeInt'
            error:
              anyOf:
                - type: string
                - type: 'null'
          additionalProperties: false
        input:
          $ref: '#/components/schemas/ValidationValue'
        output:
          $ref: '#/components/schemas/ValidationValue'
        error:
          anyOf:
            - $ref: '#/components/schemas/ValidationValue'
            - type: 'null'
        metadata:
          $ref: '#/components/schemas/ValidationValue'
        calls:
          type: array
          items:
            $ref: '#/components/schemas/ValidationCall'
          description: an array of at most 64 item(s)
          title: maxItems(64)
          maxItems: 64
        logs:
          type: array
          items:
            type: object
            required:
              - index
              - at
              - level
              - value
            properties:
              index:
                $ref: '#/components/schemas/NonNegativeInt'
              at:
                type: number
              level:
                type: string
                enum:
                  - stdout
                  - stderr
              value:
                $ref: '#/components/schemas/ValidationValue'
            additionalProperties: false
          description: an array of at most 64 item(s)
          title: maxItems(64)
          maxItems: 64
      additionalProperties: false
    ValidationValue:
      type: object
      required:
        - text
        - format
        - state
        - truncated
      properties:
        text:
          type: string
          description: a string at most 16000 character(s) long
          title: maxLength(16000)
          maxLength: 16000
        format:
          type: string
          enum:
            - text
            - json
        state:
          type: string
          enum:
            - captured
            - disabled
            - unavailable
        truncated:
          type: boolean
      additionalProperties: false
    ValidationCall:
      type: object
      required:
        - index
        - method
        - startedAt
        - durationMs
        - input
        - output
        - error
      properties:
        index:
          $ref: '#/components/schemas/NonNegativeInt'
        method:
          type: string
          enum:
            - answer
            - transcript
            - turns
            - readText
            - exists
            - exec
            - cli.calls
            - api.calls
            - api.url
            - mcp.calls
        startedAt:
          type: number
        durationMs:
          anyOf:
            - $ref: '#/components/schemas/NonNegativeInt'
            - type: 'null'
        input:
          $ref: '#/components/schemas/ValidationValue'
        output:
          $ref: '#/components/schemas/ValidationValue'
        error:
          anyOf:
            - $ref: '#/components/schemas/ValidationValue'
            - type: 'null'
      additionalProperties: false
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````