OpenRouter
このPlaygroundはOpenRouter経由でバージョンを固定したJevを呼び出します。最新の料金と提供状況はモデルページで確認してください。
- エンドポイント
- POST https://openrouter.ai/api/alpha/decisions
- model
- typesafe/jev-1.13
- APIキー
- APIキーはサーバーからBearerトークンとして送信します。
同じ状況について1問、または異なる3問を試せます。まず例を選び、入力を編集して、それぞれの構造化された回答を確認してください。
回答形式を1つずつ試せます。 実行するたびに、その日の利用枠を1回分使います。
例を実行すると、質問ごとに形式の決まった回答が返ります。Choiceは選択肢、Scoreは尺度上の値、Probabilityは0~1の値を返します。
このフォームは文章をstate.inputとして、名前を付けた1問または3問とともに送ります。結果はそれぞれanswers.<question_id>に入ります。
リクエストで質問と回答形式を指定し、レスポンスでは質問ごとに結果が返ります。コード例に出てくる JSON の項目を見ていきましょう。
modelstatequestions<question_id>typeinstructionscriteriaanswerschoiceprobabilitiesconfidencescorelegendnoul同じ状況について、Choice・Score・Probabilityの3問を個別に評価します。 実行するたびに、その日の利用枠を1回分使います。 形式が正しくても判断が正しいとは限りません。代表的な事例で検証し、用途に応じた閾値を設定してください。
このPlaygroundはOpenRouter経由でバージョンを固定したJevを呼び出します。最新の料金と提供状況はモデルページで確認してください。
TypeSafeには独自のエンドポイントとAPIキーがあります。公式クイックスタートではjev-latestを使い、1回のリクエストで複数の質問を送る方法を示しています。
// Run on your server. Keep the API key out of browser code.
const apiKey = process.env.OPENROUTER_API_KEY;
if (!apiKey) throw new Error("Set OPENROUTER_API_KEY");
const response = await fetch("https://openrouter.ai/api/alpha/decisions", {
method: "POST",
headers: {
Authorization: "Bearer " + apiKey,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "typesafe/jev-1.13",
state: {input: "A customer reports a duplicate charge."},
questions: {
team: {
type: "choice",
instructions: "Which team should handle this?",
criteria: {
billing: "Payments and refunds",
technical: "Bugs and integrations"
}
},
urgency: {
type: "score",
instructions: "How urgent is the issue?",
criteria: ["Can wait", "Needs attention today", "Immediate action"]
},
escalate: {
type: "noul",
instructions: "Should a human review this first?",
criteria: {false: "No review needed", true: "Review before acting"}
}
}
})
});
if (!response.ok) throw new Error("Decision request failed");
const {answers} = await response.json();
console.log(answers.team.choice, answers.urgency.score, answers.escalate.noul);選ばれた選択肢のキー。最も確率の高い選択肢です。
各段階の確率で重み付けした位置です。2つの段階の間になることもあります。
はい・いいえの質問に対する 0(いいえ)から 1(はい)の値です。
実際の問い合わせに近いデータで検証し、モデルのバージョンを記録してください。結果が不確かな場合や影響が大きい場合は、人が確認できるようにします。0.8 は説明用の値です。