openinstinctdocs

POST /v1/systemone

Answer one or more questions about a state.

POST https://api.openinstinct.dev/v1/systemone

Request body

FieldType
statestring, object, array, number, booleanRequired. What the model should know. May hold images
questionsobjectRequired. At least one question; the keys are your names for them
modelstringOptional. A name from GET /v1/models. Without it the default model answers

A question

FieldType
type"noul", "choice", "score"Required
instructionsany JSON valueThe question. Usually a string
criteriasee belowThe possible answers
typecriteria
noulOptional. An object with the keys true and false: what counts as yes, what counts as no
choiceRequired. An object of 1 to 255 options: name → description
scoreRequired. A list of 1 to 255 level descriptions, lowest first

Details and examples of each: Question types.

An image

{
  "type": "image",
  "source": { "type": "base64", "media_type": "image/png", "data": "<base64>" },
  "max_pixels": 1048576
}

Allowed in the state only. See Images.

Example

curl https://api.openinstinct.dev/v1/systemone \
  -H "Authorization: Bearer $OPENINSTINCT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "instinct-one-latest",
    "state": {
      "channel": "email",
      "message": "The export button on the reports page threw an error twice today. Not asking for a refund, I just want it fixed."
    },
    "questions": {
      "team": {
        "type": "choice",
        "instructions": "Which team should handle this ticket?",
        "criteria": {
          "billing": "Payments, invoices, refunds, subscriptions.",
          "technical": "Bugs, errors, outages, integration problems.",
          "sales": "Pricing questions, upgrades, new purchases.",
          "other": "Anything that fits none of the above."
        }
      },
      "wants_refund": {
        "type": "noul",
        "instructions": "Is the customer asking for a refund?"
      }
    }
  }'

Response

200 OK. The numbers below show the shape, not a real run.

{
  "model": "instinct-one-latest",
  "answers": {
    "team": {
      "type": "choice",
      "choice": "technical",
      "confidence": 0.9467,
      "probabilities": { "billing": 0.021, "technical": 0.96, "sales": 0.008, "other": 0.011 }
    },
    "wants_refund": { "type": "noul", "noul": 0.0213 }
  },
  "usage": { "input_tokens": 131, "output_tokens": 64 },
  "latency_ms": 97
}
Field
modelThe model that answered
answersOne answer per question, under the question's name
usage.input_tokensTokens of the state and the questions, image tokens included
usage.image_tokensTokens of the images. Present only when the request had images
usage.output_tokensTokens of the serialised answers. A billing figure: nothing is generated
latency_msThe model's time for the request

An answer

typeFields
noulnoul: the probability of yes
choicechoice: the most likely option. probabilities: by option name. confidence: 0 to 1
scorescore: the expected level, from 0. probabilities: by level index. legend: the levels. confidence: 0 to 1

Errors

A request that is not valid is refused before it reaches the model, with 400 or 422 and the code invalid_request; the message says what is wrong. All codes: Errors.

On this page