POST /v1/systemone
Answer one or more questions about a state.
POST https://api.openinstinct.dev/v1/systemoneRequest body
| Field | Type | |
|---|---|---|
state | string, object, array, number, boolean | Required. What the model should know. May hold images |
questions | object | Required. At least one question; the keys are your names for them |
model | string | Optional. A name from GET /v1/models. Without it the default model answers |
A question
| Field | Type | |
|---|---|---|
type | "noul", "choice", "score" | Required |
instructions | any JSON value | The question. Usually a string |
criteria | see below | The possible answers |
type | criteria |
|---|---|
noul | Optional. An object with the keys true and false: what counts as yes, what counts as no |
choice | Required. An object of 1 to 255 options: name → description |
score | Required. 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 | |
|---|---|
model | The model that answered |
answers | One answer per question, under the question's name |
usage.input_tokens | Tokens of the state and the questions, image tokens included |
usage.image_tokens | Tokens of the images. Present only when the request had images |
usage.output_tokens | Tokens of the serialised answers. A billing figure: nothing is generated |
latency_ms | The model's time for the request |
An answer
type | Fields |
|---|---|
noul | noul: the probability of yes |
choice | choice: the most likely option. probabilities: by option name. confidence: 0 to 1 |
score | score: 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.