Skip to main content
POST
Answer typed questions about a state
For a step-by-step image example, see Reflex.

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. Reflex 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), optional inline images, and a map of named questions of three types. Every answer is a distribution over the options you gave. Model: reflex, Morph’s decision model, trained to read a state and answer typed questions about it. Requests sent as d3-ultra, its launch name, still work.

Images

Send images as an array of inline base64 data URLs (data:image/jpeg;base64,...). PNG, JPEG and WebP are accepted. The request may contain at most 16 images total, with at most 8,000,000 decoded bytes per image. Remote URLs are not fetched. Alternatively, include {"type":"image_url","image_url":{"url":"data:image/jpeg;base64,..."}} parts inside state. Image parts belong in the state, not in a question’s instructions or criteria. Image tokens count toward input usage and the context limit.

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 the total probability on the answer labels, 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.
  • When returned, 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 sums the state plus each question, including expanded image tokens. 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.002 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: unsupported media, including remote image URLs, audio, video, and images inside questions.
  • 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 reflex.

Authorizations

Authorization
string
header
required

Morph API key, passed as Authorization: Bearer sk-.... Create keys at https://www.morphllm.com/dashboard/api-keys.

Body

application/json

The state and the questions to answer about it.

A state and the typed questions to answer about it.

model
string
required

reflex.

Example:

"reflex"

state
required

What the questions are about: text or JSON. Image content parts may appear here with type image_url and image_url.url set to an inline base64 data URL. Input usage includes the state for each question.

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
object
required

Named questions, asked in this order. The answer for each comes back under the same name.

Example:
images
string[]

Inline base64 data URLs: data:image/png;base64,..., data:image/jpeg;base64,... or data:image/webp;base64,... . At most 16 images total across the request, up to 8 MB (8,000,000 decoded bytes) each. Remote URLs are not fetched. Images are billed as expanded input tokens.

Maximum array length: 16
instructions
string

Optional context placed ahead of the questions.

Response

One answer per question.

The answers and what they cost.

model
string
required

The model that answered.

Example:

"reflex"

answers
object
required

One answer per question, under the name you gave it.

Example:
usage
object
required

Token accounting for the request.

id
string

Decision id, when returned.

Example:

"dec-6f1c0b9e2a7d4c3e"

object
enum<string>
Available options:
structured_decision
created
integer

Unix seconds, when returned.

Example:

1793577600

diagnostics
object

When returned: per question, how much of the model's probability landed on the options.

Example: