/v1/batchesCreate a batch
Runs an uploaded JSONL file asynchronously. Every line's body.model must be a batch model, a slug ending in -batch (for example gpt-6-luna-batch); other models are rejected per line with not_batch_callable. One batch runs on one provider.
Rejected lines are listed in errors and skipped; the job fails only when every line is rejected. completion_window is accepted and always reads 24h.
認証: AuthorizationヘッダーにBearer形式のAPIキー
リクエストボディ
input_file_idstring必須The id of a file uploaded with
purpose: batch.endpointenum必須The API every line calls. Which ones a model supports depends on its provider.
completion_windowstringAccepted for compatibility and ignored; always
24h.metadataobjectYour own labels. Values are stored as strings.
レスポンス
200The new batch, status validating.
レスポンス
idstringobjectstringendpointstringerrorsobject | nullRejected input lines:
{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_countsobjectAccepted lines only; rejected lines are in
errors.request_counts
totalintegercompletedintegerfailedinteger
metadataobject | null
400The upload or batch was rejected; the message names the line or field.
レスポンス
errorobjecterror
messagestringWhat went wrong and how to fix it.
typestringFor example
invalid_request_error,authentication_error,permission_error,rate_limit_error,insufficient_quota,api_error.codestringThe stable error code.
paramstring | nullThe request field at fault, when there is one.
refusal_reasonenumPresent only on
code: refusal.
401The key is missing, malformed, expired or revoked.
レスポンス
errorobjecterror
messagestringWhat went wrong and how to fix it.
typestringFor example
invalid_request_error,authentication_error,permission_error,rate_limit_error,insufficient_quota,api_error.codestringThe stable error code.
paramstring | nullThe request field at fault, when there is one.
refusal_reasonenumPresent only on
code: refusal.
402Your credits cannot cover the batch reservation.
レスポンス
errorobjecterror
messagestringWhat went wrong and how to fix it.
typestringFor example
invalid_request_error,authentication_error,permission_error,rate_limit_error,insufficient_quota,api_error.codestringThe stable error code.
paramstring | nullThe request field at fault, when there is one.
refusal_reasonenumPresent only on
code: 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