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

# Get a run

> Reads back a run until its `expires_at`: the body its create call answered, byte for byte, with the `include` and `results` that call used. It takes no query parameters and has no pages, so it is as large as the create's answer. To judge a run, pass its `run_id` to loss_report, which reads it without returning the results. A run of `items` or `cases` (createRun) is a Run; an import_examples call's run is an ImportExamplesResponse, whose results carry each example's `feedback_id`. Reading a run of `items` needs the `decisions:evaluate` scope; a run of `items_from` or stored `cases`, or an import's, needs `decisions:develop` (403 INSUFFICIENT_SCOPE otherwise). Another environment's run, an expired one and one made before runs could be read back are 404 RUN_UNKNOWN. The web app (WebApi) may not read runs (403).



## OpenAPI

````yaml /openapi.json get /v1/runs/{run_id}
openapi: 3.1.0
info:
  title: Moonbounce Decisions API
  version: 0.0.0
  description: >-
    Moonbounce decisions: evaluate an item's state against a decision structure
    (System One questions, attributes you supply and aggregations over both),
    record feedback and import labeled examples, review a ranked queue, and
    improve the structure through suggestions that ship as code diffs, each with
    a preview (backtest) and an evidence label.


    **Authentication.** Send an API key as `Authorization: Bearer <key>` on
    every operation except `GET /health` and `POST /v1/validate`, and an
    upload's own `url` (`PUT /v1/uploads/{upload_id}/{token}`), which its token
    authorizes. Call the API from a server, never a browser: a key must not
    reach one, and the API sends no CORS headers. A key belongs to one
    organization and one environment: production, or test for a key with the
    `env:test` permission. Test traffic never counts as production traffic.


    **Requests.** JSON bodies (`Content-Type: application/json`) of at most 1
    MB, parsed strictly: duplicate keys, lone surrogates, integers outside
    ±(2^53 - 1), `__proto__` keys, U+0000 and nesting deeper than 64 are a 400.
    A larger dataset, or a file you'd rather not paste, goes up as a file:
    `createUpload` answers a URL to PUT it to.


    **Retries.** Send an `Idempotency-Key` on every POST under /v1 that takes
    one (all but `POST /v1/validate`, `POST /v1/review/items/fill`, whose retry
    is another fill within the day's budget, and `createUpload`, whose retry is
    another upload). Keep it for the request's retries. The same key with the
    same request returns the first stored result, marked `Idempotent-Replayed:
    true`, for 24 hours (410 if that result was since deleted); with another
    request it is 422 IDEMPOTENCY_KEY_REUSED. Keys are scoped to the
    organization and environment across every operation, so use a fresh key per
    request. A request that failed before its result was stored runs again when
    retried. 429 and 503 under /v1 may carry `Retry-After` (seconds); a daily
    QUOTA_EXCEEDED cap instead names its reset time.


    **Lists.** A list answers one page: `{environment, items, next_cursor,
    has_more}` (named `<Thing>Page`), in the order the operation states. Pass
    `next_cursor` back as `cursor`, with the same filters, while `has_more` is
    true; on the last page `next_cursor` is null. `limit` defaults to 50 and is
    at most 100, with these exceptions: cases go up to 200 a page (a run's
    batch; 50 with content), suggestions default to 20, since each carries its
    whole candidate structure and evidence, and the review queue (a reviewer's
    screen) defaults to 20, at most 50.


    **Errors.** Every error under /v1 is `{"error": {"type", "message",
    "reason"?, "param"?, "details"?}}` (ErrorBody); `GET /health` answers its
    own shape. Every response carries a `Request-Id` header. Rate limits apply
    per key, and per client IP for requests without a valid key; a 429
    RATE_LIMITED carries `Retry-After`.
servers:
  - url: https://api.moonbounce.ai
    description: Production
security: []
tags:
  - name: Evaluate
    description: Run one item through a decision and read evaluations back. Start here.
  - name: Decisions
    description: >-
      Validate a decision file, register its versions, and read decisions and
      versions.
  - name: Feedback
    description: >-
      Say what the right answer was, import labeled examples, and read feedback
      and cases.
  - name: Suggestions
    description: Ask for a better version of a decision, and follow the improvement loop.
  - name: Uploads
    description: >-
      Send a dataset or structure file once, then name it in runs, imports and
      registrations.
  - name: Previews & tests
    description: >-
      Replay a structure change over past cases, and score a version over many
      items.
  - name: Models
    description: List the models a decision can run on and choose one.
  - name: Objective
    description: >-
      Set what a decision optimizes for, then judge runs and tune cuts against
      it.
  - name: Usage
    description: What a decision's model calls cost.
  - name: Account
    description: Identify your key, and check that the API is up.
paths:
  /v1/runs/{run_id}:
    get:
      tags:
        - Previews & tests
      summary: Get a run
      description: >-
        Reads back a run until its `expires_at`: the body its create call
        answered, byte for byte, with the `include` and `results` that call
        used. It takes no query parameters and has no pages, so it is as large
        as the create's answer. To judge a run, pass its `run_id` to
        loss_report, which reads it without returning the results. A run of
        `items` or `cases` (createRun) is a Run; an import_examples call's run
        is an ImportExamplesResponse, whose results carry each example's
        `feedback_id`. Reading a run of `items` needs the `decisions:evaluate`
        scope; a run of `items_from` or stored `cases`, or an import's, needs
        `decisions:develop` (403 INSUFFICIENT_SCOPE otherwise). Another
        environment's run, an expired one and one made before runs could be read
        back are 404 RUN_UNKNOWN. The web app (WebApi) may not read runs (403).
      operationId: getRun
      parameters:
        - schema:
            $ref: '#/components/schemas/RunId'
          required: true
          name: run_id
          in: path
      responses:
        '200':
          description: >-
            The run as its create call answered it: a Run from createRun, or an
            ImportExamplesResponse from import_examples
          content:
            application/json:
              examples:
                labeled_items:
                  summary: >-
                    Two labeled tickets dry-run on version 1, kept for
                    loss_report
                  value:
                    run_id: evr_0199f2c4-1a2b-7c3d-8e4f-5a6b7c8d9e20
                    expires_at: '2026-11-07T10:00:00.000Z'
                    dry_run: true
                    environment: test
                    decision_id: refund-exception
                    version:
                      structure_hash: >-
                        sha256:bdad6e5b1b879209305f1555b43ec62666a4d74a925280c66e54cc4dc07bb1ae
                      number: 1
                    model:
                      id: jev-1.14.0
                      resolved_model: jev-1.14.0
                      revision: 1
                      profile: >-
                        defective=jev:jev-1.14.0@jev@0.1.0,item_used=jev:jev-1.14.0@jev@0.1.0
                    counts:
                      total: 2
                      decided: 2
                      computed: 0
                      abstained: 0
                      failed: 0
                      labeled: 2
                    cost:
                      model_calls: 2
                      questions: 4
                      input_tokens: 1040
                      output_tokens: 8
                      usd_micros: 42
                    results:
                      - item_id: t-001
                        id: dry_0199f2c4-1a2b-7c3d-8e4f-5a6b7c8d9e21
                        status: decided
                        outcome: escalate
                        cost:
                          model_calls: 1
                          questions: 2
                          input_tokens: 520
                          output_tokens: 4
                          usd_micros: 21
                      - item_id: t-002
                        id: dry_0199f2c4-1a2b-7c3d-8e4f-5a6b7c8d9e22
                        status: decided
                        outcome: grant
                        cost:
                          model_calls: 1
                          questions: 2
                          input_tokens: 520
                          output_tokens: 4
                          usd_micros: 21
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Run'
                  - $ref: '#/components/schemas/ImportExamplesResponse'
        '400':
          description: 'Invalid request: `param` names the field at fault when one applies'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '401':
          description: Missing or invalid API key (reason KEY_INVALID)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '403':
          description: The key may not do this
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: Not found, or not visible to this key (reason RUN_UNKNOWN)
          x-error-reasons:
            - RUN_UNKNOWN
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: >-
            RATE_LIMITED: retry after Retry-After seconds; QUOTA_EXCEEDED:
            details.reset_at gives the daily reset time (no Retry-After)
          headers:
            Retry-After:
              schema:
                type: string
                description: Seconds to wait before retrying, when waiting helps.
              required: false
              description: Seconds to wait before retrying, when waiting helps.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '503':
          description: >-
            Temporarily unavailable, with Retry-After (for example reason
            AUTH_UNAVAILABLE, ENGINE_UNAVAILABLE or STORE_UNAVAILABLE): retry
            with the same Idempotency-Key
          headers:
            Retry-After:
              schema:
                type: string
                description: Seconds to wait before retrying, when waiting helps.
              required: true
              description: Seconds to wait before retrying, when waiting helps.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      security:
        - bearerAuth:
            - decisions:evaluate
        - bearerAuth:
            - decisions:develop
components:
  schemas:
    RunId:
      type: string
      pattern: >-
        ^evr_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
    Run:
      type: object
      properties:
        run_id:
          type: string
          pattern: >-
            ^evr_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: >-
            Pass it to loss_report, or read this response back with getRun; kept
            until `expires_at`. A stored run's evaluations stay after it
            expires.
        expires_at:
          $ref: '#/components/schemas/TimestampOutput'
        dry_run:
          type: boolean
          description: >-
            Whether the items were dry runs (no evaluation stored; the run keeps
            their results) or stored as evaluations.
        environment:
          $ref: '#/components/schemas/Environment'
        decision_id:
          $ref: '#/components/schemas/DecisionIdOutput'
        version:
          $ref: '#/components/schemas/EvaluatedVersion'
        model:
          $ref: '#/components/schemas/EvaluatedModel'
        counts:
          type: object
          properties:
            total:
              type: integer
              minimum: 0
            decided:
              type: integer
              minimum: 0
            computed:
              type: integer
              minimum: 0
            abstained:
              type: integer
              minimum: 0
            failed:
              type: integer
              minimum: 0
            labeled:
              type: integer
              minimum: 0
              description: Items that carried `expected`.
          required:
            - total
            - decided
            - computed
            - abstained
            - failed
            - labeled
          additionalProperties: true
          x-moonbounce-sdk-known-fields: true
        cost:
          $ref: '#/components/schemas/Cost'
        results:
          type: array
          items:
            $ref: '#/components/schemas/RunItemResult'
          description: >-
            One per item `results` lists (every item by default; with `failed`
            only the failed ones, with `none` none), in item order (cases:
            newest label first).
        cases:
          type: object
          properties:
            total:
              type: integer
              minimum: 0
              description: >-
                Cases that match the filters, across every page; with
                `evaluation_ids`, those found.
            excluded:
              $ref: '#/components/schemas/CaseExcluded'
            next_cursor:
              anyOf:
                - type: string
                - type: 'null'
              description: Pass back in `cases.cursor` for the next page.
          required:
            - total
            - excluded
            - next_cursor
          additionalProperties: true
          description: 'With `cases`: which cases the run took.'
          x-moonbounce-sdk-known-fields: true
      required:
        - run_id
        - expires_at
        - dry_run
        - environment
        - decision_id
        - version
        - model
        - counts
        - cost
        - results
      additionalProperties: true
      x-moonbounce-sdk-known-fields: true
    ImportExamplesResponse:
      type: object
      properties:
        run_id:
          type: string
          pattern: >-
            ^evr_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: >-
            Pass it to loss_report, or read this response back with getRun; kept
            until `expires_at`. A stored run's evaluations stay after it
            expires.
        expires_at:
          $ref: '#/components/schemas/TimestampOutput'
        dry_run:
          type: boolean
          description: >-
            Whether the items were dry runs (no evaluation stored; the run keeps
            their results) or stored as evaluations.
        environment:
          $ref: '#/components/schemas/Environment'
        decision_id:
          $ref: '#/components/schemas/DecisionIdOutput'
        version:
          $ref: '#/components/schemas/EvaluatedVersion'
        model:
          $ref: '#/components/schemas/EvaluatedModel'
        counts:
          type: object
          properties:
            total:
              type: integer
              minimum: 0
            decided:
              type: integer
              minimum: 0
            computed:
              type: integer
              minimum: 0
            abstained:
              type: integer
              minimum: 0
            failed:
              type: integer
              minimum: 0
            labeled:
              type: integer
              minimum: 0
              description: Items that carried `expected`.
          required:
            - total
            - decided
            - computed
            - abstained
            - failed
            - labeled
          additionalProperties: true
          x-moonbounce-sdk-known-fields: true
        cost:
          $ref: '#/components/schemas/Cost'
        results:
          type: array
          items:
            $ref: '#/components/schemas/ImportExampleResult'
          description: >-
            One per example, in order (with `items_from`, the upload's lines in
            order). A failed example stored no evaluation and no feedback: send
            it again in a new call.
      required:
        - run_id
        - expires_at
        - dry_run
        - environment
        - decision_id
        - version
        - model
        - counts
        - cost
        - results
      additionalProperties: true
      x-moonbounce-sdk-known-fields: true
    ErrorBody:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              $ref: '#/components/schemas/ErrorType'
            reason:
              type: string
              pattern: ^[A-Z][A-Z0-9_]+$
              description: >-
                Set where a caller can act on it, one of the reasons in the
                ErrorReason schema. New reasons may be added: treat an unknown
                one by the status and `type`.
            message:
              type: string
              description: For people; don't parse it.
            param:
              type: string
              description: >-
                The request field at fault, as a dotted path
                (`attribute_values.region`, `claims.1.value`).
            details:
              type: object
              properties:
                issues:
                  type: array
                  items:
                    $ref: '#/components/schemas/ErrorIssue'
              additionalProperties: {}
          required:
            - type
            - message
          additionalProperties: true
          x-moonbounce-sdk-known-fields: true
      required:
        - error
      additionalProperties: true
      x-moonbounce-sdk-known-fields: true
    TimestampOutput:
      type: string
      format: date-time
    Environment:
      type: string
      enum:
        - production
        - test
      description: >-
        The environment of the key that made the call: `production` or `test`.
        Evaluations, feedback, reviews and suggestions are separate per
        environment; decisions and their versions belong to the whole
        organization.
    DecisionIdOutput:
      type: string
      pattern: ^[a-z][a-z0-9_.-]{0,127}$
      description: >-
        A name you choose for this decision, such as `refund-exception`: a
        lowercase letter, then up to 127 of `a-z 0-9 _ . -`. Unique in your
        organization and shared by its test and production keys. The first
        registration or evaluation under a new one creates the decision.
    EvaluatedVersion:
      type: object
      properties:
        structure_hash:
          $ref: '#/components/schemas/StructureHashOutput'
        number:
          type:
            - integer
            - 'null'
          minimum: 1
          description: >-
            The version's number under the decision (1, 2, 3...). Null when the
            structure isn't registered: a dry run or a preview of a structure
            nobody registered. The hash is the identity.
      required:
        - structure_hash
        - number
      additionalProperties: true
      description: The version that ran.
      x-moonbounce-sdk-known-fields: true
    EvaluatedModel:
      type: object
      properties:
        id:
          type: string
          description: >-
            The model the decision's setting names, as `GET .../model` reports
            it and `PUT .../model` takes it.
        resolved_model:
          type: string
          description: The versioned model that answered.
        revision:
          type:
            - integer
            - 'null'
          minimum: 1
          description: >-
            The model setting's revision it ran on. Null when no setting was
            stored in the environment, so the deployment default applied.
        profile:
          type: string
          description: >-
            Every question's model and connector, as one opaque string. Compare
            it for equality (two runs are comparable when their profiles match);
            don't parse it.
      required:
        - id
        - resolved_model
        - revision
        - profile
      additionalProperties: true
      description: The model that answered.
      x-moonbounce-sdk-known-fields: true
    Cost:
      type: object
      properties:
        model_calls:
          type: integer
          minimum: 0
          description: >-
            Upstream model calls, retries included. One call can answer several
            questions (Jev compiles them into one).
        questions:
          type: integer
          minimum: 0
          description: >-
            Questions sent to a model. An answer from the cache, or one a stored
            case kept, is not counted.
        cache_hits:
          type: integer
          minimum: 0
          description: >-
            Questions answered from the answer cache, when any were: previews
            and case runs always report it, evaluate and imports only when the
            cache served an answer.
        input_tokens:
          type: integer
          minimum: 0
        output_tokens:
          type: integer
          minimum: 0
        usd_micros:
          type: integer
          minimum: 0
          description: What the model calls cost, in millionths of a US dollar.
      required:
        - model_calls
        - questions
        - input_tokens
        - output_tokens
        - usd_micros
      additionalProperties: true
      x-moonbounce-sdk-known-fields: true
    RunItemResult:
      type: object
      properties:
        item_id:
          type: string
          minLength: 1
          maxLength: 256
          description: The item's id; a stored case's `evaluation_id`.
        evaluation_id:
          type: string
          pattern: >-
            ^evl_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: 'A stored case: the evaluation replayed.'
        id:
          type: string
          description: >-
            The item's evaluation id, as one evaluate gives it: `evl_` when
            stored, `dry_` on a dry run (it names only the usage). Absent on a
            failed item.
        status:
          $ref: '#/components/schemas/RunItemStatusOutput'
        outcome:
          $ref: '#/components/schemas/OutcomeOutput'
        value:
          type: number
        via:
          type: string
        missing:
          type: array
          items:
            type: string
          description: Questions on the result's path with no answer.
        answers:
          type: object
          additionalProperties:
            anyOf:
              - type: number
                minimum: 0
                maximum: 1
              - $ref: '#/components/schemas/ChoiceAnswerValueOutput'
              - $ref: '#/components/schemas/ScoreAnswerValueOutput'
              - type: 'null'
          description: >-
            With `include: ["answers"]`: each question's answer (P(true) for a
            noul, an object for a choice or score), null when it has none.
        attributes:
          type: object
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 200
              - type: number
              - type: boolean
          description: >-
            With `include: ["attributes"]`, when the decision keeps content
            (absent when its `store_state` is false).
        cost:
          type: object
          properties:
            model_calls:
              type: integer
              minimum: 0
              description: >-
                Upstream model calls, retries included. One call can answer
                several questions (Jev compiles them into one).
            questions:
              type: integer
              minimum: 0
              description: >-
                Questions sent to a model. An answer from the cache, or one a
                stored case kept, is not counted.
            cache_hits:
              type: integer
              minimum: 0
              description: >-
                Questions answered from the answer cache, when any were:
                previews and case runs always report it, evaluate and imports
                only when the cache served an answer.
            input_tokens:
              type: integer
              minimum: 0
            output_tokens:
              type: integer
              minimum: 0
            usd_micros:
              type: integer
              minimum: 0
              description: What the model calls cost, in millionths of a US dollar.
          required:
            - model_calls
            - questions
            - input_tokens
            - output_tokens
            - usd_micros
          additionalProperties: true
          description: >-
            What this item's model calls cost (money): on a failed item, what
            they spent before failing; absent when none ran.
          x-moonbounce-sdk-known-fields: true
        evaluation:
          anyOf:
            - type: object
              properties:
                environment:
                  $ref: '#/components/schemas/Environment'
                id:
                  $ref: '#/components/schemas/EvaluationIdOutput'
                dry_run:
                  not: {}
                  description: 'Must be absent: only a dry run sets `dry_run`.'
                  x-moonbounce-absent: true
                answers:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Answer'
                  description: Each question's answer, as System One returns it.
                aggregations:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AggregationResult'
                  description: >-
                    Every aggregation's result. The result's own aggregation
                    carries `via` when it is bands, rules or match.
                moonbounce:
                  type: object
                  properties:
                    decision_id:
                      $ref: '#/components/schemas/DecisionIdOutput'
                    item_id:
                      type: string
                    metadata:
                      $ref: '#/components/schemas/MetadataOutput'
                    summary:
                      type: string
                  required:
                    - decision_id
                    - item_id
                  additionalProperties: true
                  description: >-
                    What you sent in `moonbounce`, echoed. What ran is in
                    `version` and `model`.
                  x-moonbounce-sdk-known-fields: true
                version:
                  $ref: '#/components/schemas/EvaluatedVersion'
                model:
                  $ref: '#/components/schemas/EvaluatedModel'
                cost:
                  $ref: '#/components/schemas/EvaluateCost'
                status:
                  type: string
                  enum:
                    - computed
                value:
                  type: number
                outcome:
                  not: {}
                  description: >-
                    Must be absent: a computed result is a number, with no
                    outcome.
                  x-moonbounce-absent: true
                missing:
                  type: array
                  items:
                    $ref: '#/components/schemas/FeatureRefOutput'
                  description: >-
                    The questions the result depends on (through `result` and
                    every aggregation on its path) that have no answer,
                    abstained or failed, as `questions.x` paths in authored
                    question order. Absent when none is missing; reported for
                    every status. A caller who must not act on partial evidence
                    checks that it is absent, for example `status === "decided"
                    && !missing`.
              required:
                - environment
                - id
                - answers
                - aggregations
                - moonbounce
                - version
                - model
                - cost
                - status
                - value
              additionalProperties: true
              x-moonbounce-sdk-known-fields: true
            - type: object
              properties:
                environment:
                  $ref: '#/components/schemas/Environment'
                id:
                  $ref: '#/components/schemas/EvaluationIdOutput'
                dry_run:
                  not: {}
                  description: 'Must be absent: only a dry run sets `dry_run`.'
                  x-moonbounce-absent: true
                answers:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Answer'
                  description: Each question's answer, as System One returns it.
                aggregations:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AggregationResult'
                  description: >-
                    Every aggregation's result. The result's own aggregation
                    carries `via` when it is bands, rules or match.
                moonbounce:
                  type: object
                  properties:
                    decision_id:
                      $ref: '#/components/schemas/DecisionIdOutput'
                    item_id:
                      type: string
                    metadata:
                      $ref: '#/components/schemas/MetadataOutput'
                    summary:
                      type: string
                  required:
                    - decision_id
                    - item_id
                  additionalProperties: true
                  description: >-
                    What you sent in `moonbounce`, echoed. What ran is in
                    `version` and `model`.
                  x-moonbounce-sdk-known-fields: true
                version:
                  $ref: '#/components/schemas/EvaluatedVersion'
                model:
                  $ref: '#/components/schemas/EvaluatedModel'
                cost:
                  $ref: '#/components/schemas/EvaluateCost'
                status:
                  type: string
                  enum:
                    - decided
                value:
                  type: number
                outcome:
                  $ref: '#/components/schemas/OutcomeOutput'
                missing:
                  type: array
                  items:
                    $ref: '#/components/schemas/FeatureRefOutput'
                  description: >-
                    The questions the result depends on (through `result` and
                    every aggregation on its path) that have no answer,
                    abstained or failed, as `questions.x` paths in authored
                    question order. Absent when none is missing; reported for
                    every status. A caller who must not act on partial evidence
                    checks that it is absent, for example `status === "decided"
                    && !missing`.
              required:
                - environment
                - id
                - answers
                - aggregations
                - moonbounce
                - version
                - model
                - cost
                - status
                - outcome
              additionalProperties: true
              x-moonbounce-sdk-known-fields: true
            - type: object
              properties:
                environment:
                  $ref: '#/components/schemas/Environment'
                id:
                  $ref: '#/components/schemas/EvaluationIdOutput'
                dry_run:
                  not: {}
                  description: 'Must be absent: only a dry run sets `dry_run`.'
                  x-moonbounce-absent: true
                answers:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Answer'
                  description: Each question's answer, as System One returns it.
                aggregations:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AggregationResult'
                  description: >-
                    Every aggregation's result. The result's own aggregation
                    carries `via` when it is bands, rules or match.
                moonbounce:
                  type: object
                  properties:
                    decision_id:
                      $ref: '#/components/schemas/DecisionIdOutput'
                    item_id:
                      type: string
                    metadata:
                      $ref: '#/components/schemas/MetadataOutput'
                    summary:
                      type: string
                  required:
                    - decision_id
                    - item_id
                  additionalProperties: true
                  description: >-
                    What you sent in `moonbounce`, echoed. What ran is in
                    `version` and `model`.
                  x-moonbounce-sdk-known-fields: true
                version:
                  $ref: '#/components/schemas/EvaluatedVersion'
                model:
                  $ref: '#/components/schemas/EvaluatedModel'
                cost:
                  $ref: '#/components/schemas/EvaluateCost'
                status:
                  type: string
                  enum:
                    - abstained
                value:
                  not: {}
                  description: 'Must be absent: an abstained result has no value.'
                  x-moonbounce-absent: true
                outcome:
                  $ref: '#/components/schemas/OutcomeOutput'
                missing:
                  type: array
                  items:
                    $ref: '#/components/schemas/FeatureRefOutput'
                  description: >-
                    The questions the result depends on (through `result` and
                    every aggregation on its path) that have no answer,
                    abstained or failed, as `questions.x` paths in authored
                    question order. Absent when none is missing; reported for
                    every status. A caller who must not act on partial evidence
                    checks that it is absent, for example `status === "decided"
                    && !missing`.
              required:
                - environment
                - id
                - answers
                - aggregations
                - moonbounce
                - version
                - model
                - cost
                - status
              additionalProperties: true
              x-moonbounce-sdk-known-fields: true
            - type: object
              properties:
                environment:
                  $ref: '#/components/schemas/Environment'
                id:
                  $ref: '#/components/schemas/DryRunId'
                dry_run:
                  type: boolean
                  enum:
                    - true
                answers:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Answer'
                  description: Each question's answer, as System One returns it.
                aggregations:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AggregationResult'
                  description: >-
                    Every aggregation's result. The result's own aggregation
                    carries `via` when it is bands, rules or match.
                moonbounce:
                  type: object
                  properties:
                    decision_id:
                      $ref: '#/components/schemas/DecisionIdOutput'
                    item_id:
                      type: string
                    metadata:
                      $ref: '#/components/schemas/MetadataOutput'
                    summary:
                      type: string
                  required:
                    - decision_id
                    - item_id
                  additionalProperties: true
                  description: >-
                    What you sent in `moonbounce`, echoed. What ran is in
                    `version` and `model`.
                  x-moonbounce-sdk-known-fields: true
                version:
                  $ref: '#/components/schemas/EvaluatedVersion'
                model:
                  $ref: '#/components/schemas/EvaluatedModel'
                cost:
                  $ref: '#/components/schemas/EvaluateCost'
                status:
                  type: string
                  enum:
                    - computed
                value:
                  type: number
                outcome:
                  not: {}
                  description: >-
                    Must be absent: a computed result is a number, with no
                    outcome.
                  x-moonbounce-absent: true
                missing:
                  type: array
                  items:
                    $ref: '#/components/schemas/FeatureRefOutput'
                  description: >-
                    The questions the result depends on (through `result` and
                    every aggregation on its path) that have no answer,
                    abstained or failed, as `questions.x` paths in authored
                    question order. Absent when none is missing; reported for
                    every status. A caller who must not act on partial evidence
                    checks that it is absent, for example `status === "decided"
                    && !missing`.
              required:
                - environment
                - id
                - dry_run
                - answers
                - aggregations
                - moonbounce
                - version
                - model
                - cost
                - status
                - value
              additionalProperties: true
              x-moonbounce-sdk-known-fields: true
            - type: object
              properties:
                environment:
                  $ref: '#/components/schemas/Environment'
                id:
                  $ref: '#/components/schemas/DryRunId'
                dry_run:
                  type: boolean
                  enum:
                    - true
                answers:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Answer'
                  description: Each question's answer, as System One returns it.
                aggregations:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AggregationResult'
                  description: >-
                    Every aggregation's result. The result's own aggregation
                    carries `via` when it is bands, rules or match.
                moonbounce:
                  type: object
                  properties:
                    decision_id:
                      $ref: '#/components/schemas/DecisionIdOutput'
                    item_id:
                      type: string
                    metadata:
                      $ref: '#/components/schemas/MetadataOutput'
                    summary:
                      type: string
                  required:
                    - decision_id
                    - item_id
                  additionalProperties: true
                  description: >-
                    What you sent in `moonbounce`, echoed. What ran is in
                    `version` and `model`.
                  x-moonbounce-sdk-known-fields: true
                version:
                  $ref: '#/components/schemas/EvaluatedVersion'
                model:
                  $ref: '#/components/schemas/EvaluatedModel'
                cost:
                  $ref: '#/components/schemas/EvaluateCost'
                status:
                  type: string
                  enum:
                    - decided
                value:
                  type: number
                outcome:
                  $ref: '#/components/schemas/OutcomeOutput'
                missing:
                  type: array
                  items:
                    $ref: '#/components/schemas/FeatureRefOutput'
                  description: >-
                    The questions the result depends on (through `result` and
                    every aggregation on its path) that have no answer,
                    abstained or failed, as `questions.x` paths in authored
                    question order. Absent when none is missing; reported for
                    every status. A caller who must not act on partial evidence
                    checks that it is absent, for example `status === "decided"
                    && !missing`.
              required:
                - environment
                - id
                - dry_run
                - answers
                - aggregations
                - moonbounce
                - version
                - model
                - cost
                - status
                - outcome
              additionalProperties: true
              x-moonbounce-sdk-known-fields: true
            - type: object
              properties:
                environment:
                  $ref: '#/components/schemas/Environment'
                id:
                  $ref: '#/components/schemas/DryRunId'
                dry_run:
                  type: boolean
                  enum:
                    - true
                answers:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Answer'
                  description: Each question's answer, as System One returns it.
                aggregations:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AggregationResult'
                  description: >-
                    Every aggregation's result. The result's own aggregation
                    carries `via` when it is bands, rules or match.
                moonbounce:
                  type: object
                  properties:
                    decision_id:
                      $ref: '#/components/schemas/DecisionIdOutput'
                    item_id:
                      type: string
                    metadata:
                      $ref: '#/components/schemas/MetadataOutput'
                    summary:
                      type: string
                  required:
                    - decision_id
                    - item_id
                  additionalProperties: true
                  description: >-
                    What you sent in `moonbounce`, echoed. What ran is in
                    `version` and `model`.
                  x-moonbounce-sdk-known-fields: true
                version:
                  $ref: '#/components/schemas/EvaluatedVersion'
                model:
                  $ref: '#/components/schemas/EvaluatedModel'
                cost:
                  $ref: '#/components/schemas/EvaluateCost'
                status:
                  type: string
                  enum:
                    - abstained
                value:
                  not: {}
                  description: 'Must be absent: an abstained result has no value.'
                  x-moonbounce-absent: true
                outcome:
                  $ref: '#/components/schemas/OutcomeOutput'
                missing:
                  type: array
                  items:
                    $ref: '#/components/schemas/FeatureRefOutput'
                  description: >-
                    The questions the result depends on (through `result` and
                    every aggregation on its path) that have no answer,
                    abstained or failed, as `questions.x` paths in authored
                    question order. Absent when none is missing; reported for
                    every status. A caller who must not act on partial evidence
                    checks that it is absent, for example `status === "decided"
                    && !missing`.
              required:
                - environment
                - id
                - dry_run
                - answers
                - aggregations
                - moonbounce
                - version
                - model
                - cost
                - status
              additionalProperties: true
              x-moonbounce-sdk-known-fields: true
          description: >-
            With `include: ["evaluation"]`: what evaluate returns for this item
            on its own (absent on a failed item).
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                The reason, such as `ENGINE_FAILED`, `ENGINE_UNAVAILABLE` or
                `NOT_STARTED`.
            message:
              type: string
            retryable:
              type: boolean
              description: Sending the item again may work.
          required:
            - code
            - message
            - retryable
          additionalProperties: true
          description: Why it failed; only with status `failed`.
          x-moonbounce-sdk-known-fields: true
      required:
        - item_id
        - status
      additionalProperties: true
      x-moonbounce-sdk-known-fields: true
    CaseExcluded:
      type: object
      properties:
        withdrawn:
          type: integer
          minimum: 1
        retired:
          type: integer
          minimum: 1
        excluded:
          type: integer
          minimum: 1
        contested:
          type: integer
          minimum: 1
        no_consensus:
          type: integer
          minimum: 1
        no_outcome:
          type: integer
          minimum: 1
        outcome_not_in_result:
          type: integer
          minimum: 1
        no_deciding_ballot:
          type: integer
          minimum: 1
        attribute_inputs_unavailable:
          type: integer
          minimum: 1
        duplicate_group:
          type: integer
          minimum: 1
      description: >-
        Evaluations with feedback that are not cases, by reason: `withdrawn`
        (all feedback withdrawn), `retired` (feedback older than the last policy
        change), `excluded` (flagged input_broken), `contested` (reviewers
        disagree), `no_consensus` (no feedback that decides an outcome),
        `no_outcome` (feedback rules outcomes out without naming one),
        `outcome_not_in_result` (expected outcome not in `outcomes`),
        `no_deciding_ballot`, `attribute_inputs_unavailable` (stored before
        attribute inputs were kept, with a default that can't be read back),
        `duplicate_group` (another evaluation in its group counts instead: the
        same item, or near-identical content with the same label).
    ImportExampleResult:
      type: object
      properties:
        item_id:
          type: string
          minLength: 1
          maxLength: 256
          description: The item's id; a stored case's `evaluation_id`.
        evaluation_id:
          type: string
          pattern: >-
            ^evl_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: 'A stored case: the evaluation replayed.'
        id:
          type: string
          description: >-
            The item's evaluation id, as one evaluate gives it: `evl_` when
            stored, `dry_` on a dry run (it names only the usage). Absent on a
            failed item.
        status:
          $ref: '#/components/schemas/RunItemStatusOutput'
        outcome:
          $ref: '#/components/schemas/OutcomeOutput'
        value:
          type: number
        via:
          type: string
        missing:
          type: array
          items:
            type: string
          description: Questions on the result's path with no answer.
        answers:
          type: object
          additionalProperties:
            anyOf:
              - type: number
                minimum: 0
                maximum: 1
              - $ref: '#/components/schemas/ChoiceAnswerValueOutput'
              - $ref: '#/components/schemas/ScoreAnswerValueOutput'
              - type: 'null'
          description: >-
            With `include: ["answers"]`: each question's answer (P(true) for a
            noul, an object for a choice or score), null when it has none.
        attributes:
          type: object
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 200
              - type: number
              - type: boolean
          description: >-
            With `include: ["attributes"]`, when the decision keeps content
            (absent when its `store_state` is false).
        cost:
          type: object
          properties:
            model_calls:
              type: integer
              minimum: 0
              description: >-
                Upstream model calls, retries included. One call can answer
                several questions (Jev compiles them into one).
            questions:
              type: integer
              minimum: 0
              description: >-
                Questions sent to a model. An answer from the cache, or one a
                stored case kept, is not counted.
            cache_hits:
              type: integer
              minimum: 0
              description: >-
                Questions answered from the answer cache, when any were:
                previews and case runs always report it, evaluate and imports
                only when the cache served an answer.
            input_tokens:
              type: integer
              minimum: 0
            output_tokens:
              type: integer
              minimum: 0
            usd_micros:
              type: integer
              minimum: 0
              description: What the model calls cost, in millionths of a US dollar.
          required:
            - model_calls
            - questions
            - input_tokens
            - output_tokens
            - usd_micros
          additionalProperties: true
          description: >-
            What this item's model calls cost (money): on a failed item, what
            they spent before failing; absent when none ran.
          x-moonbounce-sdk-known-fields: true
        evaluation:
          anyOf:
            - type: object
              properties:
                environment:
                  $ref: '#/components/schemas/Environment'
                id:
                  $ref: '#/components/schemas/EvaluationIdOutput'
                dry_run:
                  not: {}
                  description: 'Must be absent: only a dry run sets `dry_run`.'
                  x-moonbounce-absent: true
                answers:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Answer'
                  description: Each question's answer, as System One returns it.
                aggregations:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AggregationResult'
                  description: >-
                    Every aggregation's result. The result's own aggregation
                    carries `via` when it is bands, rules or match.
                moonbounce:
                  type: object
                  properties:
                    decision_id:
                      $ref: '#/components/schemas/DecisionIdOutput'
                    item_id:
                      type: string
                    metadata:
                      $ref: '#/components/schemas/MetadataOutput'
                    summary:
                      type: string
                  required:
                    - decision_id
                    - item_id
                  additionalProperties: true
                  description: >-
                    What you sent in `moonbounce`, echoed. What ran is in
                    `version` and `model`.
                  x-moonbounce-sdk-known-fields: true
                version:
                  $ref: '#/components/schemas/EvaluatedVersion'
                model:
                  $ref: '#/components/schemas/EvaluatedModel'
                cost:
                  $ref: '#/components/schemas/EvaluateCost'
                status:
                  type: string
                  enum:
                    - computed
                value:
                  type: number
                outcome:
                  not: {}
                  description: >-
                    Must be absent: a computed result is a number, with no
                    outcome.
                  x-moonbounce-absent: true
                missing:
                  type: array
                  items:
                    $ref: '#/components/schemas/FeatureRefOutput'
                  description: >-
                    The questions the result depends on (through `result` and
                    every aggregation on its path) that have no answer,
                    abstained or failed, as `questions.x` paths in authored
                    question order. Absent when none is missing; reported for
                    every status. A caller who must not act on partial evidence
                    checks that it is absent, for example `status === "decided"
                    && !missing`.
              required:
                - environment
                - id
                - answers
                - aggregations
                - moonbounce
                - version
                - model
                - cost
                - status
                - value
              additionalProperties: true
              x-moonbounce-sdk-known-fields: true
            - type: object
              properties:
                environment:
                  $ref: '#/components/schemas/Environment'
                id:
                  $ref: '#/components/schemas/EvaluationIdOutput'
                dry_run:
                  not: {}
                  description: 'Must be absent: only a dry run sets `dry_run`.'
                  x-moonbounce-absent: true
                answers:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Answer'
                  description: Each question's answer, as System One returns it.
                aggregations:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AggregationResult'
                  description: >-
                    Every aggregation's result. The result's own aggregation
                    carries `via` when it is bands, rules or match.
                moonbounce:
                  type: object
                  properties:
                    decision_id:
                      $ref: '#/components/schemas/DecisionIdOutput'
                    item_id:
                      type: string
                    metadata:
                      $ref: '#/components/schemas/MetadataOutput'
                    summary:
                      type: string
                  required:
                    - decision_id
                    - item_id
                  additionalProperties: true
                  description: >-
                    What you sent in `moonbounce`, echoed. What ran is in
                    `version` and `model`.
                  x-moonbounce-sdk-known-fields: true
                version:
                  $ref: '#/components/schemas/EvaluatedVersion'
                model:
                  $ref: '#/components/schemas/EvaluatedModel'
                cost:
                  $ref: '#/components/schemas/EvaluateCost'
                status:
                  type: string
                  enum:
                    - decided
                value:
                  type: number
                outcome:
                  $ref: '#/components/schemas/OutcomeOutput'
                missing:
                  type: array
                  items:
                    $ref: '#/components/schemas/FeatureRefOutput'
                  description: >-
                    The questions the result depends on (through `result` and
                    every aggregation on its path) that have no answer,
                    abstained or failed, as `questions.x` paths in authored
                    question order. Absent when none is missing; reported for
                    every status. A caller who must not act on partial evidence
                    checks that it is absent, for example `status === "decided"
                    && !missing`.
              required:
                - environment
                - id
                - answers
                - aggregations
                - moonbounce
                - version
                - model
                - cost
                - status
                - outcome
              additionalProperties: true
              x-moonbounce-sdk-known-fields: true
            - type: object
              properties:
                environment:
                  $ref: '#/components/schemas/Environment'
                id:
                  $ref: '#/components/schemas/EvaluationIdOutput'
                dry_run:
                  not: {}
                  description: 'Must be absent: only a dry run sets `dry_run`.'
                  x-moonbounce-absent: true
                answers:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Answer'
                  description: Each question's answer, as System One returns it.
                aggregations:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AggregationResult'
                  description: >-
                    Every aggregation's result. The result's own aggregation
                    carries `via` when it is bands, rules or match.
                moonbounce:
                  type: object
                  properties:
                    decision_id:
                      $ref: '#/components/schemas/DecisionIdOutput'
                    item_id:
                      type: string
                    metadata:
                      $ref: '#/components/schemas/MetadataOutput'
                    summary:
                      type: string
                  required:
                    - decision_id
                    - item_id
                  additionalProperties: true
                  description: >-
                    What you sent in `moonbounce`, echoed. What ran is in
                    `version` and `model`.
                  x-moonbounce-sdk-known-fields: true
                version:
                  $ref: '#/components/schemas/EvaluatedVersion'
                model:
                  $ref: '#/components/schemas/EvaluatedModel'
                cost:
                  $ref: '#/components/schemas/EvaluateCost'
                status:
                  type: string
                  enum:
                    - abstained
                value:
                  not: {}
                  description: 'Must be absent: an abstained result has no value.'
                  x-moonbounce-absent: true
                outcome:
                  $ref: '#/components/schemas/OutcomeOutput'
                missing:
                  type: array
                  items:
                    $ref: '#/components/schemas/FeatureRefOutput'
                  description: >-
                    The questions the result depends on (through `result` and
                    every aggregation on its path) that have no answer,
                    abstained or failed, as `questions.x` paths in authored
                    question order. Absent when none is missing; reported for
                    every status. A caller who must not act on partial evidence
                    checks that it is absent, for example `status === "decided"
                    && !missing`.
              required:
                - environment
                - id
                - answers
                - aggregations
                - moonbounce
                - version
                - model
                - cost
                - status
              additionalProperties: true
              x-moonbounce-sdk-known-fields: true
            - type: object
              properties:
                environment:
                  $ref: '#/components/schemas/Environment'
                id:
                  $ref: '#/components/schemas/DryRunId'
                dry_run:
                  type: boolean
                  enum:
                    - true
                answers:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Answer'
                  description: Each question's answer, as System One returns it.
                aggregations:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AggregationResult'
                  description: >-
                    Every aggregation's result. The result's own aggregation
                    carries `via` when it is bands, rules or match.
                moonbounce:
                  type: object
                  properties:
                    decision_id:
                      $ref: '#/components/schemas/DecisionIdOutput'
                    item_id:
                      type: string
                    metadata:
                      $ref: '#/components/schemas/MetadataOutput'
                    summary:
                      type: string
                  required:
                    - decision_id
                    - item_id
                  additionalProperties: true
                  description: >-
                    What you sent in `moonbounce`, echoed. What ran is in
                    `version` and `model`.
                  x-moonbounce-sdk-known-fields: true
                version:
                  $ref: '#/components/schemas/EvaluatedVersion'
                model:
                  $ref: '#/components/schemas/EvaluatedModel'
                cost:
                  $ref: '#/components/schemas/EvaluateCost'
                status:
                  type: string
                  enum:
                    - computed
                value:
                  type: number
                outcome:
                  not: {}
                  description: >-
                    Must be absent: a computed result is a number, with no
                    outcome.
                  x-moonbounce-absent: true
                missing:
                  type: array
                  items:
                    $ref: '#/components/schemas/FeatureRefOutput'
                  description: >-
                    The questions the result depends on (through `result` and
                    every aggregation on its path) that have no answer,
                    abstained or failed, as `questions.x` paths in authored
                    question order. Absent when none is missing; reported for
                    every status. A caller who must not act on partial evidence
                    checks that it is absent, for example `status === "decided"
                    && !missing`.
              required:
                - environment
                - id
                - dry_run
                - answers
                - aggregations
                - moonbounce
                - version
                - model
                - cost
                - status
                - value
              additionalProperties: true
              x-moonbounce-sdk-known-fields: true
            - type: object
              properties:
                environment:
                  $ref: '#/components/schemas/Environment'
                id:
                  $ref: '#/components/schemas/DryRunId'
                dry_run:
                  type: boolean
                  enum:
                    - true
                answers:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Answer'
                  description: Each question's answer, as System One returns it.
                aggregations:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AggregationResult'
                  description: >-
                    Every aggregation's result. The result's own aggregation
                    carries `via` when it is bands, rules or match.
                moonbounce:
                  type: object
                  properties:
                    decision_id:
                      $ref: '#/components/schemas/DecisionIdOutput'
                    item_id:
                      type: string
                    metadata:
                      $ref: '#/components/schemas/MetadataOutput'
                    summary:
                      type: string
                  required:
                    - decision_id
                    - item_id
                  additionalProperties: true
                  description: >-
                    What you sent in `moonbounce`, echoed. What ran is in
                    `version` and `model`.
                  x-moonbounce-sdk-known-fields: true
                version:
                  $ref: '#/components/schemas/EvaluatedVersion'
                model:
                  $ref: '#/components/schemas/EvaluatedModel'
                cost:
                  $ref: '#/components/schemas/EvaluateCost'
                status:
                  type: string
                  enum:
                    - decided
                value:
                  type: number
                outcome:
                  $ref: '#/components/schemas/OutcomeOutput'
                missing:
                  type: array
                  items:
                    $ref: '#/components/schemas/FeatureRefOutput'
                  description: >-
                    The questions the result depends on (through `result` and
                    every aggregation on its path) that have no answer,
                    abstained or failed, as `questions.x` paths in authored
                    question order. Absent when none is missing; reported for
                    every status. A caller who must not act on partial evidence
                    checks that it is absent, for example `status === "decided"
                    && !missing`.
              required:
                - environment
                - id
                - dry_run
                - answers
                - aggregations
                - moonbounce
                - version
                - model
                - cost
                - status
                - outcome
              additionalProperties: true
              x-moonbounce-sdk-known-fields: true
            - type: object
              properties:
                environment:
                  $ref: '#/components/schemas/Environment'
                id:
                  $ref: '#/components/schemas/DryRunId'
                dry_run:
                  type: boolean
                  enum:
                    - true
                answers:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Answer'
                  description: Each question's answer, as System One returns it.
                aggregations:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/AggregationResult'
                  description: >-
                    Every aggregation's result. The result's own aggregation
                    carries `via` when it is bands, rules or match.
                moonbounce:
                  type: object
                  properties:
                    decision_id:
                      $ref: '#/components/schemas/DecisionIdOutput'
                    item_id:
                      type: string
                    metadata:
                      $ref: '#/components/schemas/MetadataOutput'
                    summary:
                      type: string
                  required:
                    - decision_id
                    - item_id
                  additionalProperties: true
                  description: >-
                    What you sent in `moonbounce`, echoed. What ran is in
                    `version` and `model`.
                  x-moonbounce-sdk-known-fields: true
                version:
                  $ref: '#/components/schemas/EvaluatedVersion'
                model:
                  $ref: '#/components/schemas/EvaluatedModel'
                cost:
                  $ref: '#/components/schemas/EvaluateCost'
                status:
                  type: string
                  enum:
                    - abstained
                value:
                  not: {}
                  description: 'Must be absent: an abstained result has no value.'
                  x-moonbounce-absent: true
                outcome:
                  $ref: '#/components/schemas/OutcomeOutput'
                missing:
                  type: array
                  items:
                    $ref: '#/components/schemas/FeatureRefOutput'
                  description: >-
                    The questions the result depends on (through `result` and
                    every aggregation on its path) that have no answer,
                    abstained or failed, as `questions.x` paths in authored
                    question order. Absent when none is missing; reported for
                    every status. A caller who must not act on partial evidence
                    checks that it is absent, for example `status === "decided"
                    && !missing`.
              required:
                - environment
                - id
                - dry_run
                - answers
                - aggregations
                - moonbounce
                - version
                - model
                - cost
                - status
              additionalProperties: true
              x-moonbounce-sdk-known-fields: true
          description: >-
            With `include: ["evaluation"]`: what evaluate returns for this item
            on its own (absent on a failed item).
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                The reason, such as `ENGINE_FAILED`, `ENGINE_UNAVAILABLE` or
                `NOT_STARTED`.
            message:
              type: string
            retryable:
              type: boolean
              description: Sending the item again may work.
          required:
            - code
            - message
            - retryable
          additionalProperties: true
          description: Why it failed; only with status `failed`.
          x-moonbounce-sdk-known-fields: true
        feedback_id:
          type: string
          pattern: >-
            ^fbk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: The example's labels as feedback; absent on a failed example.
      required:
        - item_id
        - status
      additionalProperties: true
      x-moonbounce-sdk-known-fields: true
    ErrorType:
      type: string
      enum:
        - invalid_request
        - authentication
        - permission_denied
        - not_found
        - conflict
        - rate_limited
        - engine_failed
        - unavailable
        - internal
    ErrorIssue:
      type: object
      properties:
        param:
          type: string
        code:
          type: string
          pattern: ^[A-Z][A-Z0-9_]+$
          description: >-
            Stable, extensible issue code; unknown codes still have a parameter
            and human-readable message.
        message:
          type: string
      required:
        - param
        - code
        - message
      additionalProperties: true
      x-moonbounce-sdk-known-fields: true
    StructureHashOutput:
      type: string
      pattern: ^sha256:[0-9a-f]{64}$
    RunItemStatusOutput:
      type: string
      enum:
        - decided
        - computed
        - abstained
        - failed
    OutcomeOutput:
      type: string
      minLength: 1
      maxLength: 200
      description: >-
        An outcome name, or the exact enum label when a string attribute is the
        result.
    ChoiceAnswerValueOutput:
      type: object
      properties:
        type:
          type: string
          enum:
            - choice
        choice:
          type: string
          description: 'The chosen option: one of the most likely.'
        probabilities:
          type: object
          additionalProperties:
            type: number
            minimum: 0
            maximum: 1
          description: Each option's probability.
        confidence:
          type: number
          minimum: 0
          maximum: 1
      required:
        - type
        - choice
        - probabilities
        - confidence
      additionalProperties: true
      description: A choice question's answer.
      x-moonbounce-sdk-known-fields: true
    ScoreAnswerValueOutput:
      type: object
      properties:
        type:
          type: string
          enum:
            - score
        score:
          type: number
          description: Σ level × probability, from 0 to the top level.
        probabilities:
          type: object
          additionalProperties:
            type: number
            minimum: 0
            maximum: 1
          description: >-
            Each level's probability, keyed by its number as a string ("0", "1",
            …).
        confidence:
          type: number
          minimum: 0
          maximum: 1
      required:
        - type
        - score
        - probabilities
        - confidence
      additionalProperties: true
      description: A score question's answer.
      x-moonbounce-sdk-known-fields: true
    EvaluationIdOutput:
      type: string
      pattern: >-
        ^evl_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
    Answer:
      anyOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - noul
            noul:
              type: number
              minimum: 0
              maximum: 1
          required:
            - type
            - noul
          additionalProperties: true
          x-moonbounce-sdk-known-fields: true
        - type: object
          properties:
            type:
              type: string
              enum:
                - noul
            abstained:
              type: boolean
              enum:
                - true
          required:
            - type
            - abstained
          additionalProperties: true
          x-moonbounce-sdk-known-fields: true
        - type: object
          properties:
            type:
              type: string
              enum:
                - noul
            failed:
              type: boolean
              enum:
                - true
          required:
            - type
            - failed
          additionalProperties: true
          x-moonbounce-sdk-known-fields: true
        - $ref: '#/components/schemas/ChoiceAnswerValueOutput'
        - type: object
          properties:
            type:
              type: string
              enum:
                - choice
            abstained:
              type: boolean
              enum:
                - true
          required:
            - type
            - abstained
          additionalProperties: true
          x-moonbounce-sdk-known-fields: true
        - type: object
          properties:
            type:
              type: string
              enum:
                - choice
            failed:
              type: boolean
              enum:
                - true
          required:
            - type
            - failed
          additionalProperties: true
          x-moonbounce-sdk-known-fields: true
        - type: object
          properties:
            type:
              type: string
              enum:
                - score
            score:
              type: number
              description: Σ level × probability, from 0 to the top level.
            probabilities:
              type: object
              additionalProperties:
                type: number
                minimum: 0
                maximum: 1
              description: >-
                Each level's probability, keyed by its number as a string ("0",
                "1", …).
            confidence:
              type: number
              minimum: 0
              maximum: 1
            legend:
              type: object
              additionalProperties: {}
              description: >-
                Each level's description, keyed by its number, as the model
                returned it.
          required:
            - type
            - score
            - probabilities
            - confidence
            - legend
          additionalProperties: true
          x-moonbounce-sdk-known-fields: true
        - type: object
          properties:
            type:
              type: string
              enum:
                - score
            abstained:
              type: boolean
              enum:
                - true
          required:
            - type
            - abstained
          additionalProperties: true
          x-moonbounce-sdk-known-fields: true
        - type: object
          properties:
            type:
              type: string
              enum:
                - score
            failed:
              type: boolean
              enum:
                - true
          required:
            - type
            - failed
          additionalProperties: true
          x-moonbounce-sdk-known-fields: true
      description: >-
        A question's answer as System One returns it, by `type`: `noul`,
        `choice` or `score`. The types are an open catalog: skip an answer whose
        type you don't know.
    AggregationResult:
      type: object
      properties:
        type:
          type: string
        value:
          type: number
        outcome:
          $ref: '#/components/schemas/OutcomeOutput'
        via:
          type: string
          description: >-
            A zero-based rule index, `cases.<label>` for an exact matched case,
            or `else` for the fallback.
        missing:
          type: array
          items:
            $ref: '#/components/schemas/FeatureRefOutput'
          description: >-
            weighted_mean only: the inputs dropped for having no answer, as
            written (`questions.x`).
        abstained:
          type: boolean
          enum:
            - true
      required:
        - type
      additionalProperties: true
      description: >-
        An aggregation's value. `value` for numbers (for bands, the input it
        cut); `outcome` for bands, rules and match; `via` is the zero-based rule
        index, `cases.<label>` for a matched case, or `else` for the fallback;
        `abstained` when unknown.
      x-moonbounce-sdk-known-fields: true
    MetadataOutput:
      type: object
      additionalProperties:
        anyOf:
          - type: string
            maxLength: 512
          - type: number
          - type: boolean
          - type: 'null'
      description: >-
        Caller key-values, stored with the evaluation and never shown to the
        model. Keys starting `mb.` are reserved for Moonbounce provenance:
        `mb.commit`, `mb.branch`, `mb.service` and `mb.release`, which say where
        a call came from.
    EvaluateCost:
      type: object
      properties:
        model_calls:
          type: integer
          minimum: 0
          description: >-
            Upstream model calls, retries included. One call can answer several
            questions (Jev compiles them into one).
        questions:
          type: integer
          minimum: 0
          description: >-
            Questions sent to a model. An answer from the cache, or one a stored
            case kept, is not counted.
        cache_hits:
          type: integer
          minimum: 0
          description: >-
            Questions answered from the answer cache, when any were: previews
            and case runs always report it, evaluate and imports only when the
            cache served an answer.
        input_tokens:
          type: integer
          minimum: 0
        output_tokens:
          type: integer
          minimum: 0
        usd_micros:
          type: integer
          minimum: 0
          description: What the model calls cost, in millionths of a US dollar.
        calls:
          type: array
          items:
            $ref: '#/components/schemas/EvaluateCallCost'
          description: 'Each upstream call: which questions it answered and what it read.'
      required:
        - model_calls
        - questions
        - input_tokens
        - output_tokens
        - usd_micros
      additionalProperties: true
      x-moonbounce-sdk-known-fields: true
    FeatureRefOutput:
      type: string
      minLength: 1
      maxLength: 80
      description: >-
        A feature's path: `questions.<name>`, `attributes.<name>` or
        `aggregations.<name>`.
      examples:
        - questions.asks_for_refund
        - aggregations.band
    DryRunId:
      type: string
      pattern: >-
        ^dry_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
    EvaluateCallCost:
      type: object
      properties:
        questions:
          type: array
          items:
            $ref: '#/components/schemas/NameOutput'
        reads:
          type: array
          items:
            $ref: '#/components/schemas/StatePathOutput'
          description: >-
            The paths sent, as the questions wrote them (`state.message`);
            absent when the whole state was.
        input_tokens:
          type: integer
          minimum: 0
      required:
        - questions
      additionalProperties: true
      description: One upstream System One call.
      x-moonbounce-sdk-known-fields: true
    NameOutput:
      type: string
      pattern: ^[a-z][a-z0-9_]{0,63}$
    StatePathOutput:
      type: string
      minLength: 1
      maxLength: 256
      description: >-
        `state.<key>` or a nested object path such as
        `state.order.customer.tier`: keys of an object `state`. A key has no
        `.`, `[` or `]`. Array indexes are not supported yet.
      examples:
        - state.message
        - state.order.order_total_usd
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key, sent as `Authorization: Bearer <key>`. Each operation lists
        the scope its key needs: `decisions:evaluate` (evaluate and read
        evaluations), `decisions:feedback` (your app's feedback) or
        `decisions:develop` (everything else, including owner feedback and the
        review queue). An operation listing no scope takes any scoped key. A key
        with no scope, or without the operation's, gets 403 INSUFFICIENT_SCOPE.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.