Class RawMessageDeltaEvent

    • Constructor Detail

    • Method Detail

      • _type

         final JsonValue _type()

        Expected to always return the following:

        JsonValue.from("message_delta")

        However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).

      • usage

         final MessageDeltaUsage 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 usage will not match one-to-one with the exact visible content of an API request or response.

        For example, output_tokens will 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, and cache_read_input_tokens.

      • validate

         final RawMessageDeltaEvent validate()

        Validates that the types of all values in this object match their expected types recursively.

        This method is not forwards compatible with new types from the API for existing fields.