POST/api/orgs/{org_id}/trace-tags/projection

チェックの月間AIチェック数を予測

AIチェックを保存する前に、現在のトラフィック(直近7日間を30日に換算)で1か月に何回AIチェックを行うかを、プランの付属チェック数と今月の残りと比べて示し、収まらない場合は収まるサンプル率を提案します。件数は1時間ごとの集計から読み取ります。ルールチェックは無料のため予測は不要です。組織の管理者と組織自身のキーが呼び出せます。

認証: AuthorizationヘッダーにBearer形式のAPIキー

パスパラメーター

  • org_idstring必須

    お客様の組織ID(uuid)。GET /api/whoamiで取得できます。

リクエストボディ

  • scopeenum必須
    "llm_call""tool_call""session"
  • filtersobject

    チェックと同じフィルター(sample_rate を含む)。

    filters
    • api_key_idsarray<string>
    • modelsarray<string>
    • request_tagsarray<string>
    • sample_ratenumber
      既定値: 1

レスポンス

  • 200

    予測。

    レスポンス
    • window_daysinteger

      予測が読み取る直近のトラフィック。30日の月に換算します。

    • judgments_in_windowinteger

      期間内の該当リクエスト数(セッションチェックの場合はセッション数)。

    • lower_boundboolean

      件数が上限で打ち切られたため、予測は少なくともこの値です。

    • projected_per_month_at_full_rateinteger
    • projected_per_monthinteger

      チェックのサンプル率での値。

    • sample_ratenumber
    • plan_billingboolean
    • included_per_monthinteger | null
    • used_this_monthinteger
    • remaining_this_monthinteger | null

      今月残っている付属チェック数。付属枠がなければ null。

    • suggested_sample_ratenumber | null

      予測が残りの付属チェック数に収まるサンプル率。すでに収まる場合は null。

  • 401

    APIキーがない、不明、または失効しています。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

  • 403

    キーは有効ですが、この操作は許可されていません(例:プロビジョニングキー用エンドポイントでの推論キー、プラン対象外の機能)。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

  • 404

    リソースが存在しないか、他の組織に属しています。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

  • 422

    ボディまたはクエリの検証に失敗しました。

    レスポンス
    • detailarray<object>必須
      detail
      • typestring
      • locarray<string | integer>
      • msgstring
  • 503

    このデプロイ環境にはスコアストアがありません(tags_unavailable)。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

リクエスト

curl -X POST 'https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/trace-tags/projection' \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "scope": "llm_call",
  "filters": {
    "models": [
      "gpt-6-luna"
    ],
    "sample_rate": 1
  }
}'

レスポンス

{
  "window_days": 7,
  "judgments_in_window": 9334,
  "lower_bound": false,
  "projected_per_month_at_full_rate": 40003,
  "projected_per_month": 40003,
  "sample_rate": 1,
  "plan_billing": true,
  "included_per_month": 6500,
  "used_this_month": 2400,
  "remaining_this_month": 4100,
  "suggested_sample_rate": 0.1
}

https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/trace-tags/projection