Jev 1.13
Jev 1.13 от TypeSafe: не пишет текст, а принимает решения — выбор из вариантов, оценка по шкале, да/нет с вероятностями. Для классификации, маршрутизации и разбора заявок.
Первый запрос
import requests
resp = requests.post(
"https://api.altrouter.ai/v1/systemone",
headers={"Authorization": "Bearer ar-..."},
json={
"model": "jev-1.13",
"state": {
"ticket": "My card was charged twice for the subscription"
},
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this ticket?",
"criteria": {
"billing": "payments, refunds",
"tech": "bugs, API errors",
"other": None
}
},
"urgency": {
"type": "score",
"instructions": "How urgent is it?",
"criteria": [
"can wait",
"normal",
"urgent"
]
},
"refund": {
"type": "noul",
"instructions": "Does the customer ask for a refund?"
}
}
},
).json()
print(resp["answers"]["team"]["choice"])
# → { "answers": { "team": { "choice": "billing", "probabilities": {...} },
# "urgency": { "score": 1.8, ... }, "refund": { "noul": 0.98 } },
# "usage": { "input_tokens": 448, "output_tokens": 69, "cost": ... } }const resp = await fetch("https://api.altrouter.ai/v1/systemone", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.ALTROUTER_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"model": "jev-1.13",
"state": {
"ticket": "My card was charged twice for the subscription"
},
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this ticket?",
"criteria": {
"billing": "payments, refunds",
"tech": "bugs, API errors",
"other": null
}
},
"urgency": {
"type": "score",
"instructions": "How urgent is it?",
"criteria": [
"can wait",
"normal",
"urgent"
]
},
"refund": {
"type": "noul",
"instructions": "Does the customer ask for a refund?"
}
}
}),
}).then((r) => r.json());
console.log(resp.answers.team.choice);curl https://api.altrouter.ai/v1/systemone \
-H "Authorization: Bearer ar-..." \
-H "Content-Type: application/json" \
-d '{
"model": "jev-1.13",
"state": {
"ticket": "My card was charged twice for the subscription"
},
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this ticket?",
"criteria": {
"billing": "payments, refunds",
"tech": "bugs, API errors",
"other": null
}
},
"urgency": {
"type": "score",
"instructions": "How urgent is it?",
"criteria": [
"can wait",
"normal",
"urgent"
]
},
"refund": {
"type": "noul",
"instructions": "Does the customer ask for a refund?"
}
}
}'
# → { "answers": { "team": { "choice": "billing", "probabilities": {...} },
# "urgency": { "score": 1.8, ... }, "refund": { "noul": 0.98 } },
# "usage": { "input_tokens": 448, "output_tokens": 69, "cost": ... } }Это не чат: эндпоинт /v1/systemone совместим с API TypeSafe System One, поэтому в коде под TypeSafe меняются только адрес, ключ и идентификатор модели.
Лимиты
Контекст — 64K токенов на запрос и до 32K на один вопрос: state, instructions и criteria считаются вместе. Ответы не тарифицируются — платится только входной текст, поэтому десяток вопросов к одному state в одном запросе дешевле десятка запросов.
Подписки нет: деньги списываются за каждый успешный запрос по цене выше, а неудавшийся не оплачивается. Это уже цена со скидкой 6% от официальной цены вендора — официальная показана рядом зачёркнутой, чтобы её можно было сверить. Отдельного аккаунта у TypeSafe для этого не нужно: запрос уходит на api.altrouter.ai, а до вендора ходим мы.
Ограничение частоты общее для всех моделей и считается на ключ: 600 запросов в минуту по умолчанию, при превышении — 429 с заголовком retry-after: 60. Для отдельного ключа лимит и потолок трат за день, неделю, месяц или всё время настраиваются в кабинете.
Не чат: модель не пишет текст, а отвечает на типизированные вопросы - выбор, оценка, да/нет - с вероятностями. Эндпоинт совместим с API TypeSafe System One, платится только входной текст.
/v1/systemone