Interface BatchServiceAsync
-
- All Implemented Interfaces:
public interface BatchServiceAsync
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBatchServiceAsync.WithRawResponseA view of BatchServiceAsync that provides access to raw HTTP responses for each method.
-
Method Summary
-
-
Method Detail
-
withRawResponse
abstract BatchServiceAsync.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
create
CompletableFuture<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 CompletableFuture<MessageBatch> create(BatchCreateParams params, RequestOptions requestOptions)
-
retrieve
CompletableFuture<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 CompletableFuture<MessageBatch> retrieve(BatchRetrieveParams params, RequestOptions requestOptions)
-
list
CompletableFuture<BatchListPageAsync> 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 CompletableFuture<BatchListPageAsync> list(BatchListParams params, RequestOptions requestOptions)
-
list
CompletableFuture<BatchListPageAsync> list(BatchListParams params)
-
list
CompletableFuture<BatchListPageAsync> list(RequestOptions requestOptions)
-
delete
CompletableFuture<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 CompletableFuture<DeletedMessageBatch> delete(BatchDeleteParams params, RequestOptions requestOptions)
-
cancel
CompletableFuture<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 CompletableFuture<MessageBatch> cancel(BatchCancelParams params, RequestOptions requestOptions)
-
resultsStreaming
AsyncStreamResponse<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
abstract AsyncStreamResponse<MessageBatchIndividualResponse> resultsStreaming(BatchResultsParams params, RequestOptions requestOptions)
-
-
-
-