POST /v1/systemone

The TypeSafe System One shape. Instead of an input and an array of questions, you send a state and a keyed questions object; answers come back keyed by the same names. It carries exactly the same information as /v1/decisions — pick whichever shape matches your existing client.

POST /v1/systemone
Authorization: Bearer shrug_sk_your_key_here
Content-Type: application/json

Question types

| type | Shape | Answer field | |---|---|---| | choice | criteria: { name: description } | choice + probabilities{} | | noul | instructions | noul (p of true) | | score | criteria: [label, …] | score (index) + probabilities[] |

Note the TypeSafe predicate type is noul (the System One name), the analogue of the predicate type on /v1/decisions. The optional shrug.distributions block works identically — see the density extension.

Request

The canonical request fixture. questions is an object keyed by question name, and criteria carries the choice/score labels:

{
  "model": "system-one",
  "state": "the sky at noon",
  "questions": {
    "color": { "type": "choice", "instructions": "pick a color",
      "criteria": { "red": "warm", "blue": "cool", "green": "earthy" } },
    "is_daytime": { "type": "noul", "instructions": "is it day?" },
    "brightness": { "type": "score", "instructions": "how bright",
      "criteria": ["dim", "bright"] }
  },
  "shrug": {
    "distributions": {
      "color": { "weights": { "red": 0.5, "blue": 0.3, "green": 0.2 } },
      "is_daytime": { "p_true": 0.7 }
    }
  }
}

Response

answers is keyed by question name. A choice returns the drawn choice with a probabilities object and confidence; a noul returns a noul probability; a score returns the drawn score index with a legend and a positional probabilities array.

{
  "model": "system-one",
  "answers": {
    "color": { "type": "choice", "choice": "red", "confidence": 0.5,
      "probabilities": { "red": 0.5, "blue": 0.3, "green": 0.2 } },
    "is_daytime": { "type": "noul", "noul": 0.7 },
    "brightness": { "type": "score", "score": 1, "confidence": 0.6,
      "legend": ["dim", "bright"],
      "probabilities": [0.4, 0.6] }
  },
  "usage": { "input_tokens": 0, "output_tokens": 0 }
}