> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omniall.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeSafe Jev API

> 在 Omniall AI 上调用 TypeSafe Jev System One：结构化判定与概率，不生成自由文本。

# TypeSafe Jev API

Jev 是 TypeSafe 的 System One 模型。它**不生成文字**：你传入内容和带类型的问题，直接得到答案与概率（以及置信度）。程序可据此分支，无需解析自然语言回复。

| 能力 | 方法 | 路径 |
| - | - | - |
| System One（TypeSafe 官方） | `POST` | `/typesafe/v1/systemone` |
| Decisions（OpenAI 兼容） | `POST` | `/v1/decisions` |

**Host：** `https://api.omniall.ai` · 鉴权 `Authorization: Bearer sk-...`\
**模型：** `jev-1.14.0` · `jev-preview` · `jev-latest`

完整字段与 Playground 见 **API Reference → 对话 → TypeSafe / Jev**。

## 题型

| TypeSafe | OpenAI Decisions | 返回 |
| - | - | - |
| `noul` | `predicate` | 「是」的概率，范围 `[0, 1]` |
| `choice` | `choice` | 最优选项 + 各选项概率 + 置信度 |
| `score` | `score` | 加权分值 + 各档概率 + 置信度 |

一次请求可混合多种题型。增加问题不会改变其它题的答案——每题针对同一份内容独立作答。

## 快速开始（TypeSafe 官方）

```bash theme={null}
curl -X POST 'https://api.omniall.ai/typesafe/v1/systemone' \
  -H 'Authorization: Bearer sk-...' \
  -H 'Content-Type: application/json' \
  -d '{
    "state": "Help! My payouts have been failing for 3 days.",
    "model": "jev-1.14.0",
    "questions": {
      "department": {
        "type": "choice",
        "instructions": "Which team should handle this?",
        "criteria": {
          "billing": "Payments, invoicing, refunds",
          "technical": "Bugs, outages, integrations",
          "sales": "Pricing, upgrades, new accounts"
        }
      },
      "is_urgent": {
        "type": "noul",
        "instructions": "Does this convey urgency?"
      }
    }
  }'
```

TypeSafe SDK：将 `base_url` 设为 `https://api.omniall.ai/typesafe`（密钥用本站 API Key）。

## 快速开始（OpenAI Decisions）

```bash theme={null}
curl -X POST 'https://api.omniall.ai/v1/decisions' \
  -H 'Authorization: Bearer sk-...' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "jev-1.14.0",
    "input": "I was charged twice for my order.",
    "questions": [
      {
        "type": "predicate",
        "name": "refund_requested",
        "instructions": "Is the customer asking for money back?"
      }
    ]
  }'
```

OpenAI SDK（`openai` Python ≥ 3.26 / JS ≥ 7.30）：`base_url=https://api.omniall.ai/v1`，调用 `client.decisions.create(...)`。

## 适用场景

* 工单 / 表单路由（团队或下一步动作）
* 优先级与风险打分
* 内容审核与输出校验（合规、引用是否有依据）
* 智能体控制（调用哪个工具、是否转人工）

结合概率与置信度设阈值：把握高则自动执行，拿不准则转人工。

## 限制与建议

* 默认上下文 **64k** tokens；`state`/`input` + 最长一题 ≤ **32k**。可选请求头 `TypeSafe-Danger-Zone-Long-Context: true` 将两项提升到 **262k**（预览功能，更慢、准确度更低）。
* 图片：官方接口需 `TypeSafe-Danger-Zone-Images: true` 并放 `assets`；Decisions 可用 `input_image`（会自动打开图片能力）。仅 PNG/JPEG；边长 256–1568；单张 ≤ 16 MiB。
* 英文效果最好；中文等其它语言可用，但准确度不如英文，上线前请用自有数据验证。
* 概率保留两位小数，合计可能是 `0.99` 而非 `1.0`，无需自行归一化。

管理端渠道：新建 **TypeSafe** 渠道（类型 `68`），Base URL 填 `https://api.ephone.ai`（或你的上游），并在用户分组中开通 `jev-*` 模型。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.