次の方法で共有


Batch - Cancel

Cancels the processing of the batch specified by the given batch-id.

POST {endpoint}/openai/batches/{batch-id}/cancel?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

Batch

The batch has been successfully canceled.

Other Status Codes

ErrorResponse

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

Canceling a batch.

Sample request

POST https://aoairesource.openai.azure.com/openai/batches/batch_72a2792ef7d24ba7b82c7fe4a37e379f/cancel?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": "cancelling",
  "output_file_id": null,
  "error_file_id": null,
  "created_at": 1646126127,
  "in_progress_at": 1646126130,
  "expires_at": 1646126170,
  "finalizing_at": null,
  "completed_at": null,
  "failed_at": null,
  "expired_at": null,
  "cancelling_at": 1646126138,
  "cancelled_at": null,
  "request_counts": {
    "total": 500,
    "completed": 100,
    "failed": 5
  },
  "metadata": {
    "batch_description": "Evaluation job"
  }
}

Definitions

Name Description
Batch

Batch

BatchErrorData

BatchErrorData

BatchErrors

BatchErrors

BatchRequestCounts

BatchRequestCounts

BatchStatus

BatchStatus

Error

Error

ErrorCode

ErrorCode

ErrorResponse

ErrorResponse

InnerError

InnerError

InnerErrorCode

InnerErrorCode

TypeDiscriminator

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

BatchErrors
For batches that have failed, this will contain more information on the cause of the failures.

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

TypeDiscriminator
Defines the type of an object.

output_file_id

string

The ID of the file containing outputs of successfully executed requests.

request_counts

BatchRequestCounts

BatchRequestCounts
The request counts for different statuses within the batch.

status

BatchStatus

BatchStatus
The status of a batch.

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

BatchErrorData
Error information for a failure in batch.

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

ErrorCode
Error codes as defined in the Microsoft REST guidelines (https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses).

details

Error[]

The error details if available.

innererror

InnerError

InnerError
Inner error as defined in the Microsoft REST guidelines (https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses).

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

Error
Error content as defined in the Microsoft REST guidelines (https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses).

InnerError

InnerError

Name Type Description
code

InnerErrorCode

InnerErrorCode
Inner error codes as defined in the Microsoft REST guidelines (https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses).

innererror

InnerError

InnerError
Inner error as defined in the Microsoft REST guidelines (https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses).

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.