Class BetaRawMessageDeltaEvent.Builder
-
- All Implemented Interfaces:
public final class BetaRawMessageDeltaEvent.BuilderA builder for BetaRawMessageDeltaEvent.
-
-
Method Summary
-
-
Method Detail
-
contextManagement
final BetaRawMessageDeltaEvent.Builder contextManagement(BetaContextManagementResponse contextManagement)
Information about context management strategies applied during the request
-
contextManagement
final BetaRawMessageDeltaEvent.Builder contextManagement(Optional<BetaContextManagementResponse> contextManagement)
Alias for calling Builder.contextManagement with
contextManagement.orElse(null).
-
contextManagement
final BetaRawMessageDeltaEvent.Builder contextManagement(JsonField<BetaContextManagementResponse> contextManagement)
Sets Builder.contextManagement to an arbitrary JSON value.
You should usually call Builder.contextManagement with a well-typed BetaContextManagementResponse value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
delta
final BetaRawMessageDeltaEvent.Builder delta(BetaRawMessageDeltaEvent.Delta delta)
-
delta
final BetaRawMessageDeltaEvent.Builder delta(JsonField<BetaRawMessageDeltaEvent.Delta> delta)
Sets Builder.delta to an arbitrary JSON value.
You should usually call Builder.delta with a well-typed Delta value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
type
final BetaRawMessageDeltaEvent.Builder type(JsonValue type)
Sets the field to an arbitrary JSON value.
It is usually unnecessary to call this method because the field defaults to the following:
JsonValue.from("message_delta")This method is primarily for setting the field to an undocumented or not yet supported value.
-
usage
final BetaRawMessageDeltaEvent.Builder usage(BetaMessageDeltaUsage usage)
Billing and rate-limit usage.
Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in
usagewill not match one-to-one with the exact visible content of an API request or response.For example,
output_tokenswill be non-zero, even for an empty string response from Claude.Total input tokens in a request is the summation of
input_tokens,cache_creation_input_tokens, andcache_read_input_tokens.
-
usage
final BetaRawMessageDeltaEvent.Builder usage(JsonField<BetaMessageDeltaUsage> usage)
Sets Builder.usage to an arbitrary JSON value.
You should usually call Builder.usage with a well-typed BetaMessageDeltaUsage value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
inputTransformations
final BetaRawMessageDeltaEvent.Builder inputTransformations(List<BetaInputTransformation> inputTransformations)
Changes the API made to the request's input before showing it to the model, and blocks that failed a binding check but were left unchanged: one entry per block, in request order. Two entry types today.
thinking_dropped— athinking,redacted_thinkingorconnector_textblock from the request'smessagesthat was removed from the prompt instead of being shown to the model because it failed a binding check.thinking_mismatch_allowed— athinkingorredacted_thinkingblock that failed the conversation check (the conversation before it differs from the one it was created in, or it carries no record of one on a model that requires it) and was shown to the model all the same, because that check is not enforced for this request. More entry types may be added over time; ignore types you do not recognize.Requires
anthropic-beta: thinking-binding-controls-2026-08-01. Present on every such response from a model that supports extended thinking, as[]when there is no entry to report; without the beta, blocks are removed or left in place all the same but nothing is reported. Removed blocks contribute nothing tousage.input_tokens; blocks left in place count as sent. When streaming, the array is final inmessage_start; the finalmessage_deltaevent carries it only when a server-side model fallback happened mid-stream, in which case it holds the serving model's entries and replaces the one inmessage_start.
-
inputTransformations
final BetaRawMessageDeltaEvent.Builder inputTransformations(Optional<List<BetaInputTransformation>> inputTransformations)
Alias for calling Builder.inputTransformations with
inputTransformations.orElse(null).
-
inputTransformations
final BetaRawMessageDeltaEvent.Builder inputTransformations(JsonField<List<BetaInputTransformation>> inputTransformations)
Sets Builder.inputTransformations to an arbitrary JSON value.
You should usually call Builder.inputTransformations with a well-typed
List<BetaInputTransformation>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final BetaRawMessageDeltaEvent.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
addInputTransformation
final BetaRawMessageDeltaEvent.Builder addInputTransformation(BetaInputTransformation inputTransformation)
Adds a single BetaInputTransformation to inputTransformations.
-
addInputTransformation
final BetaRawMessageDeltaEvent.Builder addInputTransformation(BetaThinkingDroppedInputTransformation thinkingDropped)
Alias for calling addInputTransformation with
BetaInputTransformation.ofThinkingDropped(thinkingDropped).
-
addInputTransformation
final BetaRawMessageDeltaEvent.Builder addInputTransformation(BetaThinkingMismatchAllowedInputTransformation thinkingMismatchAllowed)
Alias for calling addInputTransformation with
BetaInputTransformation.ofThinkingMismatchAllowed(thinkingMismatchAllowed).
-
putAdditionalProperty
final BetaRawMessageDeltaEvent.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final BetaRawMessageDeltaEvent.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final BetaRawMessageDeltaEvent.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final BetaRawMessageDeltaEvent.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final BetaRawMessageDeltaEvent build()
Returns an immutable instance of BetaRawMessageDeltaEvent.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.contextManagement() .delta() .usage()
-
-
-
-