Jev AI · 托管 API
Jev API:文本分类、路由与打分
把文本和带类型的问题发给 Jev AI,即可拿到 JSON 格式的结构化判断。先把接入提示词复制给你的编程助手,再创建密钥,最后验证连接。
API 调用优先扣 Token 账户,并按模型倍率计算;token 不足时,整次调用改按该模型的积分价格扣费。输出 token 免费。
Jev AI 是独立运营的服务。请使用 Jev AI 密钥调用兼容 TypeSafe 的 /api/v1/systemone 端点。
从这里开始
给编程助手复制一段接入提示词
把它粘贴给正在开发你应用的编程助手。提示词涵盖:更新已有的 TypeSafe 官方 SDK 客户端、设置 Jev AI 的 base URL 和密钥,以及在正式推理前检查连接。
提示词保持英文,编程助手可以直接照着执行。
Integrate Jev AI into this project. Inspect the existing code and read https://jev-ai.pro/docs first, especially #official-sdk for setup and #errors for failure handling.
Connection details: base URL https://jev-ai.pro/api; decision endpoint POST https://jev-ai.pro/api/v1/systemone; header "Authorization: Bearer $JEV_AI_API_KEY" with a key created at https://jev-ai.pro/jev-api; default model jev-latest.
If using TypeSafe's official SDK (@typesafe-ai/sdk), reuse the existing client and explicitly set baseURL to https://jev-ai.pro/api with a Jev AI key. Changing only the key is not enough. TypeSafe publishes the SDK; Jev AI provides the compatible endpoint.
Keep JEV_AI_API_KEY server-side; never put it in browser code, logs, commits or chat. Tell me where to configure it locally and in deployment.
Follow the docs for request/response formats, retries and model limits. Start with jev-latest, verify the actual destination, and check GET https://jev-ai.pro/api/v1/models without inference. Then show me how to make one small decision call using my balance.接下来在下方创建一个 Jev AI 密钥,按编程助手的指引配置好。提示词会要求助手只在服务端保存密钥。
你的 Jev API 密钥
为这次接入创建一个密钥,存进应用服务端的环境变量 JEV_AI_API_KEY,不要把它粘贴到编程助手的对话里。第一次创建?请看分步的 Jev API 密钥指南(英文)。
登录后即可创建密钥。注册赠送和签到积分用于网页请求和 API 兜底扣费;购买的 token 用于 API 输入用量。
第一次 API 调用
- 登录后在上方创建一个密钥。
- 在 Bash 或 Zsh 终端运行下面这个最小示例,在隐藏输入提示处填入密钥。这次请求会按下方的计费规则扣除余额。
- 确认返回里有
answers对象,然后回到这里检查连接状态。
在用编程助手或 TypeSafe SDK?复制接入提示词,让它帮你配置 base URL 和密钥。
{
printf 'Paste your API key, then press Enter (input is hidden): '
read -rs JEV_AI_API_KEY
printf '\n'
export JEV_AI_API_KEY
curl --fail-with-body https://jev-ai.pro/api/v1/systemone \
-H "Authorization: Bearer $JEV_AI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"state":"My payment failed. Please help.","questions":{"urgent":{"type":"noul","instructions":"Does this message need urgent support?"}}}'
unset JEV_AI_API_KEY
}API 调用先扣 token,token 不足时改按模型的积分价格扣费。输出 token 免费。创建密钥和检查状态不会运行模型。
端点
POST https://jev-ai.pro/api/v1/systemone
Authorization: Bearer <JEV_AI_API_KEY>
Content-Type: application/json请求
curl https://jev-ai.pro/api/v1/systemone \
-H "Authorization: Bearer $JEV_AI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": "Help! My payouts have been failing for 3 days.",
"model": "jev-latest",
"questions": {
"is_urgent": { "type": "noul", "instructions": "Does this convey urgency?" },
"department": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": { "billing": "Payments and refunds", "technical": "Bugs and outages", "sales": "Pricing" }
},
"frustration": {
"type": "score",
"instructions": "How frustrated is the customer?",
"criteria": ["Calm", "Frustrated", "Very angry"]
}
}
}'返回
{
"model": "jev-1.13.0",
"answers": {
"is_urgent": { "type": "noul", "noul": 0.95 },
"department": {
"type": "choice", "choice": "billing", "confidence": 0.98,
"probabilities": { "billing": 0.99, "technical": 0.01, "sales": 0.0 }
},
"frustration": {
"type": "score", "score": 1.04, "confidence": 0.94,
"legend": { "0": "Calm", "1": "Frustrated", "2": "Very angry" },
"probabilities": { "0": 0.0, "1": 0.96, "2": 0.04 }
}
},
"usage": { "input_tokens": 379, "output_tokens": 70 }
}每个答案都放在你自定义的问题 id 下。choice 和 score 类答案带有 probabilities 和 0 到 1 之间的 confidence;noul 类答案就是“是”的概率。
TypeSafe 官方 SDK
@typesafe-ai/sdk 由 TypeSafe 发布。Jev AI 是提供兼容托管端点的独立服务,这个 SDK 并非 Jev AI 发布。
已经在用 TypeSafe 官方 SDK?Jev AI 密钥和 base URL 都要改。只换密钥的话,请求仍会发到 SDK 默认的 TypeSafe 服务。Jev AI 的密钥和余额与 TypeSafe 相互独立。
JavaScript / TypeScript 中设置 baseURL: 'https://jev-ai.pro/api'。SDK 会自动补上 /v1/systemone,所以 base URL 里不要带 /v1 或完整路径。最终请求地址必须是 https://jev-ai.pro/api/v1/systemone。
// Official TypeSafe SDK, published by TypeSafe — @typesafe-ai/sdk 0.6.0
// Server-side JavaScript / TypeScript using the Jev AI compatible endpoint
import { TypeSafeClient, choice } from '@typesafe-ai/sdk'
const apiKey = process.env.JEV_AI_API_KEY
if (!apiKey) throw new Error('Set JEV_AI_API_KEY on your server')
const client = new TypeSafeClient({
apiKey,
baseURL: 'https://jev-ai.pro/api', // Required, including for existing SDK users
retry: { maxRetries: 0 }, // Avoid replaying a request with an uncertain outcome
})
// The SDK appends /v1/systemone to baseURL.
const response = await client.systemOne({
model: 'jev-latest',
state: { document: 'I was charged twice. Please fix this ASAP.' },
questions: {
category: choice('What is this ticket about?', { billing: null, technical: null, other: null }),
},
})
console.log(response.answers.category.choice)示例关闭了自动重试,避免在结果不确定时重复发送请求。正式发起会扣余额的判断调用前,请先对照 TypeSafe SDK 连接检查清单(英文)。
已用 @typesafe-ai/sdk 0.6.0 测试。GET /api/v1/models 列出可用模型名,GET /api/v1/credits 返回 creditsRemaining 和 paidInputTokensRemaining。旧版积分字段仍保留以兼容老代码。
调用已保存的评判器
编辑器默认使用官方格式:完整的 state、model 和 questions,只需更换端点和密钥,就能在 Jev AI 与 TypeSafe 之间通用。选择已保存评判器 ID则使用下面这种 Jev AI 专属的简写;TypeSafe 无法识别这些 ID。
先创建并管理你的评判器,打开其中一个并选择 API 代码,即可拿到可直接复制的示例。请使用同一账户下的 API 密钥。
POST /api/v1/systemone
{
"judgeId": "YOUR_SAVED_JUDGE_ID",
"revision": 1,
"state": "New text to evaluate"
}用 judgeId 代替 questions。每次调用都会用保存好的规则评判你传入的新 state;返回格式和 token 计费与普通 API 调用相同。
revision 可选。带上它时,规则一旦变更,调用会返回 HTTP 409;不带则始终使用最新保存的版本。响应头 X-Jev-Judge-Id 和 X-Jev-Judge-Revision 标明本次使用的规则。已删除或无权访问的评判器返回 HTTP 404。
实时网页上下文
Jev 本身不会上网。POST /api/v1/web-context 会针对你的是非问题搜索网页,把搜索结果作为证据放进 Jev 的 state,并同时返回有证据和无证据两种情况下 Jev 的答案。可以先在浏览器里试用。
POST https://jev-ai.pro/api/v1/web-context
Authorization: Bearer <JEV_AI_API_KEY>
Content-Type: application/json
{
"question": "Has OpenAI released GPT-6?",
"query": "OpenAI releases GPT-6 announcement",
"criteria": {
"yes": "OpenAI has publicly released a model named GPT-6",
"no": "No model named GPT-6 has been released"
},
"num_results": 6,
"attribution": false
}{
"decision": "yes",
"confidence": 0.88,
"with_web": { "answer": { "type": "choice", "choice": "yes", "probabilities": { "yes": 0.88, "no": 0.12 }, "confidence": 0.88 }, "usage": { ... } },
"without_web": { "answer": { "type": "choice", "choice": "no", ... }, "usage": { ... } },
"sources": [{ "title": "...", "url": "https://...", "publishedDate": "2026-09-10T00:00:00.000Z", "highlights": ["..."] }],
"source_weights": null,
"usage": { "input_tokens": 2140, "output_tokens": 12, "jev_calls": 2, "web_search": true },
"latency": { "search_ms": 560, "jev_ms": 410 }
}只有 question 是必填项。query 默认等于问题本身,criteria 默认是通用的是非规则。num_results 取 1 到 10(默认 6)。设置 attribution: true 会返回 source_weights:去掉每条来源后,胜出答案的概率下降多少。它会对每条来源各重跑一次 Jev,这部分输入 token 同样计费。
想用自己的证据,可以传 sources(最多 10 个对象,含 title、url、publishedDate 和 highlights)。这样不会触发搜索,也不收搜索费。
计费:所有 Jev 调用的实际输入 token,加上每次网页搜索 170,000 token。token 不足时,每次请求扣 2 积分(自带 sources 时扣 1 积分)。失败的请求不扣费。
对比 Jev 与其他决策模型
还在选模型?接入前先看看 API 可用性、部署方式和基准测试背景。以下对比页为英文。
- Jev 模型是什么? — 中文介绍:官网、原理、价格与用法。
- JevBench 榜单 — 这些对比引用的独立排行榜,以及怎么解读它。
- Jev vs Imajev-4B — 托管版 Jev 对比一款还能看图的开源 4B 模型。
- Jev vs decider-4b — 托管版 Jev 对比基于 Qwen3.5-4B 的快速开源重建版。
- Jev vs JevK5 — 托管版 Jev 对比一款开源权重的 Qwen3.5-4B 替代品。
- Jev vs Cygnet — 托管版 Jev 对比冻结的 Gemma 4 12B,它在 JevBench 开源权重榜排第十。
- Jev vs Winnow — 托管版 Jev 对比一款还能聊天和看图的本地模型。
- Jev vs OpenJev — 托管版 Jev 对比 OpenJev 项目与自托管方案。
- Jev vs Djev — 对比决策模型的能力与接入方式。
- Jev vs Laya — 模型差异与基准测试背景。
- Jev vs Semif — 模型差异与部署方式。
- Jev vs LLM — 决策模型和聊天大模型、BERT 分类器有什么不同。
- 能在本地运行 Jev 吗? — 一张表看清开源现状和可自托管的替代方案。
这些页面对比的是决策模型。只要 GET /api/v1/models 列出了 Laya Beta,它就能通过同一个端点调用;其他被对比的模型不在此端点提供。
模型、限制与计费
了解 Laya English 和 Multilingual · Laya API 请求格式与限制(英文)。两者都使用你的 Jev AI 密钥和上方端点。
Inception 的决策模型 Mercury Decide 也可以用这个端点调用:把 model 设为 mercury-decide。单次请求最多 32,768 token,计费方式与 Jev 相同。参见 Mercury Decide API 参考(英文)。
OpenAI Decisions API 背后的模型 GPT-6 Luna 同样可用:把 model 设为 gpt-6-luna。它能读取文本、JSON 和最多 4 张内嵌图片,按其模型倍率计费。参见 GPT-6 Luna API 参考(英文)。
把 model 设为 laya-english 或 laya-multilingual 即可使用 Laya Beta。不传时默认 jev-latest。使用已保存的 judgeId 时同样适用。
Laya English 每个问题总共最多 512 token,Multilingual 最多 1,024 token,包括 state、instructions、标签和框架文本。每个标签最多 48 token,问题和标签合计还有按检查点而定的额外上限。超长输入返回 422 且不扣费,不会被静默截断。用量按每个问题的输入序列计算,重复的 state 也计入。沿用账户现有计费规则,输出 token 为零。
| 模型 | jev-latest, jev-preview, jev-1.13.0, laya-english, laya-multilingual, mercury-decide, clef, clef-flash, gpt-6-luna(Jev 别名指向 jev-1.13.0;Laya Beta、Mercury Decide 和 GPT-6 Luna 需要已配置的连接。可用性以 GET /api/v1/models 为准。) |
| 问题类型 | noul(是/否)、choice、score · 每次请求最多 64 个 |
| 输入 | 字符串、JSON 对象或数组;Clef 和 GPT-6 Luna 还可附最多 4 张内嵌图片 · 请求体最大 256 KB · Jev 模型上下文 64k token;Mercury Decide 32,768 token;Laya 限制见上文 |
| 问题限制 | Jev 每个 Choice 最多 255 个选项,每个 Score 最多 10 个等级。Jev 的 state 加上最长的问题须在 32k token 以内。Laya 适用上文更严格的限制。 |
| 价格 | API 调用按“输入 token × 所选模型倍率”扣费,输出 token 免费。token 不足时,整次调用改按该模型的积分价格扣费。网页工具优先扣积分,不足时再按 token 计费。各模型倍率见价格页。 |
| 余额 | GET /api/v1/credits 分别返回积分余额和 token 余额。X-Jev-Billing 的值为 tokens、credits、credits-fallback 或 tokens-fallback。X-Jev-Credits-Charged 和 X-Jev-Paid-Input-Tokens-Used 报告本次调用的费用,X-Jev-Tokens-Remaining 报告剩余 token。请求执行前会临时预扣,最后按实际输入用量结算。两个账户都不够时返回 402,不扣费。 |
| 速率限制 | 每个账户每分钟 1,000 次请求;Jev 繁忙时返回 429 并附 Retry-After。 |
| 错误码 | 401 密钥错误 · 402 余额不足 · 422 请求无效 · 429 请放慢 · 502/504 上游故障(不计费) |