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

# Jev API

> 使用 TypeSafe 的 Jev 模型对文本分类、按量表评分，或判断陈述。

Jev 根据一组问题评估文本或 JSON，并为每个问题返回结构化答案。同一请求中的所有问题共享相同的 `state`。

| Run 字段 | 值 |
| - | - |
| `provider` | `typesafe` |
| `endpoint` | `/v1/systemone` |

通过 `input` 将这些字段发送到[创建 Run](https://glasser.ai/docs/zh/api-reference/runs/create.md)。当前输入 Schema 和价格以[检查接口](https://glasser.ai/docs/zh/api-reference/endpoints/inspect.md) 结果为准。认证和 Run 处理见 [API 概览](https://glasser.ai/docs/zh/api-reference/overview.md)。

## 输入

| 字段 | 说明 |
| - | - |
| `state` | 待评估内容：文本、JSON 对象或 JSON 数组。 |
| `questions` | 包含一个或多个问题的对象，每个问题需有非空 ID。 |
| `model` | 可选模型名，默认为 `jev-latest`；使用 `jev-1.13.0` 指定该版本。 |

每个问题包含 `type`、描述评估要求的 `instructions`，以及需要时提供的 `criteria`：

| 类型 | 用途 | `criteria` |
| - | - | - |
| `choice` | 选择一个选项 | 含 2–255 个选项的对象 |
| `score` | 评分 | 含 2–10 个等级的有序数组 |
| `noul` | 判断是非陈述 | 可选 |

答案按问题 ID 存放在 `output.answers` 中。问题和答案格式见 [TypeSafe API 参考](https://docs.typesafe.ai/api)。

## 示例

以下请求判断同一张支持工单中的两项陈述：

```json wrap theme={null}
{
  "provider": "typesafe",
  "endpoint": "/v1/systemone",
  "input": {
    "model": "jev-1.13.0",
    "state": "The customer was charged twice and asks for a refund.",
    "questions": {
      "duplicate_charge": {
        "type": "noul",
        "instructions": "The customer was charged twice."
      },
      "refund": {
        "type": "noul",
        "instructions": "The customer asks for a refund."
      }
    }
  }
}
```

## Token 限制

批量大小取决于 `state` 和问题内容。Jev 1.13 同时检查以下两个上限：

| 内容 | 上限 |
| - | - |
| `state` + 全部问题 | 64k tokens |
| `state` + 最长问题 | 32k tokens |

问题内容包括 `instructions` 和 `criteria`。Token 数量不同于字符数。其他模型版本和当前速率限制见 [TypeSafe 模型限制](https://docs.typesafe.ai/models)。

## 数据提供商错误

从 `provider_response.http_status` 读取 Jev 的 HTTP 状态，从 `provider_response.error` 读取错误正文。超过 token 上限时返回 HTTP `400`，正文如下：

```json theme={null}
{"detail":{"error_type":"max_tokens_exceeded"}}
```

错误不会指明超过了哪个上限。缩短 `state` 或最长问题，以满足 32k 上限；缩短问题或拆分请求，以满足 64k 总上限。修改后的请求应使用新的 `Idempotency-Key`。

Jev 在限流时返回 `429`，暂时过载时返回 `529`。请退避等待后再创建新 Run。状态字段和重试规则见 [Run 响应处理](https://glasser.ai/docs/zh/api-reference/overview.md#read-the-result)。

## 价格

Jev 按输入 token 计费，输出 token 免费。每个批次都会重新包含 `state` 并计费。未产生 token 用量的超限拒绝不收费。

检查接口以获取 Glasser 当前价格。Run 的 `charge_usd` 包含实际费用。


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