Class AnthropicUsage

java.lang.Object
dev.langchain4j.model.anthropic.internal.api.AnthropicUsage

public class AnthropicUsage extends Object
Represents token usage statistics from an Anthropic API response.

Tracks input and output token counts, including cache-related token usage for prompt caching features.

  • Field Details

    • inputTokens

      public Integer inputTokens
      The number of input tokens consumed.
    • outputTokens

      public Integer outputTokens
      The number of output tokens generated.
    • cacheCreationInputTokens

      public Integer cacheCreationInputTokens
      The number of tokens used to create cache entries.
    • cacheReadInputTokens

      public Integer cacheReadInputTokens
      The number of tokens read from cache.
  • Constructor Details

    • AnthropicUsage

      public AnthropicUsage()
  • Method Details