Skip to main content
Decisions answers structured questions about a piece of context. You send a state and a set of typed questions. You get one probability distribution per question. The current catalogue exposes one decision model: dgemma. Decisions runs in Zero Data Retention mode. Your content is plaintext at the Prem API Gateway and at the partner. There is no client-side encryption and no attestation. See ZDR overview and ZDR security boundary.

Basic decision

Ask a routing question about an incident:
The response carries one answer per question id:
choice is the most likely label. probabilities holds one value per criterion key. confidence rescales the top probability against a uniform distribution. It is not a calibrated correctness estimate.

Question types

Each question declares a type and a criteria shape that matches the type.

choice

Pick one label from a named list. criteria maps each label to a description. The list holds 1 to 26 entries.

noul

Answer yes or no. The answer is a single probability. criteria is optional and can name the two outcomes.
The answer shape is a scalar in noul:
Do not read probabilities for a noul question. That field is not part of this answer.

score

Rate on an ordered scale. criteria lists the levels in ascending order, from 2 to 10 levels.
The answer carries score, legend, probabilities, and confidence. The score is the probability-weighted mean over the zero-indexed levels.

Several questions in one request

Each question is independent. One request can carry up to 16 questions. The questions share the state, and each returns its own distribution.
Questions cannot read one another. There is no shared prefix across questions in a request, and one question cannot use the answer to another. Ask a follow-up request if a later question depends on an earlier answer.

Image input

Send one image as a base64 data URL in images. The image is placed ahead of the state.

Video input

Send one MP4 as a base64 data URL in videos. This is a dgemma extension and is not part of the base request shape.
The clip must be at most 10 MiB, 30 seconds, and 1920 x 1080 pixels. Four frames are sampled. Audio is not processed. Use images or videos, not both in one request. Use a raw JSON request if your HTTP client does not expose the field.

Response shape

The response contains:
  • model, the resolved model name;
  • answers, one entry per question id, with type, the answer, and the distribution;
  • usage, with input_tokens and output_tokens;
  • diagnostics, engine detail for the call.
Read answers keyed by your own question ids. diagnostics is informational and can change without notice.
The values in probabilities are normalized scores over the supplied labels. They are not calibrated correctness estimates, and label order can change the prediction. See Current limits.

Request with the TypeSafe SDK

Decisions uses a TypeSafe-compatible API, so the official TypeSafe client works against this route. Install it and point the base URL at https://gateway.prem.io/typesafe.
The choice, noul, and score helpers build the typed questions and validate them before the request is sent. state accepts any JSON value, so an object such as { document: "..." } works as well as a string. The client throws a TypeSafeError on an invalid key and a BadRequestError when the server rejects the request, for example when a request carries more than 16 questions.

Request with the standard library

Decisions is not the OpenAI Chat Completions shape, so an OpenAI client does not work against this route. Any HTTP client can send the JSON directly:

Current limits

  • The route is non-streaming. stream is not supported.
  • Up to 16 questions per request. Up to 4 concurrent requests per key before a 429.
  • choice holds 1 to 26 criteria. score holds 2 to 10 levels.
  • At most one image or one video per request, not both.
  • Questions are independent and cannot read one another.
  • Probabilities are not calibrated. On a public benchmark slice, 8 of 113 answers above a 0.99 top-probability threshold were wrong, and reversing the order of the criteria changed 17 of 139 predictions. Do not use confidence as a correctness guarantee.
  • The route runs in ZDR mode. There is no client-side encryption and no attestation. See ZDR vs Confidential.
  • Verify a production input format with your own representative fixture before rollout.

Next steps

Decisions API reference

The full request and response reference.

ZDR overview

What ZDR guarantees and what it does not.

Models & Pricing

The models, the prices, and the regions.

ZDR vs Confidential

Which mode fits your workload.