Claude Platform Docs

Batches

Create a Message Batch
$ ant messages:batches create
POST/v1/messages/batches
Retrieve a Message Batch
$ ant messages:batches retrieve
GET/v1/messages/batches/{message_batch_id}
List Message Batches
$ ant messages:batches list
GET/v1/messages/batches
Cancel a Message Batch
$ ant messages:batches cancel
POST/v1/messages/batches/{message_batch_id}/cancel
Delete a Message Batch
$ ant messages:batches delete
DELETE/v1/messages/batches/{message_batch_id}
Retrieve Message Batch results
$ ant messages:batches results
GET/v1/messages/batches/{message_batch_id}/results
Models
deleted_message_batch: object{ id, type }
id: string

ID of the Message Batch.

type: "message_batch_deleted"

Deleted object type.

For Message Batches, this is always "message_batch_deleted".

message_batch: object{ id, archived_at, cancel_initiated_at, 7 more }
message_batch_canceled_result: object{ type }
type: "canceled"
message_batch_errored_result: object{ error, type }
message_batch_expired_result: object{ type }
type: "expired"
message_batch_individual_response: object{ custom_id, result }

This is a single line in the response .jsonl file and does not represent the response as a whole.

message_batch_request_counts: object{ canceled, errored, expired, 2 more }
canceled: number

Number of requests in the Message Batch that have been canceled.

This is zero until processing of the entire Message Batch has ended.

errored: number

Number of requests in the Message Batch that encountered an error.

This is zero until processing of the entire Message Batch has ended.

expired: number

Number of requests in the Message Batch that have expired.

This is zero until processing of the entire Message Batch has ended.

processing: number

Number of requests in the Message Batch that are processing.

succeeded: number

Number of requests in the Message Batch that have completed successfully.

This is zero until processing of the entire Message Batch has ended.

message_batch_result: MessageBatchSucceededResult { message, type } or MessageBatchErroredResult { error, type } or MessageBatchCanceledResult { type } or MessageBatchExpiredResult { type }

Processing result for this request.

Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.

message_batch_succeeded_result: object{ message, type }