Claude Platform Docs

배치

메시지 배치 생성
BetaMessageBatch Beta.Messages.Batches.Create(parameters, cancellationToken = default)
POST/v1/messages/batches

메시지 생성 요청의 배치를 전송합니다.

메시지 배치 조회
BetaMessageBatch Beta.Messages.Batches.Retrieve(parameters, cancellationToken = default)
GET/v1/messages/batches/{message_batch_id}

이 엔드포인트는 멱등성(idempotent)을 가지며 메시지 배치 완료 여부를 폴링하는 데 사용할 수 있습니다. 메시지 배치의 결과에 액세스하려면 응답의 results_url 필드로 요청을 보내세요.

메시지 배치 목록 조회
BatchListPage Beta.Messages.Batches.List(parameters, cancellationToken = default)
GET/v1/messages/batches

워크스페이스 내의 모든 메시지 배치를 나열합니다. 가장 최근에 생성된 배치가 먼저 반환됩니다.

메시지 배치 취소
BetaMessageBatch Beta.Messages.Batches.Cancel(parameters, cancellationToken = default)
POST/v1/messages/batches/{message_batch_id}/cancel

배치는 처리가 종료되기 전까지 언제든지 취소할 수 있습니다. 취소가 시작되면 배치는 canceling 상태로 전환되며, 이 시점에서 시스템은 취소를 최종 완료하기 전에 진행 중이며 중단할 수 없는 요청을 먼저 완료할 수 있습니다.

메시지 배치 삭제
BetaDeletedMessageBatch Beta.Messages.Batches.Delete(parameters, cancellationToken = default)
DELETE/v1/messages/batches/{message_batch_id}

메시지 배치를 삭제합니다.

메시지 배치 결과 조회
BetaMessageBatchIndividualResponse Beta.Messages.Batches.ResultsStreaming(parameters, cancellationToken = default)
GET/v1/messages/batches/{message_batch_id}/results

메시지 배치의 결과를 .jsonl 파일로 스트리밍합니다.

Models
class BetaDeletedMessageBatch { Type = "message_batch_deleted"; ID; }
JsonElement Type = "message_batch_deleted"

Deleted object type.

For Message Batches, this is always "message_batch_deleted".

required string ID

ID of the Message Batch.

class BetaMessageBatch { Type = "message_batch"; ID; ArchivedAt; /* 7 more */ }
class BetaMessageBatchCanceledResult { Type = "canceled"; }
JsonElement Type = "canceled"
class BetaMessageBatchErroredResult { Type = "errored"; Error; }
JsonElement Type = "errored"
required BetaErrorResponse Error
JsonElement Type = "error"
required BetaError Error
One of the following:
required string? RequestID
class BetaMessageBatchExpiredResult { Type = "expired"; }
JsonElement Type = "expired"
class BetaMessageBatchIndividualResponse { CustomID; Result; }

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

required string CustomID

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.

required BetaMessageBatchResult Result

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:
class BetaMessageBatchRequestCounts { Canceled; Errored; Expired; /* 2 more */ }
required long Canceled

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

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

required long Errored

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

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

required long Expired

Number of requests in the Message Batch that have expired.

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

required long Processing

Number of requests in the Message Batch that are processing.

required long Succeeded

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

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

class BetaMessageBatchResult: union

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.

class BetaMessageBatchSucceededResult { Type = "succeeded"; Message; }
JsonElement Type = "succeeded"
required BetaMessage Message