← Главная

Как использовать Jev API

Jev предоставляет единственный endpoint. Вы отправляете state и набор questions; он возвращает типизированные ответы с вероятностями. Вот всё, что нужно для первого вызова.

1. Endpoint

Каждый запрос — это POST на https://api.typesafe.ai/v1/systemone, с аутентификацией через токен Bearer. Официальные SDK читают ваш ключ из переменной окружения TYPESAFE_API_KEY.

curl
curl -X POST https://api.typesafe.ai/v1/systemone \
  -H "Authorization: Bearer $TYPESAFE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jev-latest",
    "state": "Customer: I was charged twice and I am furious.",
    "questions": {
      "topic": {
        "type": "choice",
        "instructions": "What is the issue about?",
        "criteria": { "billing": "money problems", "bug": "broken product" }
      },
      "urgent": {
        "type": "noul",
        "instructions": "Escalate to a human now?"
      }
    }
  }'

Using a JevTypeSafeAI hosted key?

Skip the TypeSafe waitlist. The same choice / score / noul API through our hosted endpoint, billed per input token from a prepaid balance — one jv_live_ key, no setup. Paste your key below and run this exact request against the live endpoint to confirm it works.

curl https://jevtypesafeai.com/api/v1/decide \
  -H "Authorization: Bearer $JEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "state": "Customer: I was charged twice and nobody has replied for 3 days.",
    "questions": {
      "route":    { "type": "choice", "instructions": "Where should this go?",
                    "criteria": { "billing": "money", "bug": "broken", "account": "login" } },
      "urgency":  { "type": "score",  "instructions": "How urgent is this?",
                    "criteria": ["routine", "today", "urgent", "critical"] },
      "escalate": { "type": "noul",   "instructions": "Escalate to a human now?" }
    }
  }'
Test your key — run this exact request against the live endpoint, once:
Sends the request above to https://jevtypesafeai.com/api/v1/decide with your key and bills one tiny decision (≈ $0.00003). Your key stays in your browser. In production, keep it server-side.

Full API reference & ready-made endpoints →

2. Тело запроса

Три поля:

3. Три типа вопросов

choice — выбрать один вариант

Задайте карту критериев из до 255 помеченных вариантов. Jev возвращает ключ-победитель, вероятность по каждому варианту и уверенность.

"topic": {
  "type": "choice",
  "instructions": "What is the primary issue?",
  "criteria": {
    "billing": "billing or payment problem",
    "bug": "the product is broken",
    "account": "login or access"
  }
}

score — позиция на шкале

Задайте упорядоченный массив критериев из 2–10 описаний уровней. Jev возвращает (возможно, дробный) score плюс полное распределение.

"severity": {
  "type": "score",
  "instructions": "How urgent is this?",
  "criteria": [
    "routine",
    "handle today",
    "urgent",
    "critical, about to churn"
  ]
}

noul — откалиброванное да/нет

Без критериев — только инструкции. Jev возвращает noul, вероятность от 0 до 1.

"escalate": {
  "type": "noul",
  "instructions": "Escalate to a human immediately?"
}

4. Ответ

Вы получаете обратно разрешённую модель, карту answers и расход токенов:

{
  "model": "jev-1.13.0",
  "answers": {
    "topic":    { "type": "choice", "choice": "billing",
                  "confidence": 1.0,
                  "probabilities": { "billing": 1.0, "bug": 0.0, "account": 0.0 } },
    "severity": { "type": "score", "score": 3.0, "confidence": 1.0,
                  "legend": { "0": "routine", "3": "critical, about to churn" },
                  "probabilities": { "0": 0.0, "3": 1.0 } },
    "escalate": { "type": "noul", "noul": 0.8 }
  },
  "usage": { "input_tokens": 434, "output_tokens": 75 }
}

Поскольку типы фиксированы, вы можете ветвиться на результатах обычным кодом — if (answers.escalate.noul > 0.7) — без разбора, без regex и без риска некорректного ответа.

5. Лимиты и хорошие практики

Получите мгновенный доступ к API

Войдите, предоплатите небольшой баланс и получите ключ jv_live_ за минуты — один ключ для Core Decision API и каждого готового workflow-endpoint. Мгновенно, самообслуживание, без настройки.

Получить ключ API →Посмотреть цены

Хотите увидеть это до написания кода? Каждый пример на этой странице выполняется вживую в playground. За официальными ключами и полной документацией обращайтесь на docs.typesafe.ai.

▶ Запустить в playgroundПосмотреть цены
Как использовать Jev API — endpoint, формат запроса и примеры · Jev by TypeSafe AI