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

Endpoint
POST https://api.codiv.ai/v1/decisions

Takes 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

modelstringRequired

Any System One model: openjev-latest, or any id from List models. OpenAI's own model names answer 400.

inputstring or arrayRequired

What 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.

questionsarrayRequired

The questions, answered in this order.

Question object properties
type"predicate", "choice" or "score"Required

predicate is a yes/no question (a noul on /v1/systemone).

namestringOptional

Returned with the answer. Names must be unique, and the model never sees them.

instructionsstringOptional

What 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"

The decision object

modelstring

The exact model version that answered, for example openjev-0.1.

answersarray

One answer per question, in question order, each with the question's name when it has one.

predicate answer
probabilitynumber

Probability of yes, between 0 and 1.

choice answer
choicestring or boolean

The most likely value.

probabilitiesarray

[{"value", "probability"}] for every option, in the order you sent them. The probabilities sum to 1.

confidencenumber

1 − H(p)/ln K: 1 when certain and 0 when uniform. See Probabilities & confidence.

score answer
scorenumber

The expected level, Σ i·pᵢ, with levels numbered from 0.

probabilitiesarray

[{"value", "label", "probability"}] for every level.

confidencenumber

As for choice.

usageobject

input_tokens counts against your quota, and so does output_tokens, which is 0 unless you set think. Cached tokens are always 0.

Decision
{"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.