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

# Create decision

> Ask a decision model one or more typed questions about a piece of `state`. The model returns a
probability for each question instead of text. The request and response use the OpenRouter Decisions
schema. Jev (`typesafe/jev-1.13`) is the first decision model. Any model with `is_classifier_model: true`
in `GET /models` works here. Chat models are refused with `model_unavailable`. Send those to
`POST /chat/completions`.

You choose the question ids. The answers come back under the same ids. There are three question types:

- `noul` is a yes/no question. The answer is `noul`, the probability of yes. `criteria.true` and
  `criteria.false` are optional descriptions of each side.
- `choice` picks one option from `criteria`, a map of option id to description. A description may be
  `null`. The answer is `choice`, `probabilities` over every option, and `confidence`.
- `score` places the state on the ordered rubric in `criteria`, a list with the lowest level first. The
  answer is `score` (the weighted position), `probabilities` per level, `legend`, and `confidence`.

`state`, `instructions` and criteria accept a string, a JSON object, or an array. The response `model`
is the exact version the provider served, for example `typesafe/jev-1.13-20260917`. Billing uses the
model you requested. There is no streaming form. The server applies its zero-data-retention provider
policy after any `provider` preferences you send.

### Billing

Each call charges the caller's credit balance from the provider-reported cost, or from the model's token
rate when the provider reports none. A call costs at least one credit, so put every independent question
about one piece of state in a single request.




## OpenAPI

````yaml post /decisions
openapi: 3.0.0
info:
  title: Public API
  version: 1.0.0
servers:
  - url: https://api.gumloop.com/api/v1
security: []
paths:
  /decisions:
    post:
      tags:
        - Models
      summary: Create decision
      description: >
        Ask a decision model one or more typed questions about a piece of
        `state`. The model returns a

        probability for each question instead of text. The request and response
        use the OpenRouter Decisions

        schema. Jev (`typesafe/jev-1.13`) is the first decision model. Any model
        with `is_classifier_model: true`

        in `GET /models` works here. Chat models are refused with
        `model_unavailable`. Send those to

        `POST /chat/completions`.


        You choose the question ids. The answers come back under the same ids.
        There are three question types:


        - `noul` is a yes/no question. The answer is `noul`, the probability of
        yes. `criteria.true` and
          `criteria.false` are optional descriptions of each side.
        - `choice` picks one option from `criteria`, a map of option id to
        description. A description may be
          `null`. The answer is `choice`, `probabilities` over every option, and `confidence`.
        - `score` places the state on the ordered rubric in `criteria`, a list
        with the lowest level first. The
          answer is `score` (the weighted position), `probabilities` per level, `legend`, and `confidence`.

        `state`, `instructions` and criteria accept a string, a JSON object, or
        an array. The response `model`

        is the exact version the provider served, for example
        `typesafe/jev-1.13-20260917`. Billing uses the

        model you requested. There is no streaming form. The server applies its
        zero-data-retention provider

        policy after any `provider` preferences you send.


        ### Billing


        Each call charges the caller's credit balance from the provider-reported
        cost, or from the model's token

        rate when the provider reports none. A call costs at least one credit,
        so put every independent question

        about one piece of state in a single request.
      operationId: createDecision
      parameters:
        - in: query
          name: team_id
          required: false
          schema:
            type: string
          description: >-
            Scope the request to a team. When omitted, uses the authenticated
            user's default organization.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - state
                - questions
              properties:
                model:
                  type: string
                  description: >-
                    Decision model id. Use an `id` from `GET /models` whose
                    `is_classifier_model` is `true`.
                  example: typesafe/jev-1.13
                state:
                  description: >-
                    The content to evaluate. A plain string, or a JSON object or
                    array of related context.
                  oneOf:
                    - type: string
                    - type: object
                    - type: array
                      items: {}
                questions:
                  type: object
                  description: >-
                    Questions keyed by ids you choose. Answers come back under
                    the same ids.
                  additionalProperties:
                    oneOf:
                      - type: object
                        title: Yes/no question
                        required:
                          - type
                          - instructions
                        properties:
                          type:
                            type: string
                            enum:
                              - noul
                          instructions:
                            description: The question. A string, or a JSON object or array.
                          criteria:
                            type: object
                            description: What a yes and a no mean.
                            required:
                              - 'true'
                              - 'false'
                            properties:
                              'true': {}
                              'false': {}
                      - type: object
                        title: Choice question
                        required:
                          - type
                          - instructions
                          - criteria
                        properties:
                          type:
                            type: string
                            enum:
                              - choice
                          instructions: {}
                          criteria:
                            type: object
                            description: >-
                              Option id to description. A description may be
                              `null`.
                            additionalProperties: true
                      - type: object
                        title: Score question
                        required:
                          - type
                          - instructions
                          - criteria
                        properties:
                          type:
                            type: string
                            enum:
                              - score
                          instructions: {}
                          criteria:
                            type: array
                            description: Ordered rubric, lowest level first.
                            items: {}
                provider:
                  type: object
                  description: >-
                    OpenRouter provider routing preferences. The server applies
                    its zero-data-retention policy last. You cannot turn it off.
                session_id:
                  type: string
                  maxLength: 256
                  description: >-
                    Groups related requests in observability tooling. Not sent
                    to the model.
                trace:
                  type: object
                  description: >-
                    Observability metadata (`trace_id`, `trace_name`,
                    `span_name`, `generation_name`, `parent_span_id`, plus
                    custom keys).
                user:
                  type: string
                  description: >-
                    A stable id for your end user. The provider uses it for
                    abuse monitoring.
            example:
              model: typesafe/jev-1.13
              state:
                ticket: My checkout page shows a blank screen after I click Pay.
              questions:
                is_bug:
                  type: noul
                  instructions: Is the customer reporting a software defect?
                team:
                  type: choice
                  instructions: Which team should own this ticket?
                  criteria:
                    payments: Checkout, billing
                    frontend: Rendering, layout
                    account: Login, permissions
                urgency:
                  type: score
                  instructions: How urgent is this ticket?
                  criteria:
                    - Can wait for the next release
                    - Should be fixed this week
                    - Blocking revenue right now
      responses:
        '200':
          description: One answer per question, under the question's id.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: gen-dec-1790835808-rFEEP39lhplllf50bn9Q
                  model:
                    type: string
                    description: The exact model version that answered.
                    example: typesafe/jev-1.13-20260917
                  provider:
                    type: string
                    example: TypeSafe
                  answers:
                    type: object
                    description: >-
                      Keyed by your question ids. The fields present depend on
                      the question `type`.
                    additionalProperties:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - noul
                            - choice
                            - score
                        noul:
                          type: number
                          description: Probability of yes (`noul` questions).
                        choice:
                          type: string
                          description: The selected option id (`choice` questions).
                        score:
                          type: number
                          description: Weighted position on the rubric (`score` questions).
                        probabilities:
                          type: object
                          additionalProperties:
                            type: number
                        legend:
                          type: object
                          description: Level index to rubric text (`score` questions).
                        confidence:
                          type: number
                          description: >-
                            How concentrated the distribution is. It does not
                            say whether the answer is right.
                  usage:
                    type: object
                    properties:
                      input_tokens:
                        type: integer
                        example: 380
                      output_tokens:
                        type: integer
                        example: 70
                      cost:
                        type: number
                        description: Provider-reported USD cost. May be 0 or absent.
              example:
                id: gen-dec-1790835808-rFEEP39lhplllf50bn9Q
                model: typesafe/jev-1.13-20260917
                provider: TypeSafe
                answers:
                  is_bug:
                    type: noul
                    noul: 0.94
                  team:
                    type: choice
                    choice: payments
                    confidence: 0.37
                    probabilities:
                      payments: 0.58
                      frontend: 0.42
                      account: 0
                  urgency:
                    type: score
                    score: 1.92
                    confidence: 0.88
                    legend:
                      '0': Can wait for the next release
                      '1': Should be fixed this week
                      '2': Blocking revenue right now
                    probabilities:
                      '0': 0
                      '1': 0.07
                      '2': 0.93
                usage:
                  input_tokens: 380
                  output_tokens: 70
                  cost: 0
        '400':
          description: >-
            Invalid request body (`invalid_request`, with
            `details.validation_errors`). A model that is unregistered, not
            permitted for your organization, or not a decision model
            (`model_unavailable`, with `details.reason` one of `not_registered`,
            `not_permitted`, `not_decision_model`, `proxy_unsupported`). A
            request the provider rejected (`provider_error`, with the provider's
            own text in `details.provider_message`).
        '401':
          description: Unauthorized. The API key is missing or invalid.
        '402':
          description: >-
            Insufficient credits (`credit_limit_exceeded`), or the provider
            account is out of credits (`provider_error`).
        '403':
          description: Your role does not include agent access (`ACCESS_AGENTS`).
        '404':
          description: User profile not found (`user_profile_not_found`).
        '429':
          description: >-
            The provider rate limited the request (`provider_error`). Wait for
            `Retry-After` seconds before you retry.
        '502':
          description: Upstream provider error.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            curl -X POST 'https://api.gumloop.com/api/v1/decisions' \
              -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
              -H 'Content-Type: application/json' \
              -d '{
                "model": "typesafe/jev-1.13",
                "state": {"ticket": "My checkout page shows a blank screen after I click Pay."},
                "questions": {
                  "is_bug": {"type": "noul", "instructions": "Is the customer reporting a software defect?"},
                  "team": {"type": "choice", "instructions": "Which team should own this ticket?",
                           "criteria": {"payments": "Checkout, billing", "frontend": "Rendering, layout", "account": "Login, permissions"}},
                  "urgency": {"type": "score", "instructions": "How urgent is this ticket?",
                              "criteria": ["Can wait for the next release", "Should be fixed this week", "Blocking revenue right now"]}
                }
              }'
        - lang: python
          label: Python
          source: |
            import requests

            response = requests.post(
                "https://api.gumloop.com/api/v1/decisions",
                headers={"Authorization": "Bearer YOUR_ACCESS_TOKEN"},
                json={
                    "model": "typesafe/jev-1.13",
                    "state": {"ticket": "My checkout page shows a blank screen after I click Pay."},
                    "questions": {
                        "is_bug": {"type": "noul", "instructions": "Is the customer reporting a software defect?"},
                        "team": {
                            "type": "choice",
                            "instructions": "Which team should own this ticket?",
                            "criteria": {"payments": "Checkout, billing", "frontend": "Rendering, layout", "account": "Login, permissions"},
                        },
                        "urgency": {
                            "type": "score",
                            "instructions": "How urgent is this ticket?",
                            "criteria": ["Can wait for the next release", "Should be fixed this week", "Blocking revenue right now"],
                        },
                    },
                },
            )
            answers = response.json()["answers"]
            if answers["is_bug"]["noul"] > 0.8:
                route_to(answers["team"]["choice"])
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A personal API key or an [OAuth 2.0](/api-reference/oauth) access token.
        Personal API keys also require the `x-auth-key` header with your user
        ID.

````