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

> ## Agent Instructions
> Public hosts only: console https://omnimux.ai/dashboard · API https://api.omnimux.ai · docs https://docs.omnimux.ai.
> Gateway auth is Authorization: Bearer sk-… on https://api.omnimux.ai/v1 (OpenAI-compatible Chat Completions and related paths).
> Discover pages from /llms.txt; full site dump /llms-full.txt; product skill /skill.md; docs search MCP /mcp. Prefer .md page URLs for Markdown.
> Default docs locale is en; zh mirrors the same relative paths. Do not invent model ids not present on live pricing or the complete API pages.

# TypeSafe System One

> 通过 TypeSafe Jev 模型执行 choice、score、noul 与 box 结构化判定。

* 官方 TypeSafe System One 结构化判断接口，同时开放 `POST /v1/systemone`（兼容官方 SDK 的厂商路径）与 `POST /typesafe/v1/systemone`。
* 使用网关 API Key（`Authorization: Bearer sk-...`）请求 `https://api.omnimux.ai`。
* 接口为同步返回，不在任务查询端点保留历史结果快照。

## 模型

| 模型标识 | 说明 |
| - | - |
| `jev` | OmniMux 兼容别名，映射至 `jev-latest` |
| `jev-latest` | 最新稳定版 Jev |
| `jev-1.14.0` | Jev 1.14 固定版本 |
| `jev-1.13.0` | Jev 1.13 固定版本 |
| `jev-preview` | Jev 预览版本 |

## 请求约束与键序保留

JSON 请求体（或 `multipart/form-data` 中的 `request` 字段）仅允许四个顶层字段：`model`、`state`（非空字符串、对象或数组）、`questions`（非空对象）以及可选的 `assets`，其余顶层字段将被拒绝。

* 网关在转发前原样保留 `state` 的 JSON 成员顺序，避免影响 Jev 的结构化判定结果。
* `questions` 中每道题须声明 `type`（`choice`、`score`、`noul` 或 `box`）及对应的 `criteria`（`choice` 需 1 至 255 个选项；`score` 需 1 至 10 个非空分档；`noul` 可选 `true`/`false` 说明；`box` 不传 `criteria`）。

## 图片与 Multipart 上传

可在 `assets` 中直接传入 base64 图片，或使用 `multipart/form-data` 上传：须将序列化后的 JSON 放在名为 `request` 的首个表单字段中，并由 `assets` 中的字段名对应其余二进制图片部分。当请求包含 `assets` 或 `box` 题型时，网关会自动向上游附加 `TypeSafe-Danger-Zone-Images: true`。

## 上下文档位与计费规则

* 默认支持 64Ki 输入上下文（计及 256 token 请求前缀上限为 65,792 input tokens）；携带请求头 `TypeSafe-Danger-Zone-Long-Context: true` 可开启 256Ki 上下文（上限 262,400 input tokens）。
* 仅按输入 Token 计费（`$0.042` / 百万输入 token），输出 Token 免费。请求前按对应上限预扣，完成后按上游 `usage.input_tokens` 差额结算；余额不足返回 `402`。
* 上游返回 `422` 校验错误时保留原生 `detail` 字段并退还预扣额度。通用状态码说明见[连接与使用](https://docs.omnimux.ai/zh/faqs/connection-usage.md)。


## OpenAPI

````yaml openapi/ops/typesafe/systemone.json POST /v1/systemone
openapi: 3.1.0
info:
  title: TypeSafe System One
  version: 1.0.0
  description: >-
    Structured judgment decisions via TypeSafe Jev models on OmniMux (POST
    /v1/systemone and POST /typesafe/v1/systemone).
servers:
  - url: https://api.omnimux.ai
security:
  - BearerAuth: []
paths:
  /v1/systemone:
    post:
      summary: Submit TypeSafe System One judgment
      description: >-
        Synchronously evaluates structured questions (choice, score, noul, or
        box) against state. Also served at POST /typesafe/v1/systemone.
        Preserves JSON member order in state when JSON order preservation is
        active.
      operationId: submitTypeSafeSystemOne
      parameters:
        - name: TypeSafe-Danger-Zone-Long-Context
          in: header
          required: false
          description: >-
            Set to "true" to enable the 256Ki input context budget (up to
            262,400 billed input tokens). Increases the pre-request balance
            reserve accordingly.
          schema:
            type: string
            enum:
              - 'true'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SystemOneRequest'
            example:
              model: jev-latest
              state:
                ticket_id: T-1042
                message: Customer requests a full refund after missing delivery.
              questions:
                needs_escalation:
                  type: noul
                  instructions: Return true if this ticket requires human escalation.
                priority:
                  type: choice
                  criteria:
                    high: Financial dispute or missed SLA
                    normal: General inquiry
          multipart/form-data:
            schema:
              type: object
              required:
                - request
              properties:
                request:
                  type: string
                  description: >-
                    Serialized JSON string matching SystemOneRequest. Must be
                    sent as the first multipart field, with images in assets
                    referencing the remaining binary file part names.
              additionalProperties:
                type: string
                format: binary
                description: >-
                  Image file parts (PNG/JPEG) referenced by part name inside
                  request.assets.
      responses:
        '200':
          description: Synchronous judgment answers and input token usage
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemOneResponse'
              example:
                model: jev-1.14.0
                answers:
                  needs_escalation:
                    type: noul
                    answer: true
                  priority:
                    type: choice
                    answer: high
                usage:
                  input_tokens: 312
                  output_tokens: 0
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientQuota'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/UpstreamError'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    SystemOneRequest:
      type: object
      additionalProperties: false
      required:
        - model
        - state
        - questions
      properties:
        model:
          type: string
          enum:
            - jev
            - jev-1.14.0
            - jev-1.13.0
            - jev-latest
            - jev-preview
          description: >-
            Jev model ID or OmniMux compatibility alias jev (mapped to
            jev-latest).
        state:
          description: >-
            Non-null context payload as a string, JSON object, or array. Object
            key order is preserved verbatim.
        questions:
          type: object
          minProperties: 1
          description: Map of question IDs to typed question definitions.
          additionalProperties:
            type: object
            required:
              - type
            properties:
              type:
                type: string
                enum:
                  - choice
                  - score
                  - noul
                  - box
              instructions:
                description: >-
                  Optional text, object, array, or null instructions for the
                  question.
              criteria:
                description: >-
                  Type-specific criteria: object of 1-255 option descriptions
                  for choice; array of 1-10 non-null levels for score; optional
                  {true, false} descriptions for noul; omitted for box.
        assets:
          type: object
          description: >-
            Optional map of asset keys referenced inside state/questions to
            base64 image strings or multipart part names.
    SystemOneResponse:
      type: object
      required:
        - model
        - answers
      properties:
        model:
          type: string
        answers:
          type: object
          additionalProperties:
            type: object
            required:
              - type
              - answer
            properties:
              type:
                type: string
              answer: {}
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
              minimum: 0
            output_tokens:
              type: integer
              minimum: 0
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              oneOf:
                - type: string
                - type: integer
        detail: {}
  responses:
    BadRequest:
      description: Invalid request structure or disallowed top-level field
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid OmniMux API token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InsufficientQuota:
      description: >-
        Insufficient balance to reserve the maximum context budget (standard
        65,792 or long-context 262,400 input tokens)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: >-
        Upstream TypeSafe validation error (preserves upstream detail payload;
        reserved quota is refunded)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit reached
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Gateway error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UpstreamError:
      description: Upstream error or incomplete usage payload
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: No available TypeSafe channel
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````

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