/v1/batchesバッチを作成
アップロードされたJSONLファイルを非同期に実行します。各行のbody.modelはバッチモデル、つまり-batchで終わるスラッグ(例:gpt-6-luna-batch)である必要があります。他のモデルは行ごとにnot_batch_callableで拒否されます。1つのバッチは1つのプロバイダーで実行されます。
拒否された行はerrorsに一覧され、スキップされます。ジョブが失敗するのは、すべての行が拒否された場合のみです。completion_windowは受け付けますが、値は常に24hです。
認証: AuthorizationヘッダーにBearer形式のAPIキー
リクエストボディ
input_file_idstring必須purpose: batchでアップロードしたファイルのID。endpointenum必須各行が呼び出すAPI。モデルが対応するAPIはプロバイダーによって異なります。
completion_windowstring互換性のために受け付けますが、無視されます。常に
24hです。metadataobjectお客様独自のラベル。値は文字列として保存されます。
レスポンス
200ステータスがvalidatingの新しいバッチ。
レスポンス
idstringobjectstringendpointstringerrorsobject | null拒否された入力行:
{object: list, data: [{code, message, line, custom_id}]}。input_file_idstringcompletion_windowstringstatusenumoutput_file_idstring | nullerror_file_idstring | nullcreated_atintegerexpires_atinteger | nullcompleted_atinteger | nullfailed_atinteger | nullexpired_atinteger | nullcancelled_atinteger | nullrequest_countsobject受け付けた行のみ。拒否された行は
errorsに含まれます。request_counts
totalintegercompletedintegerfailedinteger
metadataobject | null
400アップロードまたはバッチが拒否されました。メッセージに行またはフィールドが示されます。
レスポンス
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クレジットがバッチの予約額に足りません。
レスポンス
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/batches \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"input_file_id": "file_3f9a1c0e7b2d4a6f8e1c2b3d", "endpoint": "/v1/chat/completions", "completion_window": "24h"}'
レスポンス
{
"id": "batch_9c2e4b7a1f0d3e6c5b8a2d4f",
"object": "batch",
"endpoint": "/v1/chat/completions",
"errors": null,
"input_file_id": "file_3f9a1c0e7b2d4a6f8e1c2b3d",
"completion_window": "24h",
"status": "validating",
"output_file_id": null,
"error_file_id": null,
"created_at": 1795132800,
"expires_at": 1795219200,
"completed_at": null,
"failed_at": null,
"expired_at": null,
"cancelled_at": null,
"request_counts": {
"total": 2,
"completed": 0,
"failed": 0
},
"metadata": {
"job": "nightly"
}
}https://api.experientiallabs.ai/v1/batches