LEAPERone 文档

Decisions API(Jev / System One)

POST /v1/decisions 与 OpenRouter 兼容别名 POST /api/alpha/decisions 参考 —— TypeSafe Jev System One,按上游成本原价结算。

对一段 state 提交类型化问题(noul / choice / score),由 TypeSafe Jev(经 OpenRouter)完成评估。LEAPERone 使用你的 API Key 鉴权,并按上游成本做 pass-through 计费。

端点

POST https://api.leaper.one/v1/decisions
POST https://api.leaper.one/api/alpha/decisions

/api/alpha/decisions 与 OpenRouter Decisions 路径一致,便于把 https://openrouter.ai 换成 https://api.leaper.one。处理逻辑、鉴权、RPM 桶与计费与 /v1/decisions 相同。

身份认证

使用 LEAPERone API Key:

  • Authorization: Bearer sk-your-leaperone-key

参数

请求体遵循 OpenRouter Decisions 原生格式。必填字段:

参数类型必填说明
modelstringJev 模型 ID(见下表)。可选 openrouter/ 目录前缀。
statestring | object | array待评估内容。
questionsobject问题 id → 类型化问题(noul / choice / score)的映射。

问题结构遵循上游 OpenRouter Decisions / TypeSafe Jev 约定(例如 typequestion,以及 choiceoptions)。

支持的模型

模型 ID名称
~typesafe/jev-latestJev Latest
typesafe/jev-1.13Jev 1.13
openrouter/~typesafe/jev-latestJev Latest (OpenRouter prefix)
openrouter/typesafe/jev-1.13Jev 1.13 (OpenRouter prefix)

可选的 openrouter/ 前缀在转发上游前会被剥离,因此目录 ID 与 OpenRouter 风格 ID 均可使用。

定价

Pass-through:按上游响应中的 usageinput_tokensoutput_tokenscost)折算为 LEAPERone 积分。参阅定价

限流

Chat RPM 档位共用同一配置(与 Chat Completions 相同)。/api/alpha/decisions 别名映射到同一 /v1/decisions 限流键。参阅速率限制

请求(curl)

curl -X POST https://api.leaper.one/v1/decisions \
  -H "Authorization: Bearer sk-your-leaperone-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "~typesafe/jev-latest",
    "state": {
      "ticket": "Customer paid twice for the same order",
      "amount_usd": 48
    },
    "questions": {
      "should_refund": {
        "type": "noul",
        "question": "Should we issue a full refund?"
      },
      "primary_reason": {
        "type": "choice",
        "question": "Primary reason category",
        "options": ["duplicate_charge", "defective", "late_delivery", "other"]
      },
      "confidence": {
        "type": "score",
        "question": "Confidence that the refund is warranted (0-1)"
      }
    }
  }'

OpenRouter 路径别名(请求体相同):

curl -X POST https://api.leaper.one/api/alpha/decisions \
  -H "Authorization: Bearer sk-your-leaperone-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "typesafe/jev-1.13",
    "state": "Blank checkout page after payment redirect",
    "questions": {
      "is_incident": {
        "type": "noul",
        "question": "Is this a production incident?"
      }
    }
  }'

响应

成功时透传 OpenRouter 响应,通常包含 answersusage(token 与成本)。具体字段以上游 Decisions 契约为准。

注意事项

  • API 侧需配置 Decisions 上游(OPENROUTER_API_KEY)。
  • 上游超时为 60 秒。
  • Chat / Responses / Messages 仍走各自端点;Decisions 仅用于类型化的 Jev 评估。