Anthropic::Metadata
Request metadata for the Anthropic API.
Contains user_id for end-user identification (used for abuse monitoring)
and an optional custom hash for arbitrary key-value metadata.
Usage
# With user_id only
metadata = Anthropic::Metadata.with_user_id("user-123")
# With user_id and custom fields
metadata = Anthropic::Metadata.new(
user_id: "user-123",
custom: {"session_id" => JSON::Any.new("abc")}
)
Constructors
Instance methods
custom
Sourceuser_id
Source