Batch - Get
Gets details for a single batch specified by the given batch-id.
GET {endpoint}/openai/batches/{batch-id}?api-version=2024-08-01-preview
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
batch-id
|
path | True |
string |
The identifier of the batch. |
endpoint
|
path | True |
string url |
Supported Cognitive Services endpoints (protocol and hostname, for example: https://aoairesource.openai.azure.com. Replace "aoairesource" with your Azure OpenAI account name). |
api-version
|
query | True |
string |
The requested API version. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Success |
|
Other Status Codes |
An error occurred. |
Security
api-key
API key authentication
Type:
apiKey
In:
header
OAuth2Auth
OAuth2 authentication
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Scopes
Name | Description |
---|---|
https://cognitiveservices.azure.com/.default |
Examples
Getting a batch.
Sample request
GET https://aoairesource.openai.azure.com/openai/batches/batch_72a2792ef7d24ba7b82c7fe4a37e379f?api-version=2024-08-01-preview
Sample response
{
"object": "batch",
"id": "batch_72a2792ef7d24ba7b82c7fe4a37e379f",
"endpoint": "/chat/completions",
"errors": null,
"input_file_id": "file-b4fa7277f3eb4722ac18b90f46102c3f",
"completion_window": "24h",
"status": "completed",
"output_file_id": "file-f2ddaf43-b48b-46dd-b264-90da10c7a85b",
"error_file_id": "file-c3b563b0-ebc7-47da-93e3-a2fa694aef0c",
"created_at": 1646126127,
"in_progress_at": 1646126130,
"expires_at": 1646126170,
"finalizing_at": 1646126134,
"completed_at": 1646126136,
"failed_at": null,
"expired_at": null,
"cancelling_at": null,
"cancelled_at": null,
"request_counts": {
"total": 500,
"completed": 400,
"failed": 100
},
"metadata": {
"batch_description": "Evaluation job"
}
}
Definitions
Name | Description |
---|---|
Batch |
Batch |
Batch |
BatchErrorData |
Batch |
BatchErrors |
Batch |
BatchRequestCounts |
Batch |
BatchStatus |
Error |
Error |
Error |
ErrorCode |
Error |
ErrorResponse |
Inner |
InnerError |
Inner |
InnerErrorCode |
Type |
TypeDiscriminator |
Batch
Batch
Name | Type | Description |
---|---|---|
cancelled_at |
integer |
A timestamp when this batch was cancelled (in unix epochs). |
cancelling_at |
integer |
A timestamp when this batch started cancelling (in unix epochs). |
completed_at |
integer |
A timestamp when this batch was completed (in unix epochs). |
completion_window |
string |
The time frame within which the batch should be processed. |
created_at |
integer |
A timestamp when this batch was created (in unix epochs). |
endpoint |
string |
The API endpoint used by the batch. |
error_file_id |
string |
The ID of the file containing outputs of requests with errors. |
errors |
BatchErrors |
|
expired_at |
integer |
A timestamp when this batch expired (in unix epochs). |
expires_at |
integer |
A timestamp when this batch will expire (in unix epochs). |
failed_at |
integer |
A timestamp when this batch failed (in unix epochs). |
finalizing_at |
integer |
A timestamp when this batch started finalizing (in unix epochs). |
id |
string |
The identity of this item. |
in_progress_at |
integer |
A timestamp when this batch started progressing (in unix epochs). |
input_file_id |
string |
The ID of the input file for the batch. |
metadata |
object |
A set of key-value pairs that can be attached to the batch. This can be useful for storing additional information about the batch in a structured format. |
object |
TypeDiscriminator |
|
output_file_id |
string |
The ID of the file containing outputs of successfully executed requests. |
request_counts |
BatchRequestCounts |
|
status |
BatchStatus |
BatchErrorData
BatchErrorData
Name | Type | Description |
---|---|---|
code |
string |
An error code identifying the error type. |
line |
string |
The line number of the input file where the error occurred, if applicable (can be null). |
message |
string |
A human-readable message providing more details about the error. |
param |
string |
The name of the parameter that caused the error, if applicable (can be null). |
BatchErrors
BatchErrors
Name | Type | Description |
---|---|---|
data |
BatchErrorData |
|
object |
string |
The type of the errors object. This is always 'list'. |
BatchRequestCounts
BatchRequestCounts
Name | Type | Description |
---|---|---|
completed |
integer |
The number of requests in the batch that have been completed successfully. |
failed |
integer |
The number of requests in the batch that have failed. |
total |
integer |
The total number of requests in the batch. |
BatchStatus
BatchStatus
Name | Type | Description |
---|---|---|
cancelled |
string |
The batch was cancelled. |
cancelling |
string |
Cancellation of the batch has been initiated. |
completed |
string |
The batch has been completed and the results are ready. |
expired |
string |
The batch was not able to complete within the 24-hour time window. |
failed |
string |
The input file has failed the validation process. |
finalizing |
string |
The batch has completed and the results are being prepared. |
in_progress |
string |
The input file was successfully validated and the batch is currently being executed. |
validating |
string |
The input file is being validated before the batch can begin. |
Error
Error
Name | Type | Description |
---|---|---|
code |
ErrorCode |
|
details |
Error[] |
The error details if available. |
innererror |
InnerError |
|
message |
string |
The message of this error. |
target |
string |
The location where the error happened if available. |
ErrorCode
ErrorCode
Name | Type | Description |
---|---|---|
conflict |
string |
The requested operation conflicts with the current resource state. |
contentFilter |
string |
Image generation failed as a result of our safety system. |
fileImportFailed |
string |
Import of file failed. |
forbidden |
string |
The operation is forbidden for the current user/api key. |
internalFailure |
string |
Internal error. Please retry. |
invalidPayload |
string |
The request data is invalid for this operation. |
itemDoesAlreadyExist |
string |
The item does already exist. |
jsonlValidationFailed |
string |
Validation of jsonl data failed. |
notFound |
string |
The resource is not found. |
quotaExceeded |
string |
Quota exceeded. |
serviceUnavailable |
string |
The service is currently not available. |
tooManyRequests |
string |
Too many requests. Please retry later. |
unauthorized |
string |
The current user/api key is not authorized for the operation. |
unexpectedEntityState |
string |
The operation cannot be executed in the current resource's state. |
ErrorResponse
ErrorResponse
Name | Type | Description |
---|---|---|
error |
Error |
InnerError
InnerError
Name | Type | Description |
---|---|---|
code |
InnerErrorCode |
|
innererror |
InnerError |
InnerErrorCode
InnerErrorCode
Name | Type | Description |
---|---|---|
invalidPayload |
string |
The request data is invalid for this operation. |
TypeDiscriminator
TypeDiscriminator
Name | Type | Description |
---|---|---|
file |
string |
This object represents a file. |
fine_tuning.job |
string |
This object represents a fine tune job. |
fine_tuning.job.checkpoint |
string |
This object represents a checkpoint of a fine tuning job. |
fine_tuning.job.event |
string |
This object represents an event of a fine tuning job. |
list |
string |
This object represents a list of other objects. |
model |
string |
This object represents a model (can be a base model or fine tune job result). |
upload |
string |
This object represents a file upload. |
upload.part |
string |
This object represents part of a file upload. |