> ## 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 System One

> TypeSafe 官方 System One 请求。

传入共用的 `state`，以及一组问题（`noul` / `choice` / `score`）。
每道题针对同一份 `state` 独立作答。

上下文上限 64k tokens；`state` + 最长一题 ≤ 32k
（带 `TypeSafe-Danger-Zone-Long-Context: true` 时可到 262k）。


## 题型说明

| `type` | `criteria` | 答案字段 |
| - | - | - |
| `noul` | 可选 `{ true, false }` | `noul` = 「是」的概率 |
| `choice` | 必填选项映射（≤ 255） | `choice`、`probabilities`、`confidence` |
| `score` | 必填有序数组（2–10 档） | `score`、`legend`、`probabilities`、`confidence` |

`state` 与 `instructions` 可以是字符串、对象或数组。`questions` 的键名会原样出现在 `answers` 中。

接入指南：[TypeSafe Jev API](https://docs.omniall.ai/zh-CN/typesafe-jev-api.md)。


## OpenAPI

````yaml zh-CN/openapi/typesafe-jev.yaml POST /typesafe/v1/systemone
openapi: 3.1.0
info:
  title: Omniall AI — TypeSafe Jev（System One）
  version: 1.14.0
  description: |
    Omniall AI 上的 TypeSafe Jev System One 判定接口。

    Jev **不生成文字**：传入内容（`state` / `input`）与一组带类型的问题，直接返回每题答案与概率（以及置信度）。

    **两种调用方式：**

    - TypeSafe 官方：`POST /typesafe/v1/systemone`
    - OpenAI Decisions：`POST /v1/decisions`

    **模型：** `jev-1.14.0`、`jev-preview`（当前预览别名）、`jev-latest`。

    **Host：** `https://api.omniall.ai` · 鉴权 `Authorization: Bearer sk-...`

    可选预览请求头：

    - `TypeSafe-Danger-Zone-Images: true` — 官方接口允许图片
    - `TypeSafe-Danger-Zone-Long-Context: true` — 上下文上限提升至 262k tokens
servers:
  - url: https://api.omniall.ai
security: []
tags:
  - name: TypeSafe System One
    description: TypeSafe 官方 System One 格式
  - name: OpenAI Decisions
    description: OpenAI Decisions 兼容格式
paths:
  /typesafe/v1/systemone:
    post:
      tags:
        - TypeSafe System One
      summary: TypeSafe System One
      description: |
        TypeSafe 官方 System One 请求。

        传入共用的 `state`，以及一组问题（`noul` / `choice` / `score`）。
        每道题针对同一份 `state` 独立作答。

        上下文上限 64k tokens；`state` + 最长一题 ≤ 32k
        （带 `TypeSafe-Danger-Zone-Long-Context: true` 时可到 262k）。
      operationId: typeSafeSystemOne
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - name: TypeSafe-Danger-Zone-Images
          in: header
          required: false
          schema:
            type: string
            enum:
              - 'true'
          description: 预览功能 — 允许在 `state` / `instructions` / `criteria` 中放图片。
        - name: TypeSafe-Danger-Zone-Long-Context
          in: header
          required: false
          schema:
            type: string
            enum:
              - 'true'
          description: 预览功能 — 上下文上限提升至 262k tokens（更慢、准确度更低）。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TypeSafeSystemOneRequest'
            examples:
              ticket_routing:
                summary: 工单分派（choice + score + noul）
                value:
                  model: jev-1.14.0
                  state: Help! My payouts have been failing for 3 days.
                  questions:
                    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
                    is_urgent:
                      type: noul
                      instructions: Does this convey urgency?
      responses:
        '200':
          description: 各题答案
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TypeSafeSystemOneResponse'
              examples:
                ticket_routing:
                  value:
                    model: jev-1.14.0
                    answers:
                      department:
                        type: choice
                        choice: billing
                        probabilities:
                          billing: 0.88
                          technical: 0.12
                          sales: 0
                        confidence: 0.81
                      frustration:
                        type: score
                        score: 1.05
                        legend:
                          '0': Calm
                          '1': Frustrated
                          '2': Very angry
                        probabilities:
                          '0': 0
                          '1': 0.95
                          '2': 0.05
                        confidence: 0.92
                      is_urgent:
                        type: noul
                        noul: 0.95
                    usage:
                      input_tokens: 318
                      output_tokens: 34
        '400':
          $ref: '#/components/responses/TypeSafeError'
        '401':
          $ref: '#/components/responses/TypeSafeError'
        '403':
          $ref: '#/components/responses/TypeSafeError'
        '429':
          $ref: '#/components/responses/TypeSafeError'
components:
  parameters:
    Authorization:
      name: Authorization
      in: header
      required: true
      schema:
        type: string
        example: Bearer sk-...
      description: Bearer API key, e.g. `Bearer sk-...`.
  schemas:
    TypeSafeSystemOneRequest:
      type: object
      required:
        - model
        - state
        - questions
      properties:
        model:
          type: string
          description: Model id. Use `jev-1.14.0`, or aliases `jev-preview` / `jev-latest`.
          example: jev-1.14.0
        state:
          description: Shared content to judge (string, object, or array).
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
            - type: array
              items: {}
          example: Help! My payouts have been failing for 3 days.
        questions:
          type: object
          description: Map of question id → question. Keys are echoed in `answers`.
          additionalProperties:
            $ref: '#/components/schemas/TypeSafeQuestion'
          minProperties: 1
        assets:
          type: object
          description: >
            Preview — image assets keyed by UUID/reference string used inside
            `state` /

            `instructions` / `criteria`. Requires header
            `TypeSafe-Danger-Zone-Images: true`.
          additionalProperties:
            $ref: '#/components/schemas/TypeSafeAsset'
    TypeSafeSystemOneResponse:
      type: object
      properties:
        model:
          type: string
          example: jev-1.14.0
        answers:
          type: object
          additionalProperties:
            oneOf:
              - $ref: '#/components/schemas/TypeSafeNoulAnswer'
              - $ref: '#/components/schemas/TypeSafeChoiceAnswer'
              - $ref: '#/components/schemas/TypeSafeScoreAnswer'
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
    TypeSafeQuestion:
      type: object
      required:
        - type
        - instructions
      properties:
        type:
          type: string
          enum:
            - noul
            - choice
            - score
          description: |
            - `noul` — yes/no, returns P(yes)
            - `choice` — pick one option (≤ 255)
            - `score` — score on 2–10 ordered levels
        instructions:
          description: Question text (string, object, or array).
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
            - type: array
              items: {}
        criteria:
          description: >
            Required for `choice` (option map) and `score` (ordered level
            array).

            Optional for `noul` as `{ "true": "...", "false": "..." }`.
          oneOf:
            - type: object
              additionalProperties: true
            - type: array
              items: {}
    TypeSafeAsset:
      type: object
      required:
        - type
        - data_base64
      properties:
        type:
          type: string
          enum:
            - image
        format:
          type: string
          enum:
            - png
            - jpg
          description: Image format. Dimensions 256–1568 px per side, ≤ 16 MiB.
        data_base64:
          type: string
          description: Raw base64 without `data:` prefix.
    TypeSafeNoulAnswer:
      type: object
      properties:
        type:
          type: string
          enum:
            - noul
        noul:
          type: number
          minimum: 0
          maximum: 1
          description: Probability that the answer is yes.
    TypeSafeChoiceAnswer:
      type: object
      properties:
        type:
          type: string
          enum:
            - choice
        choice:
          type: string
          description: Highest-probability option.
        probabilities:
          type: object
          additionalProperties:
            type: number
        confidence:
          type: number
          minimum: 0
          maximum: 1
          description: >-
            How peaked the distribution is (not the same as the top option
            probability).
    TypeSafeScoreAnswer:
      type: object
      properties:
        type:
          type: string
          enum:
            - score
        score:
          type: number
          description: Probability-weighted score (may fall between levels).
        legend:
          type: object
          additionalProperties:
            type: string
        probabilities:
          type: object
          additionalProperties:
            type: number
        confidence:
          type: number
          minimum: 0
          maximum: 1
  responses:
    TypeSafeError:
      description: TypeSafe-style error
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: object
                properties:
                  error_type:
                    type: string
                    example: validation_error
                  message:
                    type: string
                    example: >-
                      questions.refund.type: expected one of 'noul', 'choice',
                      'score'

````

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