Skip to main content
A decision model answers questions about a piece of context with probabilities instead of generated text. You send the context, called the state, and a set of named questions. Each answer comes back as a probability, one of your options or a score, so you can route, classify and triage without parsing a chat model’s output. Decision models use the System One API, not the OpenAI API. A client written for another System One host only needs our base URL, a Lyceum API key and one of the model IDs below.

Models

Try both on a few of your own labelled examples and keep the cheaper one if its answers are good enough.

Endpoint and authentication

Authenticate with your Lyceum API key (lk_...) as a Bearer token, the same key you use for chat.
The endpoint isn’t under /openai/v1. If your app already uses https://api.lyceum.technology/openai/v1 for chat, send decisions to https://api.lyceum.technology/v1/systemone instead. The OpenAI SDKs have no System One client, so send a plain HTTP request.

Quickstart

The response has exactly three fields: the model, the answers keyed by your question names, and the token usage:
There’s no streaming. Each request returns one JSON object.

Request fields

Every question has a type and instructions, the question itself in plain words. Give every question non-empty instructions.

Question types

A score answer can be a decimal. With 3 levels it lies between 0 and 2: probabilities of 0.1, 0.7 and 0.2 give a score of 1.1.

Ask several questions at once

All questions in a request are about the same state, so you pay for the state once. This example sends a JSON record and asks one question of each type:
The answers come back under the question names. Values are shortened to 4 decimals here:

Use the answers

  • Set thresholds from your own data. Run a set of labelled examples and pick the noul cut-off where the cost of a wrong yes and a wrong no balance for your use case. A spam filter and a fraud alert need different cut-offs.
  • Act on confidence. Send answers with low confidence to a person or a fallback path, and act automatically on the rest.
  • Read the full distribution when it matters. Two close probabilities tell you the state fits both options, which a single label hides.

Write good questions

  • Ask about something the state shows, such as “Does the message mention a refund?”, rather than something the model has to guess.
  • Give options and levels labels that don’t overlap, and describe each one in its value.
  • Add a fallback option such as other to every choice question, so a state that fits no option has somewhere to go.
  • Name questions with letters, digits, ., _ and - only.

Limits

A request over a limit gets a 413 or 422 error, see Errors.

Pricing

Decision models bill input tokens only: the usage.input_tokens of each response. Output tokens are free, and a request that ends in an error isn’t billed. Your organization needs credit, the same as for chat.

Errors

Errors use this shape:
Branch on error.code in the body, not on message: The decision models work only on this endpoint. Sending one to /openai/v1/chat/completions returns a 400.

Coming from the OpenAI Decisions API

The question types match, but the request and the answers have a different shape:

Serverless inference

Chat and embeddings with the same API key.

API keys

Create the key you send as the Bearer token.