POST/v1/decisions

判定を作成

OpenAI Decisions APIの形式です。1つの入力について最大32個の型付き質問(predicate、choice、score)を行い、調整済みの確率を質問の順序どおりに受け取ります。gpt-6-luna-decisionsとgemini-decision-1が提供します。

バッファリングのみで、Idempotency-Keyによる再生はありません。ボディにidはないため、対応付けにはx-request-idヘッダーを使ってください。usage.costとproviderは補完と同様に追加されます。

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

リクエストボディ

  • modelstring必須

    判定モデルのスラッグ。

  • inputstring | array<object>必須

    文字列、または1〜256件のuserメッセージ。contentはテキストかパート(input_text、data:image/...;base64, URLを指定したinput_image)。

  • questionsarray<object>必須

    predicate {instructions}、choice {instructions, choices: 2〜64個の{value, description?}}、またはscore {instructions, levels: 2〜10個の{label, description?}}。それぞれに一意のnameを指定できます。

  • safety_identifierstring

    任意のエンドユーザー識別子。

レスポンス

  • 200

    質問ごとに1つの回答。

    レスポンス
    • modelstring
    • answersarray<object>

      質問の順序どおり。どの質問にも、回答の代わりにrefusalが返る場合があります。

    • usageobject

      プロバイダーのusageオブジェクトに追加されるExperientialのフィールド。

      usage
      • costnumber

        このリクエストでクレジットから実際に課金されたUSD(浮動小数点数、プロモーションとプランの割引の適用後)。独自キーの場合は0。

      • is_byokboolean

        お客様自身のプロバイダーキー(独自キー)で実行された場合はtrue。独自キーの呼び出しはプラットフォームが課金しません。

      • cost_detailsobject

        次の2つの場合にのみ含まれます。upstream_inference_cost(USD。独自キーの場合に、プロバイダーが定価でお客様に請求する額)、またはlist_cost(USD。プラットフォーム負担の呼び出しが定価未満で課金された場合に、本来かかった額)。

        cost_details
        • upstream_inference_costnumber
        • list_costnumber
    • providerstring
  • 400

    不正なリクエスト。paramはフィールド名を、codeは理由(invalid_parameter、unsupported_parameter、unsupported_capability、refusal、previous_response_not_found)を示します。課金されません。

    レスポンス
    • errorobject
      error
      • messagestring

        問題の内容と解決方法。

      • typestring

        例:invalid_request_error、authentication_error、permission_error、rate_limit_error、insufficient_quota、api_error。

      • codestring

        安定したエラーコード。

      • paramstring | null

        該当する場合、問題のあるリクエストフィールド。

      • refusal_reasonenum

        code: refusalの場合にのみ含まれます。

        "cyber_policy""cbrn""content_policy""recitation""data_inspection""unspecified"
  • 401

    キーがないか、形式が不正か、期限切れか、取り消されています。

    レスポンス
    • errorobject
      error
      • messagestring

        問題の内容と解決方法。

      • typestring

        例:invalid_request_error、authentication_error、permission_error、rate_limit_error、insufficient_quota、api_error。

      • codestring

        安定したエラーコード。

      • paramstring | null

        該当する場合、問題のあるリクエストフィールド。

      • refusal_reasonenum

        code: refusalの場合にのみ含まれます。

        "cyber_policy""cbrn""content_policy""recitation""data_inspection""unspecified"
  • 402

    組織での対応が先に必要です(card_required、email_unverified、org_under_review、free_tier_requires_payment、promotion_ended)。メッセージに手順が示されます。再試行しても解決しません。

    レスポンス
    • errorobject
      error
      • messagestring

        問題の内容と解決方法。

      • typestring

        例:invalid_request_error、authentication_error、permission_error、rate_limit_error、insufficient_quota、api_error。

      • codestring

        安定したエラーコード。

      • paramstring | null

        該当する場合、問題のあるリクエストフィールド。

      • refusal_reasonenum

        code: refusalの場合にのみ含まれます。

        "cyber_policy""cbrn""content_policy""recitation""data_inspection""unspecified"
  • 429

    insufficient_quota(クレジット不足、支出上限の超過、またはモデルに購入が必要)とpromo_credits_now(無料プロモーションの使い切り):クレジットを追加してください。メッセージに手順が示されます。rate_limit_exceeded、free_limit_reached、admission_capacity_exceeded:Retry-Afterの秒数だけ待って再試行してください。

    レスポンス
    • errorobject
      error
      • messagestring

        問題の内容と解決方法。

      • typestring

        例:invalid_request_error、authentication_error、permission_error、rate_limit_error、insufficient_quota、api_error。

      • codestring

        安定したエラーコード。

      • paramstring | null

        該当する場合、問題のあるリクエストフィールド。

      • refusal_reasonenum

        code: refusalの場合にのみ含まれます。

        "cyber_policy""cbrn""content_policy""recitation""data_inspection""unspecified"

リクエスト

curl https://api.experientiallabs.ai/v1/decisions \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6-luna-decisions",
    "input": "Hi, I was charged twice for my October invoice.",
    "questions": [
      {"type": "predicate", "name": "is_billing", "instructions": "Is this about billing?"},
      {"type": "choice", "name": "urgency", "instructions": "How urgent is it?",
       "choices": [{"value": "low"}, {"value": "high"}]}
    ]
  }'

レスポンス

{
  "model": "gpt-6-luna-decisions",
  "answers": [
    {
      "type": "predicate",
      "name": "is_billing",
      "probability": 0.97
    },
    {
      "type": "choice",
      "name": "urgency",
      "choice": "high",
      "confidence": 0.82,
      "probabilities": [
        {
          "value": "low",
          "probability": 0.18
        },
        {
          "value": "high",
          "probability": 0.82
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 96,
    "output_tokens": 0,
    "cost": 0.0000096,
    "is_byok": false
  },
  "provider": "openai"
}

https://api.experientiallabs.ai/v1/decisions