Usage Class — anthropic-sdk-python Architecture
Architecture documentation for the Usage class in usage.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD 83325191_652d_66a8_5e97_acb665f88372["Usage"] 17ce5647_6f06_0676_a4a5_e378a3f57cb1["BaseModel"] 83325191_652d_66a8_5e97_acb665f88372 -->|extends| 17ce5647_6f06_0676_a4a5_e378a3f57cb1 a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e["usage.py"] 83325191_652d_66a8_5e97_acb665f88372 -->|defined in| a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e
Relationship Graph
Source Code
src/anthropic/types/usage.py lines 13–36
class Usage(BaseModel):
cache_creation: Optional[CacheCreation] = None
"""Breakdown of cached tokens by TTL"""
cache_creation_input_tokens: Optional[int] = None
"""The number of input tokens used to create the cache entry."""
cache_read_input_tokens: Optional[int] = None
"""The number of input tokens read from the cache."""
inference_geo: Optional[str] = None
"""The geographic region where inference was performed for this request."""
input_tokens: int
"""The number of input tokens which were used."""
output_tokens: int
"""The number of output tokens which were used."""
server_tool_use: Optional[ServerToolUsage] = None
"""The number of server tool requests."""
service_tier: Optional[Literal["standard", "priority", "batch"]] = None
"""If the request used the priority, standard, or batch tier."""
Domain
Defined In
Extends
Source
Frequently Asked Questions
What is the Usage class?
Usage is a class in the anthropic-sdk-python codebase, defined in src/anthropic/types/usage.py.
Where is Usage defined?
Usage is defined in src/anthropic/types/usage.py at line 13.
What does Usage extend?
Usage extends BaseModel.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free