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

# List the models a decision can run on

> The models this deployment offers and what each reports: the resolved model, whether it is pinned, the question types and content it reads, and its list price. `default` is the model a decision runs on until you choose one. Choose one for a decision with `PUT /v1/decisions/{decision_id}/model`.



## OpenAPI

````yaml /openapi.json get /v1/models
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`. 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/validate` and `POST /v1/review/items/fill`, whose
    retry is another fill within the day's budget). 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 for requests without a valid key; a 429
    RATE_LIMITED carries `Retry-After`.
servers:
  - url: https://api.moonbounce.ai
    description: Production
security: []
paths:
  /v1/models:
    get:
      tags:
        - models
      summary: List the models a decision can run on
      description: >-
        The models this deployment offers and what each reports: the resolved
        model, whether it is pinned, the question types and content it reads,
        and its list price. `default` is the model a decision runs on until you
        choose one. Choose one for a decision with `PUT
        /v1/decisions/{decision_id}/model`.
      operationId: listModels
      responses:
        '200':
          description: The offered models
          content:
            application/json:
              examples:
                two_models:
                  summary: Jev, pinned and the default, and Clef, an alias
                  value:
                    default: jev-1.14.0
                    models:
                      - id: jev-1.14.0
                        resolved_model: jev-1.14.0
                        pinned: true
                        question_types:
                          - noul
                        modalities:
                          text: ga
                          json: ga
                          image: preview
                        pricing:
                          input_per_mtok_usd: 0.042
                          output_per_mtok_usd: 0
                          source: https://docs.typesafe.ai/models.md
                      - id: '@cf/cloudflare/clef'
                        resolved_model: '@cf/cloudflare/clef@clef@0.1.0'
                        pinned: false
                        question_types:
                          - noul
                        modalities:
                          text: ga
                          json: ga
                          image: preview
                        pricing:
                          input_per_mtok_usd: 0.24
                          output_per_mtok_usd: 0
                          source: >-
                            https://developers.cloudflare.com/workers-ai/models/clef/
              schema:
                $ref: '#/components/schemas/ModelList'
        '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'
        '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: []
components:
  schemas:
    ModelList:
      type: object
      properties:
        default:
          type: string
          minLength: 1
          maxLength: 128
          description: >-
            The model a decision runs on in an environment where nobody set one
            (`GET .../model` reports `source: "default"`). Absent when that
            model is not offered here (its key or configuration is missing):
            such decisions then cannot evaluate until it is fixed or they are
            moved with `PUT /v1/decisions/{decision_id}/model`.
          example: jev-1.14.0
        models:
          type: array
          items:
            $ref: '#/components/schemas/Model'
      required:
        - models
    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
    Model:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 128
          description: >-
            A model id from `GET /v1/models`, such as `jev-1.14.0`. `*-latest`
            and `*-preview` aliases are refused; whether an id fixes the model's
            behavior is its `pinned` flag. Open: new models are added without a
            contract change.
          example: jev-1.14.0
        resolved_model:
          type: string
          description: >-
            What evaluations report as `model.resolved_model` when this model
            answers.
        pinned:
          type: boolean
          description: >-
            Whether the id fixes the model's behavior. `false` means the
            provider can change what the id serves (an alias), so answers can
            drift without `model.profile` changing.
        question_types:
          type: array
          items:
            type: string
          description: Question types the model answers, e.g. `noul`.
        modalities:
          type: object
          additionalProperties:
            type: string
            enum:
              - ga
              - preview
          description: >-
            What the model reads: a string state is `text`, any other state
            `json`. `preview` ones are not used by evaluate yet.
        pricing:
          type: object
          properties:
            input_per_mtok_usd:
              type: number
              minimum: 0
            output_per_mtok_usd:
              type: number
              minimum: 0
            source:
              type: string
          required:
            - source
          description: The list price usage is billed at, and where it comes from.
      required:
        - id
        - resolved_model
        - pinned
        - question_types
        - modalities
    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
  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.