Home / File/ usage.py — anthropic-sdk-python Source File

usage.py — anthropic-sdk-python Source File

Architecture documentation for usage.py, a python file in the anthropic-sdk-python codebase. 7 imports, 2 dependents.

File python AnthropicClient 7 imports 2 dependents 1 classes

Entity Profile

Dependency Diagram

graph LR
  a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e["usage.py"]
  699c911a_fb78_b883_732f_5ac6bf31d4a3["_models"]
  a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e --> 699c911a_fb78_b883_732f_5ac6bf31d4a3
  9f2b3880_0e8c_98d1_1399_fca73019c7a2["cache_creation.py"]
  a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e --> 9f2b3880_0e8c_98d1_1399_fca73019c7a2
  fdd4ce7d_0941_4785_cd80_220df0c61a38["CacheCreation"]
  a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e --> fdd4ce7d_0941_4785_cd80_220df0c61a38
  b775b1d4_72b6_5c83_0c90_03984dbc3aa7["server_tool_usage.py"]
  a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e --> b775b1d4_72b6_5c83_0c90_03984dbc3aa7
  2ed9a3b4_c55e_1be3_6001_1c37aa7f37ea["ServerToolUsage"]
  a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e --> 2ed9a3b4_c55e_1be3_6001_1c37aa7f37ea
  89ddcdd7_3ae1_4c7b_41bb_9f1e25f16875["typing"]
  a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e --> 89ddcdd7_3ae1_4c7b_41bb_9f1e25f16875
  37c05070_ca59_d596_7250_de9d1939227f["typing_extensions"]
  a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e --> 37c05070_ca59_d596_7250_de9d1939227f
  2eb1aa7f_c778_4d68_0a26_a102fadd9638["__init__.py"]
  2eb1aa7f_c778_4d68_0a26_a102fadd9638 --> a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e
  21a395d8_015e_6c08_b7bd_94e93c67aaf8["message.py"]
  21a395d8_015e_6c08_b7bd_94e93c67aaf8 --> a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e
  style a3d73c4a_4724_f0e3_fa64_0bb3dd55cd5e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing_extensions import Literal

from .._models import BaseModel
from .cache_creation import CacheCreation
from .server_tool_usage import ServerToolUsage

__all__ = ["Usage"]


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."""

Classes

Dependencies

Frequently Asked Questions

What does usage.py do?
usage.py is a source file in the anthropic-sdk-python codebase, written in python. It belongs to the AnthropicClient domain.
What does usage.py depend on?
usage.py imports 7 module(s): CacheCreation, ServerToolUsage, _models, cache_creation.py, server_tool_usage.py, typing, typing_extensions.
What files import usage.py?
usage.py is imported by 2 file(s): __init__.py, message.py.
Where is usage.py in the architecture?
usage.py is located at src/anthropic/types/usage.py (domain: AnthropicClient, directory: src/anthropic/types).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free