Claude Platform Docs

バッチ

メッセージバッチを作成
POST/v1/messages/batches
メッセージバッチを取得
GET/v1/messages/batches/{message_batch_id}
メッセージバッチの一覧
GET/v1/messages/batches
メッセージバッチをキャンセル
POST/v1/messages/batches/{message_batch_id}/cancel
メッセージバッチを削除
DELETE/v1/messages/batches/{message_batch_id}
メッセージバッチの結果を取得
GET/v1/messages/batches/{message_batch_id}/results
Models
DeletedMessageBatch 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".

defaultmessage_batch_deleted
MessageBatch object{ id, archived_at, cancel_initiated_at, 7 more }
MessageBatchCanceledResult object{ type }
type: "canceled"
defaultcanceled
MessageBatchErroredResult object{ error, type }
error: ErrorResponse { error, request_id, type }
error: ErrorObject
One of the following:
request_id: string or null
type: "error"
defaulterror
type: "errored"
defaulterrored
MessageBatchExpiredResult object{ type }
type: "expired"
defaultexpired
MessageBatchIndividualResponse object{ custom_id, result }

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

custom_id: string

Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.

Must be unique for each request within the Message Batch.

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.

One of the following:
MessageBatchRequestCounts 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.

default0
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.

default0
expired: number

Number of requests in the Message Batch that have expired.

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

default0
processing: number

Number of requests in the Message Batch that are processing.

default0
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.

default0
MessageBatchResult = 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.

One of the following:
MessageBatchSucceededResult object{ message, type }
message: Message { id, container, content, 7 more }
type: "succeeded"
defaultsucceeded