Skip to main content
POST
Answer typed questions about a state

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. Singleshot skips the generation: the model reads the state once and reports the probability of every option for every question in one forward pass per question, so your code branches on numbers. POST /v1/singleshot takes a state (text, a JSON object or an array of text) and a map of named questions of three types. Every answer is a distribution over the options you gave. Model: morph-systemone-v1, alias systemone-latest.

Writing questions

instructions is what you want judged. criteria describes the options: for choice a map of option name to description, 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. Instructions and descriptions accept JSON structure as well as strings. When a question has parts, an object with labelled keys reads better than a sentence that tries to hold them all:
Ask every question about one state in one call. The state is read once and charged once however many questions follow; the questions are short extensions of it.

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) summarizes the shape of the distribution. For choice it is one minus the normalized entropy: 1.0 when all the mass is on one option, 0.0 when it is spread evenly. For score it is one minus the normalized standard deviation of the level: 1.0 when the mass sits on one level, 0.0 when it is split between the two ends. Gate actions on it: act automatically above a threshold you choose per action, route to a person below it.
  • A noul answer has no confidence; the probability is the whole answer, and you threshold it.
  • usage.input_tokens is the state plus the questions, read once. usage.output_tokens is the number of scored positions, one per question.
Measured on public benchmarks with this exact mechanism and no task-specific training: sentiment (2 options) 0.960, question classification (6) 0.915, intent (7) 0.956 accuracy, with expected calibration error under 0.04 after label-free calibration.

Limits and errors

  • state up to 32,768 tokens; state plus the longest question up to 32,768 tokens; a request up to 65,536 tokens; up to 256 questions.
  • 422: the request does not fit the contract. error.param names the field, for example questions.department.criteria.
  • 401: missing or invalid key. 429: your key’s rate limit. 529: the engine is at capacity. The request was not queued; retry with exponential backoff, honoring Retry-After.
  • Every response carries x-request-id.

Switching from another typed-decision API

If you already send {state, model, questions} with noul, choice and score questions, the bodies are the same here. Change four things: the base URL to https://api.morphllm.com, the key to a Morph key, the path to /v1/singleshot, and model to morph-systemone-v1. Answers come back in the same shapes.

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.

state
required

What the questions are about: text, a JSON object, or an array of text. Up to 32,768 tokens. Charged 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."

model
string
required

morph-systemone-v1, or the alias systemone-latest.

Example:

"morph-systemone-v1"

questions
object
required

Named questions (1 to 256). The answer for each comes back under the same name.

Example:

Response

One answer per question.

The answers and what they cost.

model
string
required

The model that answered.

Example:

"morph-systemone-v1"

answers
object
required

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

Example:
usage
object
required

Token accounting for the request.