> For the complete documentation index, see [llms.txt](https://docs.aimlapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aimlapi.com/api-references/decision-models/typesafe/jev.md).

# Jev

{% columns %}
{% column width="66.66666666666666%" %}
{% hint style="info" %}
This documentation is valid for the following list of our models:

* `typesafe/jev`
  {% endhint %}
  {% endcolumn %}

{% column width="33.33333333333334%" %} <a href="https://aimlapi.com/app/typesafe/jev" class="button primary">Try in Playground</a>
{% endcolumn %}
{% endcolumns %}

## Model Overview

Jev is TypeSafe's first "System One" model: a structured decision model that returns typed answers (yes/no, choice, score) with calibrated probabilities instead of generated text. It is built for routing, classification, triage and other in-app decision points where a fast, predictable verdict matters more than prose — typically answering in well under a second. Text input only, 32K context.

{% hint style="success" %}
[Create AI/ML API Key](https://aimlapi.com/app/keys)
{% endhint %}

<details>

<summary>How to make the first API call</summary>

**1️⃣ Required setup (don’t skip this)**\
▪ **Create an account:** Sign up on the AI/ML API website (if you don’t have one yet).\
▪ **Generate an API key:** In your account dashboard, create an API key and make sure it’s **enabled** in the UI.

**2️ Copy the code example**\
At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project.

**3️ Update the snippet for your use case**\
▪ **Insert your API key:** replace `<YOUR_AIMLAPI_KEY>` with your real AI/ML API key.\
▪ **Select a model:** set the `model` field to the model you want to call.\
▪ **Provide input:** put the content to evaluate in `state` and describe what to decide in `questions`.

**4️ (Optional) Tune the request**\
See the API schema below for the three question types (`noul`, `choice`, `score`) and their `criteria`.

**5️ Run your code**\
Run the updated code in your development environment.

{% hint style="success" %}
For a detailed walkthrough, use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up).
{% endhint %}

</details>

## API Schema

## POST /v1/decisions

>

```json
{"openapi":"3.0.0","info":{"title":"AIML API","version":"1.0.0"},"servers":[{"url":"https://api.aimlapi.com"}],"paths":{"/v1/decisions":{"post":{"operationId":"_v1_decisions","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","enum":["typesafe/jev"]},"state":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"The content to evaluate: a string, a JSON object, or an array of texts. Text only."},"questions":{"type":"object","additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["noul"],"description":"A yes/no question; the answer is the probability of \"yes\"."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array."},"criteria":{"type":"object","properties":{"true":{"type":"string","description":"When the answer is \"yes\"."},"false":{"type":"string","description":"When the answer is \"no\"."}},"description":"Optional descriptions of what \"true\" and \"false\" mean for this question."}},"required":["type","instructions"]},{"type":"object","properties":{"type":{"type":"string","enum":["choice"],"description":"Pick exactly one option from `criteria`."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array."},"criteria":{"type":"object","additionalProperties":{"type":"string"},"description":"Option key → description. The answer is one of these keys plus a probability for each."}},"required":["type","instructions","criteria"]},{"type":"object","properties":{"type":{"type":"string","enum":["score"],"description":"Rate the state against an ordered scale of levels."},"instructions":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}}],"description":"What to decide about the state. A plain question, or structured guidance as a JSON object/array."},"criteria":{"type":"array","items":{"type":"string"},"minItems":2,"description":"Ordered level descriptions, lowest first. The answer is an expected level index (may be fractional) plus a probability per level."}},"required":["type","instructions","criteria"]}]},"description":"Map of question key → typed question. Every key comes back in `answers` with a typed result."}},"required":["model","state","questions"],"title":"typesafe/jev"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Resolved model version that answered."},"answers":{"type":"object","additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["noul"]},"noul":{"type":"number","description":"Probability that the answer is \"yes\" (0–1)."}},"required":["type","noul"]},{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"choice":{"type":"string","description":"The selected option key from `criteria`."},"confidence":{"type":"number","description":"Calibrated confidence in the choice (0–1)."},"probabilities":{"type":"object","additionalProperties":{"type":"number"},"description":"Probability of each option; sums to 1."}},"required":["type","choice","confidence","probabilities"]},{"type":"object","properties":{"type":{"type":"string","enum":["score"]},"score":{"type":"number","description":"Expected level on the ordered scale (may be fractional, e.g. 1.34)."},"confidence":{"type":"number","description":"Calibrated confidence in the score (0–1)."},"legend":{"type":"object","additionalProperties":{"type":"string"},"description":"Level index → level description."},"probabilities":{"type":"object","additionalProperties":{"type":"number"},"description":"Probability of each option; sums to 1."}},"required":["type","score","confidence","legend","probabilities"]}]},"description":"One typed answer per question key from the request."},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"}},"required":["input_tokens","output_tokens"],"description":"Token usage reported by the provider."}},"required":["model","answers","usage"]}}},"description":"Successful response."}}}}}}
```

## Code Example

{% tabs %}
{% tab title="Python" %}
{% code overflow="wrap" %}

```python
import requests

response = requests.post(
    "https://api.aimlapi.com/v1/decisions",
    headers={
        "Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
        "Content-Type": "application/json",
    },
    json={
        "model": "typesafe/jev",
        "state": "Help! My payments have been failing for 3 days and nobody answers support.",
        "questions": {
            "is_urgent": {
                "type": "noul",
                "instructions": "Does this convey urgency?",
            },
            "department": {
                "type": "choice",
                "instructions": "Which team should handle this?",
                "criteria": {
                    "billing": "Payments, invoicing, refunds",
                    "technical": "Bugs, outages, integrations",
                    "sales": "Pricing, upgrades, new accounts",
                },
            },
            "frustration": {
                "type": "score",
                "instructions": "How frustrated is the customer?",
                "criteria": ["Calm", "Frustrated", "Very angry"],
            },
        },
    },
)

print(response.json())
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code overflow="wrap" %}

```javascript
const response = await fetch('https://api.aimlapi.com/v1/decisions', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'typesafe/jev',
    state: 'Help! My payments have been failing for 3 days and nobody answers support.',
    questions: {
      is_urgent: {
        type: 'noul',
        instructions: 'Does this convey urgency?',
      },
      department: {
        type: 'choice',
        instructions: 'Which team should handle this?',
        criteria: {
          billing: 'Payments, invoicing, refunds',
          technical: 'Bugs, outages, integrations',
          sales: 'Pricing, upgrades, new accounts',
        },
      },
      frustration: {
        type: 'score',
        instructions: 'How frustrated is the customer?',
        criteria: ['Calm', 'Frustrated', 'Very angry'],
      },
    },
  }),
});

console.log(await response.json());
```

{% endcode %}
{% endtab %}
{% endtabs %}

<details>

<summary>Response</summary>

{% code overflow="wrap" %}

```json
{
  "model": "typesafe/jev-1.13-20260917",
  "answers": {
    "is_urgent": {
      "type": "noul",
      "noul": 0.96
    },
    "department": {
      "type": "choice",
      "choice": "billing",
      "confidence": 0.97,
      "probabilities": {
        "billing": 0.98,
        "technical": 0.02,
        "sales": 0
      }
    },
    "frustration": {
      "type": "score",
      "score": 1.3,
      "confidence": 0.55,
      "legend": {
        "0": "Calm",
        "1": "Frustrated",
        "2": "Very angry"
      },
      "probabilities": {
        "0": 0,
        "1": 0.7,
        "2": 0.3
      }
    }
  },
  "usage": {
    "input_tokens": 403,
    "output_tokens": 73
  },
  "meta": {
    "usage": {
      "credits_used": 47,
      "usd_spent": 0.0000235
    }
  }
}
```

{% endcode %}

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aimlapi.com/api-references/decision-models/typesafe/jev.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
