Anthropic::Beta::MessagesAPI
Beta namespace wrapper for Messages API.
Provides access to Messages API methods and sub-resources (e.g. batches) through the beta namespace, automatically merging beta headers into all requests.
Usage
client = Anthropic::Client.new
# Access messages API with beta headers
response = client.beta.messages.create(request)
# Stream with beta headers
client.beta.messages.stream(request) { |event| puts event }
# Access batches through beta.messages namespace
batch = client.beta.messages.batches.create(request)
# With custom beta headers
batch = client.beta(["custom-feature"]).messages.batches.list
Constructors
Instance methods
Access the Batches API through the beta messages namespace.
Returns a Beta::BatchesAPI that automatically merges beta headers
into all batch requests.
Example:
client.beta.messages.batches.create(request)
client.beta(["custom-beta"]).messages.batches.list
Count tokens with beta headers automatically merged.
Beta namespace headers are merged with any per-request options.
See Messages::API#count_tokens for full parameter documentation.
Count tokens with beta headers automatically merged (convenience overload).
Beta namespace headers are merged with any per-request options.
See Messages::API#count_tokens for full parameter documentation.
Create a message with beta headers automatically merged (convenience overload).
Beta namespace headers are merged with any per-request options.
See Messages::API#create for full parameter documentation.
Create a message with beta headers automatically merged.
Beta namespace headers are merged with any per-request options.
See Messages::API#create for full parameter documentation.
Stream a message with beta headers automatically merged (convenience overload).
Beta namespace headers are merged with any per-request options.
See Messages::API#stream for full parameter documentation.
Stream a message with beta headers automatically merged.
Beta namespace headers are merged with any per-request options.
See Messages::API#stream for full parameter documentation.