Error Codes
Batch API error responses use the OpenAI shape
{"error": {"message", "type", "param", "code"}}. For the format description, see API Overview · Response Format. The codes are summarized below bycode.
Permissions
Files and batches are isolated strictly by API Key. Accessing a resource that does not belong to the current API Key always returns 404 (file_not_found / batch_not_found), including for other API Keys under the same account or the same enterprise. 403 is never returned, and the API never reveals whether the resource exists. See API Overview · Data Visibility.
Error Code List
| HTTP | code | Description | Common endpoints |
|---|---|---|---|
| 400 | invalid_request | Invalid request body/parameters, or a business parameter error | Create |
| 400 | invalid_batch | File structure violates Batch constraints (multiple models, multiple endpoints, missing/duplicate/oversized custom_id, method not POST, url inconsistent with endpoint, completion_window not 24h, metadata exceeding limits, etc.) | Create |
| 400 | invalid_purpose | purpose is not batch | Upload, Create |
| 400 | invalid_jsonl | The file is not valid JSONL, or a single row exceeds 8 MB | Upload, Create |
| 400 | empty_file | The file contains no valid rows | Upload, Create |
| 400 | too_many_rows | The number of valid rows exceeds the limit | Upload, Create |
| 400 | file_too_large | The file size in bytes exceeds the limit | Upload |
| 400 | missing_file | The file form parameter is missing | Upload |
| 400 | missing_input_file_id | input_file_id is missing | Create |
| 400 | missing_endpoint | endpoint is missing | Create |
| 400 | invalid_limit | limit is not a positive integer | List |
| 400 | invalid_after | The after cursor is invalid or points to an object that does not exist | List |
| 400 | batch_not_cancellable | The batch has already finished or is generating results, so it cannot be cancelled | Cancel |
| 402 | insufficient_quota | The balance is insufficient to pay for this batch | Create |
| 403 | no_batch_group | Batch is not enabled for the current API Key; contact the platform to enable it | All |
| 403 | no_batch_channel | The current configuration does not support Batch; contact the platform to confirm | Upload, Create |
| 403 | model_access_denied | No permission to access the models in the file | Create |
| 403 | permission_denied | No permission to perform this operation | Create |
| 404 | file_not_found | The file does not exist, does not belong to the current API Key, or has expired | Files API, Create |
| 404 | batch_not_found | The batch does not exist or does not belong to the current API Key | Batches API |
| 409 | file_in_use | The file is still used by an unfinished batch, or the batch results have not finished processing | Delete file |
| 413 | file_too_large | The uploaded content exceeds the size limit | Upload |
| 429 | batch_limit_exceeded | The Batch submission limit of the current API Key is exceeded; wait for existing batches to finish or reduce the submission volume | Create |
| 429 | rate_limit_check_failed | Model request rate limit triggered | All |
| 500 | internal_error | Internal service error | All |
| 503 | object_storage_unconfigured | The Batch service is temporarily unavailable | Upload, Create |
| 503 | batch_create_budget_exceeded | Batch creation timed out; retry later or use a smaller file | Create |
| 503 | service_unavailable | The service is temporarily unavailable; retry later | Create |
