> ## 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.

# Seed a decision with labeled examples

> Imports labeled starting examples (seeds): each runs through the engines (spends engine calls) and is stored as an evaluation with seed feedback. Fresh responses include recorded cost per result and a batch total; engine_calls counts upstream calls, which can answer several features, and cache_hits is 0 today. Evaluates up to 200 labeled examples and records their claims as seed feedback in one atomic batch, so previews can replay them. Before any engine call each example is checked: media and turn parts are 400 CAPABILITY_UNSUPPORTED (`param` `examples.<i>.subject.<j>.type`), an `inputs` name its subject lacks is 400 CONTENT_INVALID (`examples.<i>.nodes.<leaf>.inputs.<k>`), and claims are checked (`examples.<i>.claims.<j>`). If any example's output fails, the whole batch is refused with 502 engine_failed and `details.items` naming every failed example with its per-feature failures (`features`); nothing is saved. The request has a 60 s budget, the commit included; a batch that cannot be evaluated within it is a 422 naming how many examples were evaluated in time (send smaller batches). A replay with the same Idempotency-Key returns the first result with the Idempotent-Replayed header and calls no engine.



## OpenAPI

````yaml /openapi.json post /v1/decisions/{decision_id}/seeds
openapi: 3.1.0
info:
  title: Moonbounce Decisions API
  version: 0.0.0
  description: >-
    Moonbounce decisions: evaluate items against a decision spec (features
    combined by aggregators), record feedback and seed examples, review a ranked
    queue, and improve the spec 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/specs/hash`. 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.


    **Retries.** Send an `Idempotency-Key` on every POST under /v1 that takes
    one (all but `POST /v1/specs/hash`). 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.


    **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, counted per Cloudflare location.
servers:
  - url: https://api.moonbounce.ai
    description: Production
security: []
paths:
  /v1/decisions/{decision_id}/seeds:
    post:
      tags:
        - feedback
      summary: Seed a decision with labeled examples
      description: >-
        Imports labeled starting examples (seeds): each runs through the engines
        (spends engine calls) and is stored as an evaluation with seed feedback.
        Fresh responses include recorded cost per result and a batch total;
        engine_calls counts upstream calls, which can answer several features,
        and cache_hits is 0 today. Evaluates up to 200 labeled examples and
        records their claims as seed feedback in one atomic batch, so previews
        can replay them. Before any engine call each example is checked: media
        and turn parts are 400 CAPABILITY_UNSUPPORTED (`param`
        `examples.<i>.subject.<j>.type`), an `inputs` name its subject lacks is
        400 CONTENT_INVALID (`examples.<i>.nodes.<leaf>.inputs.<k>`), and claims
        are checked (`examples.<i>.claims.<j>`). If any example's output fails,
        the whole batch is refused with 502 engine_failed and `details.items`
        naming every failed example with its per-feature failures (`features`);
        nothing is saved. The request has a 60 s budget, the commit included; a
        batch that cannot be evaluated within it is a 422 naming how many
        examples were evaluated in time (send smaller batches). A replay with
        the same Idempotency-Key returns the first result with the
        Idempotent-Replayed header and calls no engine.
      operationId: importSeeds
      parameters:
        - schema:
            $ref: '#/components/schemas/DecisionId'
          required: true
          name: decision_id
          in: path
        - schema:
            type: string
            minLength: 1
            maxLength: 255
            pattern: ^[\x20-\x7e]+$
            description: >-
              Makes a retry safe. For 24 hours, the same key with the same
              request returns the first stored result (with Idempotent-Replayed:
              true); the same key with a different request is a 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 with its key.
          required: false
          description: >-
            Makes a retry safe. For 24 hours, the same key with the same request
            returns the first stored result (with Idempotent-Replayed: true);
            the same key with a different request is a 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 with its key.
          name: idempotency-key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SeedRequest'
      responses:
        '201':
          description: Seeded
          headers:
            Idempotent-Replayed:
              schema:
                type: string
                enum:
                  - 'true'
                description: >-
                  Present and `true` when this is the stored result of an
                  earlier request with the same Idempotency-Key.
              required: false
              description: >-
                Present and `true` when this is the stored result of an earlier
                request with the same Idempotency-Key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedResponse'
        '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 in this key's organization and environment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '409':
          description: Conflict with the current state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '410':
          description: >-
            The Idempotency-Key's first result was deleted, so it cannot be
            replayed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '422':
          description: >-
            The request is well formed but cannot be processed (for example
            reason IDEMPOTENCY_KEY_REUSED)
          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), or
            details.too_large asks for a smaller request
          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'
        '502':
          description: >-
            An engine failed to answer a feature the output needs (type
            engine_failed, reason ENGINE_FAILED)
          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:develop
components:
  schemas:
    DecisionId:
      type: string
      pattern: ^[a-z][a-z0-9_.-]{0,127}$
    SeedRequest:
      anyOf:
        - $ref: '#/components/schemas/SeedRequestBySpec'
        - $ref: '#/components/schemas/SeedRequestByHash'
    SeedResponse:
      type: object
      properties:
        environment:
          $ref: '#/components/schemas/Environment'
        decision_id:
          $ref: '#/components/schemas/DecisionId'
        version:
          type: object
          properties:
            structure:
              $ref: '#/components/schemas/VersionHash'
            weights:
              $ref: '#/components/schemas/VersionHash'
          required:
            - structure
            - weights
          additionalProperties: false
        total:
          type: integer
        agreed:
          type: integer
          description: Results whose agreed value is true.
        results:
          type: array
          items:
            $ref: '#/components/schemas/SeedResult'
        cost:
          type: object
          properties:
            engine_calls:
              type: integer
              minimum: 0
              description: >-
                On evaluate and seeds, upstream engine calls reported in usage,
                including retries; one call can answer several features (Jev
                compiles them). On previews, features sent to engines, not
                upstream calls.
            cache_hits:
              type: integer
              minimum: 0
              description: >-
                Feature answers reused from cache. Only previews use the cache
                today; evaluate and seeds report 0.
            input_tokens:
              type: integer
              minimum: 0
            usd_micros:
              type: integer
              minimum: 0
          required:
            - engine_calls
            - cache_hits
            - input_tokens
            - usd_micros
          additionalProperties: false
          description: >-
            Always present on fresh responses; absent only on an idempotent
            replay of a response stored before costs were reported.
      required:
        - environment
        - decision_id
        - version
        - total
        - agreed
        - results
      additionalProperties: false
    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 (`subject.0.text`,
                `claims.1.value`).
            details:
              type: object
              additionalProperties: {}
          required:
            - type
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
    SeedRequestBySpec:
      type: object
      properties:
        weights:
          $ref: '#/components/schemas/WeightsRef'
        outcomes:
          $ref: '#/components/schemas/Outcomes'
        spec:
          $ref: '#/components/schemas/Spec'
        structure:
          $ref: '#/components/schemas/VersionHash'
        examples:
          type: array
          items:
            $ref: '#/components/schemas/SeedExample'
          minItems: 1
          maxItems: 200
      required:
        - spec
        - examples
      additionalProperties: false
    SeedRequestByHash:
      type: object
      properties:
        weights:
          $ref: '#/components/schemas/WeightsRef'
        outcomes:
          $ref: '#/components/schemas/Outcomes'
        structure:
          $ref: '#/components/schemas/VersionHash'
        examples:
          type: array
          items:
            $ref: '#/components/schemas/SeedExample'
          minItems: 1
          maxItems: 200
      required:
        - structure
        - examples
      additionalProperties: false
    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; registered structures are shared.
    VersionHash:
      type: string
      pattern: ^sha256:[0-9a-f]{64}$
    SeedResult:
      type: object
      properties:
        item_id:
          type: string
        evaluation_id:
          $ref: '#/components/schemas/EvlId'
        feedback_id:
          $ref: '#/components/schemas/FbkId'
        status:
          $ref: '#/components/schemas/EvaluateStatus'
        outcome:
          $ref: '#/components/schemas/Name'
        score:
          type: number
        agreed:
          type:
            - boolean
            - 'null'
          description: >-
            True when every checked claim agrees: outcome, target, and each
            feature claim at p >= 0.5. A single feature conflict makes it false;
            null when the output made no decision.
        conflicts:
          type: array
          items:
            $ref: '#/components/schemas/SeedConflict'
        cost:
          type: object
          properties:
            engine_calls:
              type: integer
              minimum: 0
              description: >-
                On evaluate and seeds, upstream engine calls reported in usage,
                including retries; one call can answer several features (Jev
                compiles them). On previews, features sent to engines, not
                upstream calls.
            cache_hits:
              type: integer
              minimum: 0
              description: >-
                Feature answers reused from cache. Only previews use the cache
                today; evaluate and seeds report 0.
            input_tokens:
              type: integer
              minimum: 0
            usd_micros:
              type: integer
              minimum: 0
          required:
            - engine_calls
            - cache_hits
            - input_tokens
            - usd_micros
          additionalProperties: false
          description: >-
            Always present on fresh responses; absent only on an idempotent
            replay of a response stored before costs were reported.
      required:
        - item_id
        - evaluation_id
        - feedback_id
        - status
        - agreed
        - conflicts
      additionalProperties: false
    ErrorType:
      type: string
      enum:
        - invalid_request
        - authentication
        - permission_denied
        - not_found
        - conflict
        - rate_limited
        - engine_failed
        - unavailable
        - internal
    WeightsRef:
      anyOf:
        - type: string
          enum:
            - default
        - $ref: '#/components/schemas/VersionHash'
      default: default
    Outcomes:
      type: object
      properties:
        below:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,63}$
          description: The outcome for a score under the first cut.
        cuts:
          type: array
          items:
            type: object
            properties:
              at:
                type: number
              outcome:
                $ref: '#/components/schemas/Name'
            required:
              - at
              - outcome
            additionalProperties: false
          minItems: 1
          maxItems: 9
        abstain:
          $ref: '#/components/schemas/Name'
      required:
        - below
        - cuts
      additionalProperties: false
    Spec:
      type: object
      properties:
        format:
          type: string
          enum:
            - moonbounce.spec/0
        guidance:
          type: string
          minLength: 1
          maxLength: 20000
        nodes:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SpecNode'
          description: >-
            The spec's named nodes, 1 to 64: boolean features and the
            aggregators that read them. Every reference (`output`, a combine
            term's `node`, a calibrate's `node`) names a node in this map, with
            no cycles.
        output:
          $ref: '#/components/schemas/Name'
        target:
          type: string
          minLength: 1
          maxLength: 4000
          description: >-
            The yes/no statement the output's score is the probability of.
            Required when `output` is a combine or calibrate node, optional on a
            boolean output. Feedback `target` claims need it.
        meta:
          $ref: '#/components/schemas/Meta'
      required:
        - format
        - nodes
        - output
      additionalProperties: false
    SeedExample:
      type: object
      properties:
        item_id:
          type: string
          minLength: 1
          maxLength: 256
        subject:
          type: array
          items:
            $ref: '#/components/schemas/RequestContentPart'
          minItems: 1
          maxItems: 64
        context:
          type: array
          items:
            $ref: '#/components/schemas/RequestContentPart'
          maxItems: 64
        summary:
          type: string
          minLength: 1
          maxLength: 140
        metadata:
          $ref: '#/components/schemas/Metadata'
        claims:
          type: array
          items:
            $ref: '#/components/schemas/Claim'
          minItems: 1
          maxItems: 65
        reason:
          type: string
          maxLength: 4000
        unsure:
          type: boolean
      required:
        - item_id
        - subject
        - claims
      additionalProperties: false
    EvlId:
      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}$
    FbkId:
      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}$
    EvaluateStatus:
      type: string
      enum:
        - scored
        - no_outcomes
        - abstained
    Name:
      type: string
      pattern: ^[a-z][a-z0-9_]{0,63}$
    SeedConflict:
      type: object
      properties:
        feature:
          $ref: '#/components/schemas/Name'
        expected:
          type: boolean
        got:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 1
      required:
        - feature
        - expected
        - got
      additionalProperties: false
    SpecNode:
      oneOf:
        - $ref: '#/components/schemas/BooleanFeature'
        - $ref: '#/components/schemas/Combine'
        - $ref: '#/components/schemas/Calibrate'
      discriminator:
        propertyName: type
        mapping:
          boolean: '#/components/schemas/BooleanFeature'
          combine: '#/components/schemas/Combine'
          calibrate: '#/components/schemas/Calibrate'
    Meta:
      type: object
      properties:
        title:
          type: string
          maxLength: 200
        description:
          type: string
          maxLength: 4000
        owner:
          type: string
          maxLength: 200
        tags:
          type: array
          items:
            type: string
            maxLength: 64
          maxItems: 32
        display:
          type: object
          additionalProperties:
            type: object
            properties:
              text:
                type: string
                minLength: 1
                maxLength: 40
              help:
                type: string
                maxLength: 200
            required:
              - text
            additionalProperties: false
      additionalProperties: false
    RequestContentPart:
      oneOf:
        - $ref: '#/components/schemas/TextPart'
        - $ref: '#/components/schemas/JsonPart'
        - $ref: '#/components/schemas/ImagePart'
        - $ref: '#/components/schemas/AudioPart'
        - $ref: '#/components/schemas/VideoPart'
        - $ref: '#/components/schemas/DocumentPart'
        - $ref: '#/components/schemas/TurnPart'
      discriminator:
        propertyName: type
        mapping:
          text: '#/components/schemas/TextPart'
          json: '#/components/schemas/JsonPart'
          image: '#/components/schemas/ImagePart'
          audio: '#/components/schemas/AudioPart'
          video: '#/components/schemas/VideoPart'
          document: '#/components/schemas/DocumentPart'
          turn: '#/components/schemas/TurnPart'
    Metadata:
      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.
    Claim:
      oneOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - target
            value:
              type: boolean
              description: Whether the spec's target statement is true of this item.
          required:
            - kind
            - value
          additionalProperties: false
          description: >-
            Whether the target statement is true. Only for specs that declare a
            target.
        - type: object
          properties:
            kind:
              type: string
              enum:
                - outcome
            value:
              type: string
              minLength: 1
              maxLength: 64
              description: >-
                The right outcome: one of this evaluation's outcomes (`below` or
                a cut's outcome); an `abstain` name counts only where it reuses
                one of them.
          required:
            - kind
            - value
          additionalProperties: false
          description: >-
            The outcome this item should have had. On a cut score, the lowest
            outcome also says the target is false and the highest says it is
            true; middle outcomes say nothing about the target.
        - type: object
          properties:
            kind:
              type: string
              enum:
                - verdict
            value:
              type: string
              enum:
                - approve
                - reject
              description: 'approve: the shown outcome was right. reject: it was wrong.'
          required:
            - kind
            - value
          additionalProperties: false
          description: >-
            Approve or reject the outcome that was shown. Needs
            `about.evaluation_id`, and an evaluation whose outcome was shown to
            someone: primary traffic that decided (it has a score). An
            evaluation that abstained has only a fallback outcome, whatever it
            is called.
        - type: object
          properties:
            kind:
              type: string
              enum:
                - feature
            feature:
              type: string
              minLength: 1
              maxLength: 64
              description: A boolean feature of the evaluation's spec.
            value:
              type: boolean
              description: What the feature's answer should have been.
          required:
            - kind
            - feature
            - value
          additionalProperties: false
          description: >-
            The expected answer of one boolean feature. It is stored against
            that feature's prompt as it was judged, so a reworded prompt does
            not inherit it.
        - type: object
          properties:
            kind:
              type: string
              enum:
                - input_broken
            problem:
              type: string
              enum:
                - truncated
                - wrong_language
                - bad_extraction
                - unreadable
                - other
          required:
            - kind
            - problem
          additionalProperties: false
          description: >-
            The content could not be judged. The evaluation is kept out of fits
            and previews.
        - type: object
          properties:
            kind:
              type: string
              enum:
                - action
            value:
              type: string
              minLength: 1
              maxLength: 128
              description: >-
                What your app did, in your own words (for example
                `auto_approved`).
            logic_version:
              type: string
              maxLength: 128
              description: Which version of your own logic acted.
          required:
            - kind
            - value
          additionalProperties: false
          description: >-
            What your app did with the outcome. Observed behavior, not a
            statement of what is true.
    BooleanFeature:
      type: object
      properties:
        type:
          type: string
          enum:
            - boolean
        prompt:
          type: string
          minLength: 1
          maxLength: 4000
        guidance:
          type: string
          minLength: 1
          maxLength: 4000
        inputs:
          type: array
          items:
            $ref: '#/components/schemas/Name'
          minItems: 1
          description: >-
            Names of the `subject` parts this feature reads (default: all of
            them); `context` parts are always read. Every name must match a
            subject part's `name`, or the request is a 400 CONTENT_INVALID.
        criteria:
          type: object
          properties:
            'true':
              type: string
              minLength: 1
              maxLength: 4000
            'false':
              type: string
              minLength: 1
              maxLength: 4000
          additionalProperties: false
      required:
        - type
        - prompt
      additionalProperties: false
    Combine:
      type: object
      properties:
        type:
          type: string
          enum:
            - combine
        terms:
          type: array
          items:
            $ref: '#/components/schemas/CombineTerm'
          minItems: 1
          maxItems: 64
        prior:
          type: string
          enum:
            - mean
            - any
          description: >-
            Default combine weights before fitting. mean averages oriented
            inputs; any computes sigmoid(-4 + 8·Σraises - 8·Σlowers), a logistic
            of a signed sum: one strong raise is enough and weak raises add up.
        fixed:
          type: object
          properties:
            link:
              type: string
              enum:
                - identity
                - logistic
              description: >-
                identity: the weighted sum plus bias, clipped to 0..1; logistic:
                the sigmoid of the weighted sum plus bias.
            weights:
              type: object
              additionalProperties:
                type: number
              description: Signed weights per term key (node; options are reserved).
            bias:
              type: number
              description: Offset added to the weighted sum before applying the link.
          required:
            - link
            - weights
            - bias
          additionalProperties: false
          description: >-
            Numbers fixed in code, never overridden by fitted weights. Signed
            weights multiply raw P(yes): raises weights must be >= 0 and lowers
            weights <= 0.
      required:
        - type
        - terms
      additionalProperties: false
      description: >-
        Scores a node from its terms. Before fitting (and without fixed
        numbers), mean averages the oriented inputs, so each of n terms weighs
        1/n and adding a term dilutes the others; any computes sigmoid(-4 +
        8·Σraises - 8·Σlowers): one strong raise is enough, weak raises add up,
        and lowers cancel raises. Fitted or fixed numbers replace the prior.
    Calibrate:
      type: object
      properties:
        type:
          type: string
          enum:
            - calibrate
        node:
          $ref: '#/components/schemas/Name'
      required:
        - type
        - node
      additionalProperties: false
    TextPart:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
        text:
          type: string
          minLength: 1
        name:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,63}$
          description: >-
            Names the part, so a feature's `inputs` can pick it. In `subject`,
            avoid "context" when the request also sends `context`.
        sensitive:
          type: boolean
          description: >-
            Display policy only: reviewers see the part blurred or behind a
            link. The engine still reads it and it is stored like any other
            part.
      required:
        - type
        - text
      additionalProperties: false
    JsonPart:
      type: object
      properties:
        type:
          type: string
          enum:
            - json
        data:
          anyOf:
            - type: object
              additionalProperties: {}
            - type: array
              items: {}
        name:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,63}$
          description: >-
            Names the part, so a feature's `inputs` can pick it. In `subject`,
            avoid "context" when the request also sends `context`.
        sensitive:
          type: boolean
          description: >-
            Display policy only: reviewers see the part blurred or behind a
            link. The engine still reads it and it is stored like any other
            part.
      required:
        - type
        - data
      additionalProperties: false
    ImagePart:
      type: object
      properties:
        type:
          type: string
          enum:
            - image
        source:
          $ref: '#/components/schemas/MediaSource'
        name:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,63}$
          description: >-
            Names the part, so a feature's `inputs` can pick it. In `subject`,
            avoid "context" when the request also sends `context`.
        sensitive:
          type: boolean
          description: >-
            Display policy only: reviewers see the part blurred or behind a
            link. The engine still reads it and it is stored like any other
            part.
      required:
        - type
        - source
      additionalProperties: false
      description: >-
        Recognized, not accepted yet: 400 CAPABILITY_UNSUPPORTED
        (content.image).
    AudioPart:
      type: object
      properties:
        type:
          type: string
          enum:
            - audio
        source:
          $ref: '#/components/schemas/MediaSource'
        name:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,63}$
          description: >-
            Names the part, so a feature's `inputs` can pick it. In `subject`,
            avoid "context" when the request also sends `context`.
        sensitive:
          type: boolean
          description: >-
            Display policy only: reviewers see the part blurred or behind a
            link. The engine still reads it and it is stored like any other
            part.
      required:
        - type
        - source
      additionalProperties: false
      description: >-
        Recognized, not accepted yet: 400 CAPABILITY_UNSUPPORTED
        (content.audio).
    VideoPart:
      type: object
      properties:
        type:
          type: string
          enum:
            - video
        source:
          $ref: '#/components/schemas/MediaSource'
        name:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,63}$
          description: >-
            Names the part, so a feature's `inputs` can pick it. In `subject`,
            avoid "context" when the request also sends `context`.
        sensitive:
          type: boolean
          description: >-
            Display policy only: reviewers see the part blurred or behind a
            link. The engine still reads it and it is stored like any other
            part.
      required:
        - type
        - source
      additionalProperties: false
      description: >-
        Recognized, not accepted yet: 400 CAPABILITY_UNSUPPORTED
        (content.video).
    DocumentPart:
      type: object
      properties:
        type:
          type: string
          enum:
            - document
        source:
          $ref: '#/components/schemas/MediaSource'
        name:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,63}$
          description: >-
            Names the part, so a feature's `inputs` can pick it. In `subject`,
            avoid "context" when the request also sends `context`.
        sensitive:
          type: boolean
          description: >-
            Display policy only: reviewers see the part blurred or behind a
            link. The engine still reads it and it is stored like any other
            part.
      required:
        - type
        - source
      additionalProperties: false
      description: >-
        Recognized, not accepted yet: 400 CAPABILITY_UNSUPPORTED
        (content.document).
    TurnPart:
      type: object
      properties:
        type:
          type: string
          enum:
            - turn
        role:
          type: string
          minLength: 1
          maxLength: 64
        content:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/TextPart'
              - $ref: '#/components/schemas/JsonPart'
              - $ref: '#/components/schemas/ImagePart'
              - $ref: '#/components/schemas/AudioPart'
              - $ref: '#/components/schemas/VideoPart'
              - $ref: '#/components/schemas/DocumentPart'
            discriminator:
              propertyName: type
              mapping:
                text: '#/components/schemas/TextPart'
                json: '#/components/schemas/JsonPart'
                image: '#/components/schemas/ImagePart'
                audio: '#/components/schemas/AudioPart'
                video: '#/components/schemas/VideoPart'
                document: '#/components/schemas/DocumentPart'
          minItems: 1
          maxItems: 64
        name:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,63}$
          description: >-
            Names the part, so a feature's `inputs` can pick it. In `subject`,
            avoid "context" when the request also sends `context`.
        sensitive:
          type: boolean
          description: >-
            Display policy only: reviewers see the part blurred or behind a
            link. The engine still reads it and it is stored like any other
            part.
      required:
        - type
        - role
        - content
      additionalProperties: false
      description: 'Recognized, not accepted yet: 400 CAPABILITY_UNSUPPORTED (content.turn).'
    CombineTerm:
      type: object
      properties:
        node:
          $ref: '#/components/schemas/Name'
        option:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,63}$
          description: >-
            Reserved for choice and scale features, which are not available yet:
            any value is a 400.
        effect:
          type: string
          enum:
            - raises
            - lowers
          default: raises
          description: >-
            raises: a yes pushes the score up; lowers: a yes pushes it down. The
            sign lives here; fixed weights must agree with it.
      required:
        - node
      additionalProperties: false
    MediaSource:
      oneOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - url
            url:
              type: string
              format: uri
          required:
            - kind
            - url
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - base64
            media_type:
              type: string
              minLength: 1
              maxLength: 255
            data:
              type: string
              minLength: 1
          required:
            - kind
            - media_type
            - data
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - file
            file_id:
              type: string
              minLength: 1
              maxLength: 256
          required:
            - kind
            - file_id
          additionalProperties: false
  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.