Interface BatchService
-
- All Implemented Interfaces:
public interface BatchService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBatchService.WithRawResponseA view of BatchService that provides access to raw HTTP responses for each method.
-
Method Summary
Modifier and Type Method Description abstract BatchService.WithRawResponsewithRawResponse()Returns a view of this service that provides access to raw HTTP responses for each method. MessageBatchcreate(BatchCreateParams params)Send a batch of Message creation requests. abstract MessageBatchcreate(BatchCreateParams params, RequestOptions requestOptions)MessageBatchretrieve(BatchRetrieveParams params)This endpoint is idempotent and can be used to poll for Message Batch completion. abstract MessageBatchretrieve(BatchRetrieveParams params, RequestOptions requestOptions)BatchListPagelist()List all Message Batches within a Workspace. abstract BatchListPagelist(BatchListParams params, RequestOptions requestOptions)BatchListPagelist(BatchListParams params)BatchListPagelist(RequestOptions requestOptions)DeletedMessageBatchdelete(BatchDeleteParams params)Delete a Message Batch. abstract DeletedMessageBatchdelete(BatchDeleteParams params, RequestOptions requestOptions)MessageBatchcancel(BatchCancelParams params)Batches may be canceled any time before processing ends. abstract MessageBatchcancel(BatchCancelParams params, RequestOptions requestOptions)StreamResponse<MessageBatchIndividualResponse>resultsStreaming(BatchResultsParams params)Streams the results of a Message Batch as a .jsonlfile.abstract StreamResponse<MessageBatchIndividualResponse>resultsStreaming(BatchResultsParams params, RequestOptions requestOptions)-
-
Method Detail
-
withRawResponse
abstract BatchService.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
create
MessageBatch create(BatchCreateParams params)
Send a batch of Message creation requests.
The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
Learn more about the Message Batches API in our /en/docs/build-with-claude/batch-processing
-
create
abstract MessageBatch create(BatchCreateParams params, RequestOptions requestOptions)
-
retrieve
MessageBatch retrieve(BatchRetrieveParams params)
This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the
results_urlfield in the response.Learn more about the Message Batches API in our /en/docs/build-with-claude/batch-processing
-
retrieve
abstract MessageBatch retrieve(BatchRetrieveParams params, RequestOptions requestOptions)
-
list
BatchListPage list()
List all Message Batches within a Workspace. Most recently created batches are returned first.
Learn more about the Message Batches API in our /en/docs/build-with-claude/batch-processing
-
list
abstract BatchListPage list(BatchListParams params, RequestOptions requestOptions)
-
list
BatchListPage list(BatchListParams params)
-
list
BatchListPage list(RequestOptions requestOptions)
-
delete
DeletedMessageBatch delete(BatchDeleteParams params)
Delete a Message Batch.
Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.
Learn more about the Message Batches API in our /en/docs/build-with-claude/batch-processing
-
delete
abstract DeletedMessageBatch delete(BatchDeleteParams params, RequestOptions requestOptions)
-
cancel
MessageBatch cancel(BatchCancelParams params)
Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a
cancelingstate, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.The number of canceled requests is specified in
request_counts. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.Learn more about the Message Batches API in our /en/docs/build-with-claude/batch-processing
-
cancel
abstract MessageBatch cancel(BatchCancelParams params, RequestOptions requestOptions)
-
resultsStreaming
@MustBeClosed() StreamResponse<MessageBatchIndividualResponse> resultsStreaming(BatchResultsParams params)
Streams the results of a Message Batch as a
.jsonlfile.Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the
custom_idfield to match results to requests.Learn more about the Message Batches API in our /en/docs/build-with-claude/batch-processing
-
resultsStreaming
@MustBeClosed() abstract StreamResponse<MessageBatchIndividualResponse> resultsStreaming(BatchResultsParams params, RequestOptions requestOptions)
-
-
-
-