← ホーム

Jev API の使い方

Jev は単一のエンドポイントを公開しています。状態と一連の質問を送ると、確率付きの型付き回答が返ってきます。最初の呼び出しに必要なすべてをここにまとめました。

1. エンドポイント

すべてのリクエストは https://api.typesafe.ai/v1/systemone への POST で、Bearer トークンで認証します。公式 SDK は TYPESAFE_API_KEY 環境変数からキーを読み取ります。

curl
curl -X POST https://api.typesafe.ai/v1/systemone \
  -H "Authorization: Bearer $TYPESAFE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jev-latest",
    "state": "Customer: I was charged twice and I am furious.",
    "questions": {
      "topic": {
        "type": "choice",
        "instructions": "What is the issue about?",
        "criteria": { "billing": "money problems", "bug": "broken product" }
      },
      "urgent": {
        "type": "noul",
        "instructions": "Escalate to a human now?"
      }
    }
  }'

Using a JevTypeSafeAI hosted key?

Skip the TypeSafe waitlist. The same choice / score / noul API through our hosted endpoint, billed per input token from a prepaid balance — one jv_live_ key, no setup. Paste your key below and run this exact request against the live endpoint to confirm it works.

curl https://jevtypesafeai.com/api/v1/decide \
  -H "Authorization: Bearer $JEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "state": "Customer: I was charged twice and nobody has replied for 3 days.",
    "questions": {
      "route":    { "type": "choice", "instructions": "Where should this go?",
                    "criteria": { "billing": "money", "bug": "broken", "account": "login" } },
      "urgency":  { "type": "score",  "instructions": "How urgent is this?",
                    "criteria": ["routine", "today", "urgent", "critical"] },
      "escalate": { "type": "noul",   "instructions": "Escalate to a human now?" }
    }
  }'
Test your key — run this exact request against the live endpoint, once:
Sends the request above to https://jevtypesafeai.com/api/v1/decide with your key and bills one tiny decision (≈ $0.00003). Your key stays in your browser. In production, keep it server-side.

Full API reference & ready-made endpoints →

2. リクエストボディ

3 つのフィールド:

3. 3 つの質問タイプ

choice — 1 つの選択肢を選ぶ

最大 255 個のラベル付き選択肢からなる criteria マップを与えます。Jev は勝者のキー、選択肢ごとの確率、信頼度を返します。

"topic": {
  "type": "choice",
  "instructions": "What is the primary issue?",
  "criteria": {
    "billing": "billing or payment problem",
    "bug": "the product is broken",
    "account": "login or access"
  }
}

score — 尺度上の位置

2–10 レベルの説明からなる順序付きの criteria 配列を与えます。Jev は(小数になりうる)スコアと分布全体を返します。

"severity": {
  "type": "score",
  "instructions": "How urgent is this?",
  "criteria": [
    "routine",
    "handle today",
    "urgent",
    "critical, about to churn"
  ]
}

noul — 較正済みの yes/no

criteria は不要 — 指示だけです。Jev は 0 から 1 の確率である noul を返します。

"escalate": {
  "type": "noul",
  "instructions": "Escalate to a human immediately?"
}

4. レスポンス

解決された model、answers マップ、トークン使用量が返ってきます:

{
  "model": "jev-1.13.0",
  "answers": {
    "topic":    { "type": "choice", "choice": "billing",
                  "confidence": 1.0,
                  "probabilities": { "billing": 1.0, "bug": 0.0, "account": 0.0 } },
    "severity": { "type": "score", "score": 3.0, "confidence": 1.0,
                  "legend": { "0": "routine", "3": "critical, about to churn" },
                  "probabilities": { "0": 0.0, "3": 1.0 } },
    "escalate": { "type": "noul", "noul": 0.8 }
  },
  "usage": { "input_tokens": 434, "output_tokens": 75 }
}

型が固定されているので、結果をプレーンなコードで分岐できます — if (answers.escalate.noul > 0.7) — 解析も正規表現も不要で、不正なレスポンスのリスクもありません。

5. 制限 & ベストプラクティス

API アクセスを今すぐ

サインインして少額を前払いすれば、数分で jv_live_ キーが手に入ります — Core 決定 API とすべての既製ワークフロー端点を 1 つのキーで。即時・セルフサーブ・設定不要。

API キーを取得する →料金を見る

コードを書く前に見てみたいですか? このページのすべての例はプレイグラウンドでライブに実行されます。公式キーと完全なドキュメントについては docs.typesafe.ai をご覧ください。

▶ プレイグラウンドで実行する料金を見る
Jev API の使い方 — エンドポイント、リクエスト形式 & 例 · Jev by TypeSafe AI