API reference
Decisions
The same System One read in OpenAI's Decisions format. Point an OpenAI SDK at Codiv and call decisions.create.
Create a decision
POST https://api.codiv.ai/v1/decisionsTakes OpenAI's Decisions API request and answers it with the same read as /v1/systemone: the same questions get the same answers. Authenticate with Authorization: Bearer <key>. Usage counts toward your System One quota.
Request body
modelstringRequiredAny System One model: openjev-latest, or any id from List models. OpenAI's own model names answer 400.
inputstring or arrayRequiredWhat the questions are about: a string, or user messages whose content is a string or a list of input_text and input_image parts. Texts are joined with blank lines. An input_image must be a data:image/…;base64, URL; hosted URLs and file_id aren't supported. Images have the same limits as on /v1/systemone, and only openjev-latest and clef-flash-1.0 take them.
questionsarrayRequiredThe questions, answered in this order.
Question object properties
type"predicate", "choice" or "score"Requiredpredicate is a yes/no question (a noul on /v1/systemone).
namestringOptionalReturned with the answer. Names must be unique, and the model never sees them.
instructionsstringOptionalWhat to decide about the input.
choicesarray[{"value": ..., "description": ...}], 1 to 255 options (24 on verdict-1.4). A value is a string or a boolean.
levelsarray[{"label": ..., "description": ...}], 2 to 10 levels ordered from lowest to highest. The model reads each level as label: description.
The OpenJev read options steps, samples, think and sequential work here too.
Returns
A decision object. Errors use OpenAI's {"error": {"message", "type", "param", "code"}}.
from openai import OpenAI
client = OpenAI(base_url="https://api.codiv.ai/v1", api_key="sk-codiv-...")
d = client.decisions.create(
model="openjev-latest",
input="Hi, my Stripe connection keeps failing with a 403 and we launch tomorrow.",
questions=[
{"type": "predicate", "name": "is_urgent", "instructions": "The message conveys urgency"},
{"type": "choice", "name": "department", "instructions": "Which team should handle this",
"choices": [{"value": "billing", "description": "Payment or subscription issues"},
{"value": "technical", "description": "Bugs or integration problems"},
{"value": "sales", "description": "Pricing or account questions"}]},
{"type": "score", "name": "frustration", "instructions": "How frustrated the customer appears",
"levels": [{"label": "calm"}, {"label": "frustrated"}, {"label": "angry"}]},
],
)
print(d.answers[1].choice) # "technical"curl https://api.codiv.ai/v1/decisions \
-H "Authorization: Bearer $CODIV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openjev-latest",
"input": "Hi, my Stripe connection keeps failing with a 403 and we launch tomorrow.",
"questions": [
{"type": "predicate", "name": "is_urgent", "instructions": "The message conveys urgency"},
{"type": "choice", "name": "department", "instructions": "Which team should handle this",
"choices": [{"value": "billing"}, {"value": "technical"}, {"value": "sales"}]}
]
}'The decision object
modelstringThe exact model version that answered, for example openjev-0.1.
answersarrayOne answer per question, in question order, each with the question's name when it has one.
predicate answer
probabilitynumberProbability of yes, between 0 and 1.
choice answer
choicestring or booleanThe most likely value.
probabilitiesarray[{"value", "probability"}] for every option, in the order you sent them. The probabilities sum to 1.
confidencenumber1 − H(p)/ln K: 1 when certain and 0 when uniform. See Probabilities & confidence.
score answer
scorenumberThe expected level, Σ i·pᵢ, with levels numbered from 0.
probabilitiesarray[{"value", "label", "probability"}] for every level.
confidencenumberAs for choice.
usageobjectinput_tokens counts against your quota, and so does output_tokens, which is 0 unless you set think. Cached tokens are always 0.
{"model": "openjev-0.1",
"answers": [
{"type": "predicate", "name": "is_urgent", "probability": 0.9974},
{"type": "choice", "name": "department", "choice": "technical",
"probabilities": [{"value": "billing", "probability": 0.0016},
{"value": "technical", "probability": 0.9979},
{"value": "sales", "probability": 0.0004}],
"confidence": 0.9856}],
"usage": {"input_tokens": 120, "output_tokens": 0, "total_tokens": 120,
"input_tokens_details": {"cached_tokens": 0, "cache_write_tokens": 0},
"output_tokens_details": {"reasoning_tokens": 0}}}System One models never refuse a question, so no answer is a refusal.