/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つの回答。
レスポンス
modelstringanswersarray<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_costnumberlist_costnumber
providerstring
400不正なリクエスト。paramはフィールド名を、codeは理由(invalid_parameter、unsupported_parameter、unsupported_capability、refusal、previous_response_not_found)を示します。課金されません。
レスポンス
errorobjecterror
messagestring問題の内容と解決方法。
typestring例:
invalid_request_error、authentication_error、permission_error、rate_limit_error、insufficient_quota、api_error。codestring安定したエラーコード。
paramstring | null該当する場合、問題のあるリクエストフィールド。
refusal_reasonenumcode: refusalの場合にのみ含まれます。
401キーがないか、形式が不正か、期限切れか、取り消されています。
レスポンス
errorobjecterror
messagestring問題の内容と解決方法。
typestring例:
invalid_request_error、authentication_error、permission_error、rate_limit_error、insufficient_quota、api_error。codestring安定したエラーコード。
paramstring | null該当する場合、問題のあるリクエストフィールド。
refusal_reasonenumcode: refusalの場合にのみ含まれます。
402組織での対応が先に必要です(card_required、email_unverified、org_under_review、free_tier_requires_payment、promotion_ended)。メッセージに手順が示されます。再試行しても解決しません。
レスポンス
errorobjecterror
messagestring問題の内容と解決方法。
typestring例:
invalid_request_error、authentication_error、permission_error、rate_limit_error、insufficient_quota、api_error。codestring安定したエラーコード。
paramstring | null該当する場合、問題のあるリクエストフィールド。
refusal_reasonenumcode: refusalの場合にのみ含まれます。
429insufficient_quota(クレジット不足、支出上限の超過、またはモデルに購入が必要)とpromo_credits_now(無料プロモーションの使い切り):クレジットを追加してください。メッセージに手順が示されます。rate_limit_exceeded、free_limit_reached、admission_capacity_exceeded:Retry-Afterの秒数だけ待って再試行してください。
レスポンス
errorobjecterror
messagestring問題の内容と解決方法。
typestring例:
invalid_request_error、authentication_error、permission_error、rate_limit_error、insufficient_quota、api_error。codestring安定したエラーコード。
paramstring | null該当する場合、問題のあるリクエストフィールド。
refusal_reasonenumcode: refusalの場合にのみ含まれます。
リクエスト
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