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

# System One API

> Typed decisions: send a state and named questions, get a probability per answer back. No text generation, no parsing.

## Overview

Most of what an agent asks a model is not a paragraph. It is "which queue does this ticket go to", "how severe is this", "does this message need a human". Asking a chat model means generating text, parsing it, and hoping the number it wrote reflects anything. System One skips the generation: the model reads the state and reports the probability of every option for every question, so your code branches on numbers.

`POST /v1/systemone` takes a `state` (text or JSON) and a map of named questions of three types. Every answer is a distribution over the options you gave.

| type | ask | answer |
| - | - | - |
| `noul` | a yes/no statement | `noul` (the probability of yes), `probabilities`, `confidence` |
| `choice` | pick one of a set of named options | `choice`, `probabilities` per option, `confidence` |
| `score` | rate against 2 to 10 ordered levels | `score` (expected level), `probabilities` per level index, `legend`, `confidence` |

Model: `d3-ultra` (26B, [vllm-sr/d3-ultra](https://huggingface.co/vllm-sr/d3-ultra), Apache-2.0), a decision model trained to read a state and answer typed questions about it.

## Writing questions

`instructions` is what you want judged. `criteria` describes the options: for `choice` a map of option name to description (or `null`), for `score` an ordered list of level descriptions from lowest to highest, for `noul` an optional `{"true": ..., "false": ...}` pair. Descriptions do the work: an option the model can only see by name gets answered by the name alone.

An optional top-level `instructions` string is placed ahead of the questions, for context every question shares.

Ask every question about one state in one call. Questions are answered in the order you send them.

## Reading answers

* `probabilities` sum to 1 per question. `choice` is the argmax; `score` is the expected level, so a 3-level scale answering `{0: 0.0, 1: 0.7, 2: 0.3}` scores 1.3.
* `confidence` (0 to 1) is the probability the model put on the answer it gave, measured over everything it could have produced, not only your options. It equals the answer's entry in `probabilities` times `diagnostics.<id>.label_mass`, so it is never higher than that entry. For `score` the answer is the most likely level; for `noul` it is the more likely of yes and no. Gate actions on it: act automatically above a threshold you choose per action, route to a person below it.
* `diagnostics.<id>.label_mass` is how much of the model's probability landed on your options at all. A low value means the question or its options read poorly to the model; reword them.
* `usage.input_tokens` is the state plus the questions. `usage.input_tokens_details.cached_tokens` is the part of it served from the prefix cache, billed at the cached-input rate. `usage.output_tokens` is always 0: nothing is generated.

## Pricing

$0.042 per million input tokens, $0.01 per million cached input tokens, no output charge.

## Errors

* `400`: the request does not fit the contract (for example a `choice` with no options, or `score` criteria that are not a list). The message names the question.
* `401`: missing or invalid key. `429`: your key's rate limit.
* `404`: unknown `model`.
* `422`: `images`, `audio` and `videos` are not accepted on this endpoint yet.
* `503`: the decision engine is unavailable; retry with exponential backoff.
* Every response carries `x-request-id`.

## Switching from another typed-decision API

If you already send `{model, state, questions}` with `noul`, `choice` and `score` questions to a `/v1/systemone` endpoint, the bodies are the same here. Change three things: the base URL to `https://api.morphllm.com`, the key to a Morph key, and `model` to `d3-ultra`.


## OpenAPI

````yaml POST /v1/systemone
openapi: 3.1.0
info:
  title: Morph API
  version: 1.2.0
  description: >-
    The Morph public API at api.morphllm.com: OpenAI- and Anthropic-compatible
    inference (chat completions, messages), Fast Apply code editing, Compact
    context compression, System One typed decisions, model listing, and
    dedicated endpoint management, and agentic credit top-ups paid over x402.
    Model ids, prices, and context windows are served live at
    https://www.morphllm.com/api/models/json.
  contact:
    name: Morph
    url: https://morphllm.com
    email: info@morphllm.com
  license:
    name: Proprietary
    url: https://morphllm.com/privacy/tos
servers:
  - url: https://api.morphllm.com
    description: Production
security: []
tags:
  - name: chat
    description: >-
      OpenAI- and Anthropic-compatible chat inference, including Fast Apply and
      WarpGrep models.
  - name: compact
    description: Context compression for long agent conversations.
  - name: systemone
    description: 'Typed decisions: a state in, a probability distribution per question out.'
  - name: models
    description: Model listing.
  - name: dedicated
    description: Dedicated endpoint discovery, status, and cancellation.
  - name: credits
    description: Agentic credit top-ups paid in USDC over x402.
  - name: telemetry
    description: Usage reporting hooks.
paths:
  /v1/systemone:
    post:
      tags:
        - systemone
      summary: Answer typed questions about a state
      description: >-
        Send a state and named questions of three types: `noul` (yes/no),
        `choice` (one of a set) and `score` (ordered levels). Every answer is a
        probability distribution your code can branch on, with a `confidence`.
        No text is generated. Batch every question about one state into one
        call.
      operationId: systemone
      requestBody:
        required: true
        description: The state and the questions to answer about it.
        content:
          application/json:
            example:
              model: d3-ultra
              state: >-
                Hi, I've been trying to connect my Stripe account for 3 days and
                it keeps failing. I'm losing sales. Please help ASAP.
              questions:
                department:
                  type: choice
                  instructions: Which team should handle this?
                  criteria:
                    billing: Payment or subscription issues
                    technical: Bugs or integration problems
                    sales: Pricing or account questions
                frustration:
                  type: score
                  instructions: How frustrated does the customer appear?
                  criteria:
                    - Calm, just stating facts
                    - Frustrated but civil
                    - Very angry, strong language
                is_urgent:
                  type: noul
                  instructions: The message conveys urgency or time sensitivity.
            schema:
              $ref: '#/components/schemas/SystemOneRequest'
      responses:
        '200':
          description: One answer per question.
          content:
            application/json:
              example:
                id: dec-6f1c0b9e2a7d4c3e
                object: structured_decision
                created: 1793577600
                model: d3-ultra
                answers:
                  department:
                    type: choice
                    choice: technical
                    probabilities:
                      billing: 0.21
                      technical: 0.78
                      sales: 0.01
                    confidence: 0.77
                  frustration:
                    type: score
                    score: 1.3
                    legend:
                      '0': Calm, just stating facts
                      '1': Frustrated but civil
                      '2': Very angry, strong language
                    probabilities:
                      '0': 0
                      '1': 0.7
                      '2': 0.3
                    confidence: 0.69
                  is_urgent:
                    type: noul
                    noul: 0.97
                    probabilities:
                      'yes': 0.97
                      'no': 0.03
                    confidence: 0.96
                usage:
                  input_tokens: 312
                  output_tokens: 0
                  input_tokens_details:
                    cached_tokens: 256
                diagnostics:
                  department:
                    label_mass: 0.99
                    argmax_is_label: true
                  frustration:
                    label_mass: 0.99
                    argmax_is_label: true
                  is_urgent:
                    label_mass: 0.99
                    argmax_is_label: true
              schema:
                $ref: '#/components/schemas/SystemOneResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Unknown `model`.
          content:
            application/json:
              example:
                error:
                  message: Unknown model 'gpt-5'; use one of ['d3-ultra'].
                  type: invalid_request_error
                  param: model
                  code: model_not_found
        '422':
          description: >-
            Images, audio and video are not accepted on this endpoint yet.
            `error.param` names the field.
          content:
            application/json:
              example:
                error:
                  message: >-
                    `images` is not supported on this endpoint yet; send a text
                    or JSON state.
                  type: invalid_request_error
                  param: images
                  code: null
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          description: The decision engine is unavailable. Retry with exponential backoff.
          content:
            application/json:
              example:
                error:
                  message: The decision engine is unavailable.
                  type: api_error
                  param: null
                  code: null
      security:
        - bearerAuth: []
components:
  schemas:
    SystemOneRequest:
      type: object
      properties:
        model:
          type: string
          description: '`d3-ultra`.'
          example: d3-ultra
        state:
          anyOf:
            - type: string
            - type: object
              additionalProperties:
                $ref: '#/components/schemas/SystemOneJsonValue'
            - type: array
              items:
                $ref: '#/components/schemas/SystemOneJsonValue'
          description: >-
            What the questions are about: text or JSON. Read once per request
            however many questions follow.
          example: >-
            Hi, I've been trying to connect my Stripe account for 3 days and it
            keeps failing. I'm losing sales. Please help ASAP.
        questions:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SystemOneQuestion'
          description: >-
            Named questions, asked in this order. The answer for each comes back
            under the same name.
          example:
            department:
              type: choice
              instructions: Which team should handle this?
              criteria:
                billing: Payment or subscription issues
                technical: Bugs or integration problems
                sales: Pricing or account questions
            frustration:
              type: score
              instructions: How frustrated does the customer appear?
              criteria:
                - Calm, just stating facts
                - Frustrated but civil
                - Very angry, strong language
            is_urgent:
              type: noul
              instructions: The message conveys urgency or time sensitivity.
        instructions:
          type: string
          description: Optional context placed ahead of the questions.
      required:
        - model
        - state
        - questions
      description: A state and the typed questions to answer about it.
      example:
        model: d3-ultra
        state: >-
          Hi, I've been trying to connect my Stripe account for 3 days and it
          keeps failing. I'm losing sales. Please help ASAP.
        questions:
          department:
            type: choice
            instructions: Which team should handle this?
            criteria:
              billing: Payment or subscription issues
              technical: Bugs or integration problems
              sales: Pricing or account questions
          frustration:
            type: score
            instructions: How frustrated does the customer appear?
            criteria:
              - Calm, just stating facts
              - Frustrated but civil
              - Very angry, strong language
          is_urgent:
            type: noul
            instructions: The message conveys urgency or time sensitivity.
    SystemOneResponse:
      type: object
      properties:
        id:
          type: string
          description: Decision id.
          example: dec-6f1c0b9e2a7d4c3e
        object:
          type: string
          enum:
            - structured_decision
        created:
          type: integer
          description: Unix seconds.
          example: 1793577600
        model:
          type: string
          description: The model that answered.
          example: d3-ultra
        answers:
          type: object
          additionalProperties:
            anyOf:
              - $ref: '#/components/schemas/SystemOneChoiceAnswer'
              - $ref: '#/components/schemas/SystemOneScoreAnswer'
              - $ref: '#/components/schemas/SystemOneNoulAnswer'
          description: One answer per question, under the name you gave it.
          example:
            department:
              type: choice
              choice: technical
              probabilities:
                billing: 0.21
                technical: 0.78
                sales: 0.01
              confidence: 0.77
            frustration:
              type: score
              score: 1.3
              legend:
                '0': Calm, just stating facts
                '1': Frustrated but civil
                '2': Very angry, strong language
              probabilities:
                '0': 0
                '1': 0.7
                '2': 0.3
              confidence: 0.69
            is_urgent:
              type: noul
              noul: 0.97
              probabilities:
                'yes': 0.97
                'no': 0.03
              confidence: 0.96
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
              description: Tokens of state and questions read.
              example: 312
            output_tokens:
              type: integer
              description: 'Always 0: nothing is generated.'
              example: 0
            input_tokens_details:
              type: object
              properties:
                cached_tokens:
                  type: integer
                  description: >-
                    Of `input_tokens`, those served from the prefix cache,
                    billed at the cached-input rate.
                  example: 256
              required:
                - cached_tokens
              description: Breakdown of the input tokens.
          required:
            - input_tokens
            - output_tokens
            - input_tokens_details
          description: Token accounting for the request.
        diagnostics:
          type: object
          additionalProperties:
            type: object
            properties:
              label_mass:
                type: number
                description: >-
                  Probability the model put on the answer labels, over its full
                  vocabulary. Low means the question or options read poorly to
                  the model.
              argmax_is_label:
                type: boolean
                description: Whether the single most likely token was one of the labels.
            required:
              - label_mass
              - argmax_is_label
          description: >-
            Per question, how much of the model's probability landed on the
            options.
          example:
            department:
              label_mass: 0.99
              argmax_is_label: true
            frustration:
              label_mass: 0.99
              argmax_is_label: true
            is_urgent:
              label_mass: 0.99
              argmax_is_label: true
      required:
        - id
        - object
        - created
        - model
        - answers
        - usage
        - diagnostics
      description: The answers and what they cost.
      example:
        id: dec-6f1c0b9e2a7d4c3e
        object: structured_decision
        created: 1793577600
        model: d3-ultra
        answers:
          department:
            type: choice
            choice: technical
            probabilities:
              billing: 0.21
              technical: 0.78
              sales: 0.01
            confidence: 0.77
          frustration:
            type: score
            score: 1.3
            legend:
              '0': Calm, just stating facts
              '1': Frustrated but civil
              '2': Very angry, strong language
            probabilities:
              '0': 0
              '1': 0.7
              '2': 0.3
            confidence: 0.69
          is_urgent:
            type: noul
            noul: 0.97
            probabilities:
              'yes': 0.97
              'no': 0.03
            confidence: 0.96
        usage:
          input_tokens: 312
          output_tokens: 0
          input_tokens_details:
            cached_tokens: 256
        diagnostics:
          department:
            label_mass: 0.99
            argmax_is_label: true
          frustration:
            label_mass: 0.99
            argmax_is_label: true
          is_urgent:
            label_mass: 0.99
            argmax_is_label: true
    SystemOneJsonValue:
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - type: 'null'
        - type: array
          items:
            anyOf:
              - type: string
              - type: number
              - type: boolean
              - type: 'null'
        - type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
              - type: 'null'
              - type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
                    - type: boolean
                    - type: 'null'
              - type: object
                additionalProperties:
                  anyOf:
                    - type: string
                    - type: number
                    - type: boolean
                    - type: 'null'
      description: 'Any JSON value: text, a number, a boolean, null, an array or an object.'
    SystemOneQuestion:
      anyOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - noul
            instructions:
              type: string
              description: The yes/no statement or question to evaluate.
            criteria:
              type: object
              properties:
                'true':
                  type: string
                  description: What makes the answer yes.
                'false':
                  type: string
                  description: What makes the answer no.
              description: Optional descriptions of the two outcomes.
          required:
            - type
            - instructions
          description: A yes/no question. The answer is the probability of yes.
        - type: object
          properties:
            type:
              type: string
              enum:
                - choice
            instructions:
              type: string
              description: The question the model answers by picking one option.
            criteria:
              type: object
              additionalProperties:
                type:
                  - string
                  - 'null'
              description: >-
                Option names mapped to their descriptions. A description may be
                null. Option names must be distinct.
              example:
                billing: Payment or subscription issues
                technical: Bugs or integration problems
          required:
            - type
            - instructions
            - criteria
          description: Pick one option from a defined set.
        - type: object
          properties:
            type:
              type: string
              enum:
                - score
            instructions:
              type: string
              description: What is being rated.
            criteria:
              type: array
              items:
                type: string
              minItems: 2
              maxItems: 10
              description: >-
                Ordered level descriptions, lowest first (2 to 10 levels).
                Levels are addressed by index in the answer.
              example:
                - Calm, just stating facts
                - Frustrated but civil
                - Very angry, strong language
          required:
            - type
            - instructions
            - criteria
          description: Rate the state against ordered levels.
      description: One typed question. `type` selects the variant.
      example:
        type: choice
        instructions: Which team should handle this?
        criteria:
          billing: Payment or subscription issues
          technical: Bugs or integration problems
          sales: Pricing or account questions
    SystemOneChoiceAnswer:
      type: object
      properties:
        type:
          type: string
          enum:
            - choice
        choice:
          type: string
          description: The option with the highest probability.
          example: technical
        probabilities:
          type: object
          additionalProperties:
            type: number
          description: A probability per option, summing to 1.
          example:
            billing: 0.21
            technical: 0.78
            sales: 0.01
        confidence:
          type: number
          description: >-
            The probability the model put on the answer it gave, measured over
            everything it could have produced at that position (the answer's
            share in `probabilities` times `diagnostics.<id>.label_mass`). 0 to
            1; never above the winning entry in `probabilities`.
          example: 0.77
      required:
        - type
        - choice
        - probabilities
        - confidence
      description: 'A choice answer: the winning option and the full distribution.'
      example:
        type: choice
        choice: technical
        probabilities:
          billing: 0.21
          technical: 0.78
          sales: 0.01
        confidence: 0.77
    SystemOneScoreAnswer:
      type: object
      properties:
        type:
          type: string
          enum:
            - score
        score:
          type: number
          description: >-
            Expected level: each level index times its probability, summed. 0 is
            the first level.
          example: 1.3
        legend:
          type: object
          additionalProperties:
            type: string
          description: Level index back to the description you sent.
          example:
            '0': Calm, just stating facts
            '1': Frustrated but civil
            '2': Very angry, strong language
        probabilities:
          type: object
          additionalProperties:
            type: number
          description: A probability per level, keyed by level index.
          example:
            '0': 0
            '1': 0.7
            '2': 0.3
        confidence:
          type: number
          description: >-
            The probability the model put on the answer it gave, measured over
            everything it could have produced at that position (the answer's
            share in `probabilities` times `diagnostics.<id>.label_mass`). 0 to
            1; never above the winning entry in `probabilities`. The answer here
            is the most likely level.
          example: 0.69
      required:
        - type
        - score
        - legend
        - probabilities
        - confidence
      description: >-
        A score answer: the expected level, the distribution over levels and the
        legend.
      example:
        type: score
        score: 1.3
        legend:
          '0': Calm, just stating facts
          '1': Frustrated but civil
          '2': Very angry, strong language
        probabilities:
          '0': 0
          '1': 0.7
          '2': 0.3
        confidence: 0.69
    SystemOneNoulAnswer:
      type: object
      properties:
        type:
          type: string
          enum:
            - noul
        noul:
          type: number
          description: The probability that the answer is yes, 0 to 1.
          example: 0.97
        probabilities:
          type: object
          properties:
            'yes':
              type: number
            'no':
              type: number
          required:
            - 'yes'
            - 'no'
          description: The probabilities of yes and no, summing to 1.
          example:
            'yes': 0.97
            'no': 0.03
        confidence:
          type: number
          description: >-
            The probability the model put on the answer it gave, measured over
            everything it could have produced at that position (the answer's
            share in `probabilities` times `diagnostics.<id>.label_mass`). 0 to
            1; never above the winning entry in `probabilities`. The answer here
            is the more likely of yes and no.
          example: 0.96
      required:
        - type
        - noul
        - probabilities
        - confidence
      description: 'A noul answer: the probability of yes.'
      example:
        type: noul
        noul: 0.97
        probabilities:
          'yes': 0.97
          'no': 0.03
        confidence: 0.96
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_request_error
              description: Machine-readable error code.
            message:
              type: string
              example: The request body is missing the `model` field.
              description: Human-readable explanation of the failure.
          required:
            - code
            - message
      required:
        - error
      description: Standard error envelope returned by every non-2xx response.
      example:
        error:
          code: invalid_request_error
          message: The request body is missing the `model` field.
  responses:
    BadRequest:
      description: Malformed request — missing or invalid fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request_error
              message: The request body is missing the `model` field.
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Invalid API key provided.
    RateLimited:
      description: Rate limited — retry after the interval in the Retry-After header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Too many requests. Retry in 12 seconds.
    InternalError:
      description: Internal error — safe to retry with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: internal_error
              message: Something went wrong on our side.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: >-
        Morph API key, passed as `Authorization: Bearer sk-...`. Create keys at
        https://www.morphllm.com/dashboard/api-keys.

````

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