# Codiv developer platform

> Codiv runs open System One models. They answer typed questions about your data with a calibrated probability for every option, in milliseconds, instead of generating text.

Source: https://codiv.ai/docs

You send a **state**, such as a support ticket, a log line, a document or any JSON, together with questions of three types: **noul** (yes/no), **choice** (pick a label) and **score** (a point on a scale). Codiv returns the full distribution for each question, so you can route, filter and escalate on thresholds you choose. The first model on Codiv is [OpenJev](https://codiv.ai/docs/models.md), which is open weights and open source.

- [Quickstart](https://codiv.ai/docs/quickstart.md): Make your first request in under five minutes.
- [Writing questions](https://codiv.ai/docs/guides/questions.md): noul, choice and score, and how to phrase them.
- [API reference](https://codiv.ai/docs/api-reference/system-one.md): Every field of `POST /v1/systemone`.
- [Coming from Jev?](https://codiv.ai/docs/guides/jev-compatibility.md): Keep your SDK and change one URL.

## A first request

curl:

```bash
curl https://api.codiv.ai/v1/systemone \
  -H "Authorization: Bearer $TYPESAFE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openjev-latest",
    "state": "Hi, my Stripe connection keeps failing with a 403 and we launch tomorrow.",
    "questions": {
      "department": {
        "type": "choice",
        "instructions": "Which team should handle this",
        "criteria": {
          "billing": "Payment or subscription issues",
          "technical": "Bugs or integration problems",
          "sales": "Pricing or account questions"
        }
      },
      "frustration": {
        "type": "score",
        "instructions": "How frustrated the customer appears",
        "criteria": ["Calm, just stating facts", "Frustrated but civil", "Very angry, strong language"]
      },
      "is_urgent": {"type": "noul", "instructions": "The message conveys urgency"}
    }
  }'
```

Python:

```python
from typesafe_sdk import Choice, Noul, Score, TypeSafeClient

# Reads TYPESAFE_API_KEY and TYPESAFE_BASE_URL=https://api.codiv.ai
client = TypeSafeClient()

response = client.system_one(
    "Hi, my Stripe connection keeps failing with a 403 and we launch tomorrow.",
    {
        "department": Choice(
            instructions="Which team should handle this",
            criteria={
                "billing": "Payment or subscription issues",
                "technical": "Bugs or integration problems",
                "sales": "Pricing or account questions",
            },
        ),
        "frustration": Score(
            instructions="How frustrated the customer appears",
            criteria=["Calm, just stating facts", "Frustrated but civil", "Very angry, strong language"],
        ),
        "is_urgent": Noul(instructions="The message conveys urgency"),
    },
    model="openjev-latest",
)

print(response.choices["department"].choice)   # "technical"
print(response.scores["frustration"].score)     # 1.0
print(response.nouls["is_urgent"].noul)        # 1.0
```

TypeScript:

```ts
import { TypeSafeClient, choice, noul, score } from "@typesafe-ai/sdk";

// Reads TYPESAFE_API_KEY; baseURL can also come from TYPESAFE_BASE_URL
const client = new TypeSafeClient({ baseURL: "https://api.codiv.ai" });

const response = await client.systemOne({
  model: "openjev-latest",
  state: "Hi, my Stripe connection keeps failing with a 403 and we launch tomorrow.",
  questions: {
    department: choice("Which team should handle this", {
      billing: "Payment or subscription issues",
      technical: "Bugs or integration problems",
      sales: "Pricing or account questions",
    }),
    frustration: score("How frustrated the customer appears", [
      "Calm, just stating facts",
      "Frustrated but civil",
      "Very angry, strong language",
    ]),
    is_urgent: noul("The message conveys urgency"),
  },
});

console.log(response.answers.department.choice); // "technical"
```

Response:

```json
{
  "model": "openjev-0.1",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "technical",
      "probabilities": {"billing": 0.0, "technical": 1.0, "sales": 0.0},
      "confidence": 1.0
    },
    "frustration": {
      "type": "score",
      "score": 1.0,
      "legend": {"0": "Calm, just stating facts", "1": "Frustrated but civil", "2": "Very angry, strong language"},
      "probabilities": {"0": 0.0, "1": 1.0, "2": 0.0},
      "confidence": 0.97
    },
    "is_urgent": {"type": "noul", "noul": 1.0}
  },
  "usage": {"input_tokens": 175, "output_tokens": 0}
}
```

## When to use a System One model

- **Classification and routing**, like triage, moderation, intent or topic, when you need a label and a probability rather than prose.
- **Many decisions per item.** Ask dozens of questions about one state in a single request; they are answered in parallel.
- **Hot paths.** A request with a few questions typically finishes in under 100 ms of model time.
- **Calibrated thresholds.** Every answer is a distribution, so you decide how sure is sure enough.

Use a generative model when the output itself is text, such as drafting a reply. A common pattern pairs the two: the System One model decides *whether* and *where* something should go, and a generative model writes.

## For AI assistants

Every docs page is also available as Markdown: add `.md` to its URL, for example [/docs/quickstart.md](https://codiv.ai/docs/quickstart.md). An index of all pages is at [/llms.txt](https://codiv.ai/llms.txt), and the whole documentation in one file is at [/llms-full.txt](https://codiv.ai/llms-full.txt).

---

# Developer quickstart

> Create a key, install an SDK and make your first System One request.

Source: https://codiv.ai/docs/quickstart

## 1. Create an API key

[Sign up](https://codiv.ai/signup) with Google, GitHub or email, then open the [dashboard](https://codiv.ai/dashboard) and create a key. Every account starts with **100M free input tokens**. The key is shown only once, so store it somewhere safe, then export it along with the base URL:

Shell:


```bash
export TYPESAFE_API_KEY="sk-codiv-..."
export TYPESAFE_BASE_URL="https://api.codiv.ai"
```

> **Note: Why TYPESAFE_*?.**
> Codiv speaks the same wire format as TypeSafe's Jev, so TypeSafe's official SDKs work unchanged. They read these two variables.

## 2. Install an SDK

Python:

```bash
pip install typesafe-sdk
```

TypeScript:

```bash
npm install @typesafe-ai/sdk
```

curl:

```bash
# nothing to install
```

## 3. Make a request

This asks three questions about one support message:

curl:

```bash
curl https://api.codiv.ai/v1/systemone \
  -H "Authorization: Bearer $TYPESAFE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openjev-latest",
    "state": "Hi, my Stripe connection keeps failing with a 403 and we launch tomorrow.",
    "questions": {
      "department": {
        "type": "choice",
        "instructions": "Which team should handle this",
        "criteria": {
          "billing": "Payment or subscription issues",
          "technical": "Bugs or integration problems",
          "sales": "Pricing or account questions"
        }
      },
      "frustration": {
        "type": "score",
        "instructions": "How frustrated the customer appears",
        "criteria": ["Calm, just stating facts", "Frustrated but civil", "Very angry, strong language"]
      },
      "is_urgent": {"type": "noul", "instructions": "The message conveys urgency"}
    }
  }'
```

Python:

```python
from typesafe_sdk import Choice, Noul, Score, TypeSafeClient

# Reads TYPESAFE_API_KEY and TYPESAFE_BASE_URL=https://api.codiv.ai
client = TypeSafeClient()

response = client.system_one(
    "Hi, my Stripe connection keeps failing with a 403 and we launch tomorrow.",
    {
        "department": Choice(
            instructions="Which team should handle this",
            criteria={
                "billing": "Payment or subscription issues",
                "technical": "Bugs or integration problems",
                "sales": "Pricing or account questions",
            },
        ),
        "frustration": Score(
            instructions="How frustrated the customer appears",
            criteria=["Calm, just stating facts", "Frustrated but civil", "Very angry, strong language"],
        ),
        "is_urgent": Noul(instructions="The message conveys urgency"),
    },
    model="openjev-latest",
)

print(response.choices["department"].choice)   # "technical"
print(response.scores["frustration"].score)     # 1.0
print(response.nouls["is_urgent"].noul)        # 1.0
```

TypeScript:

```ts
import { TypeSafeClient, choice, noul, score } from "@typesafe-ai/sdk";

// Reads TYPESAFE_API_KEY; baseURL can also come from TYPESAFE_BASE_URL
const client = new TypeSafeClient({ baseURL: "https://api.codiv.ai" });

const response = await client.systemOne({
  model: "openjev-latest",
  state: "Hi, my Stripe connection keeps failing with a 403 and we launch tomorrow.",
  questions: {
    department: choice("Which team should handle this", {
      billing: "Payment or subscription issues",
      technical: "Bugs or integration problems",
      sales: "Pricing or account questions",
    }),
    frustration: score("How frustrated the customer appears", [
      "Calm, just stating facts",
      "Frustrated but civil",
      "Very angry, strong language",
    ]),
    is_urgent: noul("The message conveys urgency"),
  },
});

console.log(response.answers.department.choice); // "technical"
```

## 4. Read the answers

Answers are keyed by the ids you chose. `choice` and `score` answers carry the full probability distribution and a `confidence` between 0 and 1. `noul` answers are the probability of yes.

Response:

```json
{
  "model": "openjev-0.1",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "technical",
      "probabilities": {"billing": 0.0, "technical": 1.0, "sales": 0.0},
      "confidence": 1.0
    },
    "frustration": {
      "type": "score",
      "score": 1.0,
      "legend": {"0": "Calm, just stating facts", "1": "Frustrated but civil", "2": "Very angry, strong language"},
      "probabilities": {"0": 0.0, "1": 1.0, "2": 0.0},
      "confidence": 0.97
    },
    "is_urgent": {"type": "noul", "noul": 1.0}
  },
  "usage": {"input_tokens": 175, "output_tokens": 0}
}
```

Only `usage.input_tokens` counts toward your quota. The dashboard shows it within seconds of each request.

## Next steps

- [Write better questions](https://codiv.ai/docs/guides/questions.md) with instructions and criteria.
- [Use probabilities and confidence](https://codiv.ai/docs/guides/confidence.md) to set thresholds.
- Browse the [API reference](https://codiv.ai/docs/api-reference/system-one.md).

---

# Models

> Codiv serves open System One models. Each has open weights and an open-source server, so you can always run it yourself.

Source: https://codiv.ai/docs/models

## OpenJev

OpenJev turns [DiffusionGemma 26B-A4B](https://huggingface.co/nvidia/diffusiongemma-26B-A4B-it-NVFP4), a discrete diffusion language model, into a System One model. It writes the answer template onto the model's canvas, leaves only the answer slots as noise and reads a probability distribution for every slot from a single denoising step. There is no generation and no parsing, so an answer can never fall outside your schema.

| | |
|---|---|
| Current version | `openjev-0.1` (public experiment) |
| Base model | DiffusionGemma 26B-A4B (mixture of experts, about 4B active parameters), NVFP4 |
| Context window | 65,536 tokens (state and questions together) |
| Question types | noul, choice (up to 128 options), score (2–10 levels) |
| License | Apache-2.0 for both the weights and the server |
| Source | [github.com/razorback16/openjev](https://github.com/razorback16/openjev) |

## Model ids

| Id | Serves |
|---|---|
| `openjev-latest` | Alias for the newest release. Currently `openjev-0.1`. |
| `openjev-0.1` | OpenJev 0.1, pinned. Use this if you want answers that don't change when a new version ships. |
| `jev-latest`, `jev-preview` | Aliases for `openjev-latest`, so the TypeSafe SDK defaults work unchanged. |

The response's `model` field always names the exact version that answered.

OpenJev 0.1 runs on an unmerged vLLM pull request ([#57250](https://github.com/vllm-project/vllm/pull/57250)). When that lands upstream we will release `openjev-1.0` and move `openjev-latest` to it; `openjev-0.1` stays available for pinning.

## Coming next

OpenJev 1.0, batch mode for large jobs, and more open System One models.

---

# Writing questions

> Every request is a state plus a set of questions. Each question has a type, optional instructions, and criteria that define the possible answers.

Source: https://codiv.ai/docs/guides/questions

## The state

`state` is whatever the questions are about. It can be a string, or any JSON object or array, which is sent to the model as JSON. Put all the context the model needs here, because each question sees only the state and its own instructions and criteria.

JSON:


```json
{"state": {"subject": "Refund?", "body": "I was charged twice in September.", "plan": "team"}}
```

## noul: yes or no

A `noul` answers a yes/no question with the probability of *yes*. You can define what yes and no mean with `criteria`; it is optional.

Question:

```json
"wants_refund": {
  "type": "noul",
  "instructions": "The customer is asking for a refund",
  "criteria": {"true": "explicitly asks for money back", "false": "anything else"}
}
```

Answer:

```json
"wants_refund": {"type": "noul", "noul": 0.93}
```

## choice: pick one

A `choice` picks one of up to 128 named options. The `criteria` object maps each option name to a description, or to `null` when the name speaks for itself. The answer contains the most likely option, the probability of every option and a `confidence`.

Question:

```json
"topic": {
  "type": "choice",
  "instructions": "Primary topic of the message",
  "criteria": {"billing": "charges, invoices, refunds", "bug": "something is broken", "other": null}
}
```

Answer:

```json
"topic": {
  "type": "choice",
  "choice": "bug",
  "probabilities": {"billing": 0.04, "bug": 0.95, "other": 0.01},
  "confidence": 0.81
}
```

## score: a scale

A `score` places the state on an ordered scale of 2 to 10 levels, listed from lowest to highest. The answer's `score` is the expected level, `Σ i·pᵢ` with levels numbered from 0, so it can fall between levels. `legend` echoes your levels.

Question:

```json
"sentiment": {
  "type": "score",
  "instructions": "Overall sentiment",
  "criteria": ["negative", "neutral", "positive"]
}
```

Answer:

```json
"sentiment": {
  "type": "score",
  "score": 1.62,
  "legend": {"0": "negative", "1": "neutral", "2": "positive"},
  "probabilities": {"0": 0.03, "1": 0.32, "2": 0.65},
  "confidence": 0.62
}
```

## Many questions at once

Put every question about the same state in one request. They share one read of the state, so ten questions cost far less than ten requests. Large sets are split into chunks and answered in parallel. Question ids only key the answers and are never shown to the model, so name them for your code rather than for the model.

## Tips

- **Be concrete.** "Does the customer need a reply within the hour?" beats "urgent?".
- **Describe options by what they contain**, not just by their names, especially when names overlap.
- **Add an explicit fallback** such as `"other"` to choices, so the model is never forced into a bad fit.
- **Instructions and descriptions can be JSON** when you already have structured definitions.

> **Warning: Evaluate on your own data.**
> OpenJev is a new model. Check its answers on a labelled sample of your data before you rely on it in production.

---

# Probabilities & confidence

> Every answer is a probability distribution read directly from the model, not a sampled string. That makes thresholds meaningful.

Source: https://codiv.ai/docs/guides/confidence

## Probabilities

For `choice` and `score` questions, `probabilities` covers every option and sums to 1. For `noul`, the single number is the probability of yes. The `choice` field is simply the most likely option.

## Confidence

`confidence` summarizes how peaked a distribution is, using its entropy `H` over `K` options:

Formula:


```text
confidence = 1 − H(p) / ln K
```

It is 1 when all probability is on one option and 0 when the distribution is uniform. For example, `[0.84, 0.159, 0.001]` has a confidence of about 0.60: the top option is likely, but a real alternative remains.

## Uncertain answers

When any answer in a read is uncertain, OpenJev reads it again with fresh noise, up to four times, and averages the distributions. This smooths out noise without changing confident answers. Only the first read is billed.

## Using thresholds

Python:


```python
answer = response.choices["department"]
if answer.confidence >= 0.8:
    route(answer.choice)
else:
    send_to_human_review()

if response.nouls["is_urgent"].noul > 0.7:
    page_on_call()
```

Pick thresholds on a labelled sample: raise them for precision and lower them for recall.

---

# Jev compatibility

> Codiv implements the same wire API as TypeSafe's Jev, so code written for Jev runs against OpenJev with a new base URL and key.

Source: https://codiv.ai/docs/guides/jev-compatibility

## Switching

Set two environment variables. No code changes are needed:

Shell:


```bash
export TYPESAFE_API_KEY="sk-codiv-..."
export TYPESAFE_BASE_URL="https://api.codiv.ai"
```

The SDKs' default model, `jev-latest`, is accepted as an alias for `openjev-latest`.

## What is the same

- `POST /v1/systemone` and `GET /v1/models`, with the same request and response fields.
- The noul, choice and score question types and their answer shapes, including `legend` and `confidence`.
- The error shapes: validation lists on 422, and `{"detail": {"error_type", "message"}}` otherwise.
- The `x-typesafe-request-id` response header, so SDK request ids keep working.

## Differences

- A choice can have at most 128 options; Jev allows 255.
- Answers come from a different model, so probabilities will differ. Re-check any thresholds you tuned on Jev.

Codiv and OpenJev are independent projects and are not affiliated with TypeSafe AI. Jev is a model by TypeSafe AI.

---

# Limits & quotas

> Codiv is a free public experiment. Limits keep the shared GPU fast for everyone.

Source: https://codiv.ai/docs/guides/rate-limits

## Token quota

Every account gets **100M free input tokens**. Output tokens are always 0 and are not counted. Usage is shown on the [dashboard](https://codiv.ai/dashboard). When the quota is used up, requests return `429` with `error_type: "quota_exceeded_error"`. Requests already in flight at that moment still complete. Paid plans with larger quotas are coming soon.

## Rate limits

| Limit | Value | When exceeded |
|---|---|---|
| Requests per key | 1,200 per minute (default) | `429 rate_limit_error` |
| Active keys per account | 10 | Key creation is refused |
| Server capacity | Shared | `529 overloaded_error` with `retry-after` |

## Request limits

- Context window: 65,536 tokens. The state and questions are read together, so keep the state a little under that (about 60,000 tokens leaves room for a large question set).
- Request body: 512 KB.
- choice: up to 128 options. score: 2 to 10 levels.
- Questions per request: no fixed limit. Large sets are answered in parallel chunks.

## Retries

Retry `429 rate_limit_error` and `529` with exponential backoff, and honour `retry-after` when it is present. The TypeSafe SDKs do this for you. Do not retry `quota_exceeded_error`.

---

# Self-hosting OpenJev

> The server behind Codiv is open source under Apache-2.0. Run it on your own GPU with Docker.

Source: https://codiv.ai/docs/guides/self-hosting

## Run with Docker

You need an NVIDIA GPU that supports the NVFP4 checkpoint. OpenJev is developed on an RTX PRO 6000 Blackwell.

Shell:


```bash
git clone https://github.com/razorback16/openjev && cd openjev
docker compose up -d        # one container: vLLM + OpenJev on 127.0.0.1:8080
curl localhost:8080/v1/models
```

Point any SDK at it:

Shell:


```bash
export TYPESAFE_BASE_URL=http://127.0.0.1:8080
```

## Configuration

| Variable | Default | Meaning |
|---|---|---|
| `OPENJEV_UPSTREAM` | unset | External vLLM server URL; when set, the container does not start its own |
| `OPENJEV_CANVAS` | `64` | Canvas length; also sets the built-in vLLM's `--diffusion-config` |
| `OPENJEV_MAX_INFLIGHT` | `64` | Reads in flight to vLLM |
| `OPENJEV_MAX_QUEUE` | `512` | Waiting requests before the server returns 529 |
| `OPENJEV_API_KEY` | unset | Require `Authorization: Bearer <key>` |

## How it works

DiffusionGemma denoises a whole canvas of tokens at once instead of generating left to right. OpenJev writes the answer template onto the canvas and leaves only the answer slots as noise. One read-only denoising step then yields a distribution over each question's labels. The vLLM support comes from [vllm-project/vllm#57250](https://github.com/vllm-project/vllm/pull/57250).

> **Warning.**
> That vLLM pull request is not merged yet, so OpenJev pins a fork at a fixed commit.

---

# System One

> Ask typed questions about a state and get a calibrated answer to each.

Source: https://codiv.ai/docs/api-reference/system-one

## Create a decision

Endpoint:


```text
POST https://api.codiv.ai/v1/systemone
```

Evaluates every question against the state and returns one answer per question. Authenticate with `Authorization: Bearer <key>`.

### Request body

- `state` (string, object or array, required)

  What the questions are about. Objects and arrays are sent to the model as JSON.

- `model` (string, required)

  The model to use: `openjev-latest`, or any id from [List models](https://codiv.ai/docs/api-reference/models.md). `jev-latest` is accepted as an alias.

- `questions` (map of question objects, required)

  Question id → question. At least one question is required. Ids key the answers in the response and are never shown to the model.

  Question object properties:

  - `type` ("noul", "choice" or "score", required)

    The question type. See [Writing questions](https://codiv.ai/docs/guides/questions.md).

  - `instructions` (string, object or array, optional)

    What to decide about the state.

  - `criteria` (object or array)

    - **noul** (optional): `{"true": description, "false": description}`.
    - **choice** (required): `{option: description or null}`, with 1 to 128 options.
    - **score** (required): `[level, …]`, 2 to 10 levels ordered from lowest to highest.

### Returns

A [response object](#response). The `x-typesafe-request-id` header identifies the request; include it when you report a problem.

curl:

```bash
curl https://api.codiv.ai/v1/systemone \
  -H "Authorization: Bearer $TYPESAFE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openjev-latest",
    "state": "Hi, my Stripe connection keeps failing with a 403 and we launch tomorrow.",
    "questions": {
      "department": {
        "type": "choice",
        "instructions": "Which team should handle this",
        "criteria": {
          "billing": "Payment or subscription issues",
          "technical": "Bugs or integration problems",
          "sales": "Pricing or account questions"
        }
      },
      "frustration": {
        "type": "score",
        "instructions": "How frustrated the customer appears",
        "criteria": ["Calm, just stating facts", "Frustrated but civil", "Very angry, strong language"]
      },
      "is_urgent": {"type": "noul", "instructions": "The message conveys urgency"}
    }
  }'
```

Python:

```python
from typesafe_sdk import Choice, Noul, Score, TypeSafeClient

# Reads TYPESAFE_API_KEY and TYPESAFE_BASE_URL=https://api.codiv.ai
client = TypeSafeClient()

response = client.system_one(
    "Hi, my Stripe connection keeps failing with a 403 and we launch tomorrow.",
    {
        "department": Choice(
            instructions="Which team should handle this",
            criteria={
                "billing": "Payment or subscription issues",
                "technical": "Bugs or integration problems",
                "sales": "Pricing or account questions",
            },
        ),
        "frustration": Score(
            instructions="How frustrated the customer appears",
            criteria=["Calm, just stating facts", "Frustrated but civil", "Very angry, strong language"],
        ),
        "is_urgent": Noul(instructions="The message conveys urgency"),
    },
    model="openjev-latest",
)

print(response.choices["department"].choice)   # "technical"
print(response.scores["frustration"].score)     # 1.0
print(response.nouls["is_urgent"].noul)        # 1.0
```

TypeScript:

```ts
import { TypeSafeClient, choice, noul, score } from "@typesafe-ai/sdk";

// Reads TYPESAFE_API_KEY; baseURL can also come from TYPESAFE_BASE_URL
const client = new TypeSafeClient({ baseURL: "https://api.codiv.ai" });

const response = await client.systemOne({
  model: "openjev-latest",
  state: "Hi, my Stripe connection keeps failing with a 403 and we launch tomorrow.",
  questions: {
    department: choice("Which team should handle this", {
      billing: "Payment or subscription issues",
      technical: "Bugs or integration problems",
      sales: "Pricing or account questions",
    }),
    frustration: score("How frustrated the customer appears", [
      "Calm, just stating facts",
      "Frustrated but civil",
      "Very angry, strong language",
    ]),
    is_urgent: noul("The message conveys urgency"),
  },
});

console.log(response.answers.department.choice); // "technical"
```

Response:

```json
{
  "model": "openjev-0.1",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "technical",
      "probabilities": {"billing": 0.0, "technical": 1.0, "sales": 0.0},
      "confidence": 1.0
    },
    "frustration": {
      "type": "score",
      "score": 1.0,
      "legend": {"0": "Calm, just stating facts", "1": "Frustrated but civil", "2": "Very angry, strong language"},
      "probabilities": {"0": 0.0, "1": 1.0, "2": 0.0},
      "confidence": 0.97
    },
    "is_urgent": {"type": "noul", "noul": 1.0}
  },
  "usage": {"input_tokens": 175, "output_tokens": 0}
}
```

## The response object

- `model` (string)

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

- `answers` (map of answer objects)

  Answers keyed by your question ids. Every answer has a `type` matching its question.

  noul answer:

  - `noul` (number)

    Probability of yes, between 0 and 1.

  choice answer:

  - `choice` (string)

    The most likely option.

  - `probabilities` (map of number)

    The probability of every option. The values sum to 1.

  - `confidence` (number)

    `1 − H(p)/ln K`: 1 when certain and 0 when uniform. See [Probabilities & confidence](https://codiv.ai/docs/guides/confidence.md).

  score answer:

  - `score` (number)

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

  - `legend` (map of string)

    Your levels, keyed `"0"`, `"1"`, and so on.

  - `probabilities` (map of number)

    The probability of each level, keyed like `legend`.

  - `confidence` (number)

    As for choice.

- `usage` (object)

  `input_tokens` is what counts against your quota. `output_tokens` is always 0.

Answer objects:

```json
{"type": "noul", "noul": 0.93}

{"type": "choice", "choice": "bug",
 "probabilities": {"billing": 0.04, "bug": 0.95, "other": 0.01},
 "confidence": 0.81}

{"type": "score", "score": 1.62,
 "legend": {"0": "negative", "1": "neutral", "2": "positive"},
 "probabilities": {"0": 0.03, "1": 0.32, "2": 0.65},
 "confidence": 0.62}
```

---

# Models

> List the models you can call.

Source: https://codiv.ai/docs/api-reference/models

## List models

Endpoint:


```text
GET https://api.codiv.ai/v1/models
```

Lists the currently available models. Requires an API key.

### Returns

- `models` (array)

  Each entry has a `name`, a `description` and a `release_date`.

curl:

```bash
curl https://api.codiv.ai/v1/models \
  -H "Authorization: Bearer $TYPESAFE_API_KEY"
```

Python:

```python
from typesafe_sdk import TypeSafeClient

client = TypeSafeClient()
print(client.models.list())
```

Response:


```json
{
  "models": [
    {
      "name": "openjev-latest",
      "description": "Alias for the newest OpenJev release. Currently openjev-0.1.",
      "release_date": "2026-09-18"
    },
    {
      "name": "openjev-0.1",
      "description": "OpenJev 0.1: DiffusionGemma 26B-A4B (NVFP4) on vLLM PR #57250.",
      "release_date": "2026-09-18"
    }
  ]
}
```

---

# Errors

> Errors use conventional HTTP status codes and Jev's error shapes.

Source: https://codiv.ai/docs/api-reference/errors

## Error body

Most errors look like this:

Error:


```json
{"detail": {"error_type": "authentication_error", "message": "Cannot authenticate with the server. Please check your API key and try again."}}
```

Validation errors (422) return a list instead, with the location and reason of each problem:

422:


```json
{"detail": [{"loc": ["body", "state"], "msg": "Field required", "type": "missing"}]}
```

## Status codes

| Status | error_type | When |
|---|---|---|
| 401 | `authentication_error` | Unknown or revoked key |
| 403 | `authentication_error` | No key sent |
| 403 | `permission_error` | The account is disabled or its email is not verified |
| 404 | `not_found_error` | Unknown path or model |
| 413 | `invalid_request_error` | Request body larger than 512 KB |
| 422 | *(list)* | Invalid request body |
| 429 | `rate_limit_error` | Too many requests per minute on one key (1,200 by default) |
| 429 | `quota_exceeded_error` | The free token quota is used up |
| 529 | `overloaded_error` | At capacity. Retry after `retry-after` seconds. |

Every response, including errors, carries an `x-typesafe-request-id` header. Include it when you contact [support@codiv.ai](mailto:support@codiv.ai).
