/v1/systemoneSystemOneの判定を作成
jev-latestやclefなどの判定モデル向けのネイティブSystemOneプロトコルです。質問はお客様が指定するIDをキーとするマップで、型はnoul(yes、no、unknown)、choice、scoreのいずれかです。回答は同じキーで返されます。
バッファリングのみで、ストリーミング、継続、Idempotency-Keyによる再送には対応しません。画像はassetsに生のbase64で含めます。
認証: AuthorizationヘッダーにBearer形式のAPIキー
リクエストボディ
modelstring必須SystemOneモデルのスラッグ。
stateany必須判定する状況。任意のJSON値(文字列、オブジェクト、配列)。
questionsobject必須idをキーとする1〜32個の質問。
noul{instructions, criteria?: {true?, false?}}、choice{instructions, criteria: 2〜64個の名前付き選択肢}、score{instructions, criteria: 2〜10段階}。assetsobject参照で指定する画像:
{type: image, format: png | jpg | jpeg, data_base64}。1枚あたり最大16MiB、合計32MiB。
レスポンス
200質問IDをキーとする回答。
レスポンス
idstringmodelstringanswersobjectusageobjectプロバイダーの
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/systemone \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "jev-latest",
"state": "Customer: I was charged twice for my October invoice.",
"questions": {
"refund": {"type": "noul", "instructions": "Does the customer want a refund?"},
"team": {"type": "choice", "instructions": "Which team should handle this?",
"criteria": {"billing": "Payments and invoices", "support": "Everything else"}}
}
}'
レスポンス
{
"id": "decision_7f3a9c1e5b2d4086a4e9c1f7b3d5a28e",
"model": "jev-latest",
"answers": {
"refund": {
"type": "noul",
"noul": "true"
},
"team": {
"type": "choice",
"choice": "billing",
"confidence": 0.94,
"probabilities": {
"billing": 0.94,
"support": 0.06
}
}
},
"usage": {
"input_tokens": 74,
"output_tokens": 6,
"cost": 0.0000412,
"is_byok": false
},
"provider": "typesafe"
}https://api.experientiallabs.ai/v1/systemone