Singleshot API
Typed decisions: send a state and named questions, get a calibrated 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. 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.
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:
Reading answers
probabilitiessum to 1 per question.choiceis the argmax;scoreis 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. Forchoiceit is one minus the normalized entropy: 1.0 when all the mass is on one option, 0.0 when it is spread evenly. Forscoreit 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
noulanswer has noconfidence; the probability is the whole answer, and you threshold it. usage.input_tokensis the state plus the questions, read once.usage.output_tokensis the number of scored positions, one per question.
Limits and errors
stateup 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.paramnames the field, for examplequestions.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, honoringRetry-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
Morph API key, passed as Authorization: Bearer sk-.... Create keys at https://www.morphllm.com/dashboard/api-keys.
Body
The state and the questions to answer about it.
A state and the typed questions to answer about it.
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.
"Hi, I've been trying to connect my Stripe account for 3 days and it keeps failing. I'm losing sales. Please help ASAP."
morph-systemone-v1, or the alias systemone-latest.
"morph-systemone-v1"
Named questions (1 to 256). The answer for each comes back under the same name.