class Anthropic::Resources::Beta::Messages::Batches

def list(params = {})

Other tags:
    See: Anthropic::Models::Beta::Messages::BatchListParams -

Returns:
  • (Anthropic::Internal::Page) -

Parameters:
  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • betas (Array) -- Header param: Optional header to specify the beta version(s) you want to use.
  • limit (Integer) -- Query param: Number of items to return per page.
  • before_id (String) -- Query param: ID of the object to use as a cursor for pagination. When provided,
  • after_id (String) -- Query param: ID of the object to use as a cursor for pagination. When provided,

Overloads:
  • list(after_id: nil, before_id: nil, limit: nil, betas: nil, request_options: {})
def list(params = {})
  parsed, options = Anthropic::Beta::Messages::BatchListParams.dump_request(params)
  query_params = [:after_id, :before_id, :limit]
  @client.request(
    method: :get,
    path: "v1/messages/batches?beta=true",
    query: parsed.slice(*query_params),
    headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"),
    page: Anthropic::Internal::Page,
    model: Anthropic::Beta::Messages::BetaMessageBatch,
    options: {extra_headers: {"anthropic-beta" => "message-batches-2024-09-24"}, **options}
  )
end