Batch

Cancel Batch

Cancel an in-progress batch task. The status will change to cancelling and then to cancelled. Only tasks in validating, in_progress, or finalizing status can be cancelled.

post/v1/batches/{batch_id}/cancel

Request

  • Base URL: https://api.moonshot.ai
  • URL: https://api.moonshot.ai/v1/batches/{batch_id}/cancel
  • Auth: HTTP bearer

Path parameters

batch_idstring required

The ID of the batch task

Response

The cancelled batch task

idstring required

Unique identifier for the batch task

objectstring required

Object type, always batch

endpointstring required

Request endpoint

input_file_idstring required

Input file ID

completion_windowstring required

Processing time window

status'validating' | 'failed' | 'in_progress' | 'finalizing' | 'completed' | 'expired' | 'cancelling' | 'cancelled' required

Current status: validating, failed, in_progress, finalizing, completed, expired, cancelling, cancelled

output_file_idstring nullable

Output file ID for successful results

error_file_idstring nullable

Error file ID for failed results

created_atinteger required

Creation timestamp (Unix)

in_progress_atinteger nullable

Execution start timestamp (Unix)

expires_atinteger nullable

Expiration timestamp (Unix)

finalizing_atinteger nullable

Result preparation start timestamp (Unix)

completed_atinteger nullable

Completion timestamp (Unix)

failed_atinteger nullable

Validation failure timestamp (Unix)

cancelling_atinteger nullable

Cancellation request timestamp (Unix)

cancelled_atinteger nullable

Cancellation completion timestamp (Unix)

metadataobject nullable

Custom metadata

Example response

{
  "object": "batch"
}

Changes

No recorded changes to this operation across all 1 revision of this API.