class

Anthropic::Beta::BatchesAPI

Inherits Reference < Object

Beta namespace wrapper for Messages Batches API.

Provides access to the Messages Batches API through the beta namespace, automatically merging beta headers into all requests.

Usage

client = Anthropic::Client.new

# Access batches through beta namespace
batch = client.beta.messages.batches.create(request)

# With custom beta headers
batch = client.beta(["custom-feature"]).messages.batches.create(request)

Constructors

new(client : Client, namespace_beta_headers : Array(String))
Source

Instance methods

cancel(batch_id : String, request_options : RequestOptions | Nil = nil) : MessageBatch

Cancel a batch that is in progress.

Source
create(request : CreateMessageBatchRequest, request_options : RequestOptions | Nil = nil) : MessageBatch

Create a new message batch for asynchronous processing.

Source
create(requests : Array(CreateMessageBatchRequest::BatchRequest), request_options : RequestOptions | Nil = nil) : MessageBatch

Create a batch from an array of batch requests.

Source
delete(batch_id : String, request_options : RequestOptions | Nil = nil) : MessageBatchDeleted

Delete a message batch.

Source
list(params : ListParams = ListParams.new, request_options : RequestOptions | Nil = nil) : Page(MessageBatch)

List all message batches with pagination.

Source
list_all(limit : Int32 | Nil = nil, request_options : RequestOptions | Nil = nil) : AutoPaginator(MessageBatch)

Auto-paginating iterator for listing all message batches.

Source
results(batch_id : String, request_options : RequestOptions | Nil = nil, &block : MessageBatchResult -> ) : Nil

Get results for a completed batch.

Source
retrieve(batch_id : String, request_options : RequestOptions | Nil = nil) : MessageBatch

Retrieve a specific batch by ID.

Source