BetaMessageDeltaUsage Class — anthropic-sdk-python Architecture
Architecture documentation for the BetaMessageDeltaUsage class in beta_message_delta_usage.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD f97f5e05_eb54_210b_8a35_62c38a15cbaf["BetaMessageDeltaUsage"] 17ce5647_6f06_0676_a4a5_e378a3f57cb1["BaseModel"] f97f5e05_eb54_210b_8a35_62c38a15cbaf -->|extends| 17ce5647_6f06_0676_a4a5_e378a3f57cb1 97dd8438_3d35_5356_8fdc_49ec321a6e2b["beta_message_delta_usage.py"] f97f5e05_eb54_210b_8a35_62c38a15cbaf -->|defined in| 97dd8438_3d35_5356_8fdc_49ec321a6e2b
Relationship Graph
Source Code
src/anthropic/types/beta/beta_message_delta_usage.py lines 12–37
class BetaMessageDeltaUsage(BaseModel):
cache_creation_input_tokens: Optional[int] = None
"""The cumulative number of input tokens used to create the cache entry."""
cache_read_input_tokens: Optional[int] = None
"""The cumulative number of input tokens read from the cache."""
input_tokens: Optional[int] = None
"""The cumulative number of input tokens which were used."""
iterations: Optional[BetaIterationsUsage] = None
"""Per-iteration token usage breakdown.
Each entry represents one sampling iteration, with its own input/output token
counts and cache statistics. This allows you to:
- Determine which iterations exceeded long context thresholds (>=200k tokens)
- Calculate the true context window size from the last iteration
- Understand token accumulation across server-side tool use loops
"""
output_tokens: int
"""The cumulative number of output tokens which were used."""
server_tool_use: Optional[BetaServerToolUsage] = None
"""The number of server tool requests."""
Domain
Extends
Source
Frequently Asked Questions
What is the BetaMessageDeltaUsage class?
BetaMessageDeltaUsage is a class in the anthropic-sdk-python codebase, defined in src/anthropic/types/beta/beta_message_delta_usage.py.
Where is BetaMessageDeltaUsage defined?
BetaMessageDeltaUsage is defined in src/anthropic/types/beta/beta_message_delta_usage.py at line 12.
What does BetaMessageDeltaUsage extend?
BetaMessageDeltaUsage extends BaseModel.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free