| 1 |
from typing import Optional |
| 2 |
|
| 3 |
from .._models import BaseModel |
| 4 |
from .server_tool_usage import ServerToolUsage |
| 5 |
from .output_tokens_details import OutputTokensDetails |
| 6 |
|
| 7 |
__all__ = ["MessageDeltaUsage"] |
| 8 |
|
| 9 |
|
| 10 |
class MessageDeltaUsage(BaseModel): |
| 11 |
cache_creation_input_tokens: Optional[int] = None |
| 12 |
"""The cumulative number of input tokens used to create the cache entry.""" |
| 13 |
|
| 14 |
cache_read_input_tokens: Optional[int] = None |
| 15 |
"""The cumulative number of input tokens read from the cache.""" |
| 16 |
|
| 17 |
input_tokens: Optional[int] = None |
| 18 |
"""The cumulative number of input tokens which were used.""" |
| 19 |
|
| 20 |
output_tokens: int |
| 21 |
"""The cumulative number of output tokens which were used.""" |
| 22 |
|
| 23 |
output_tokens_details: Optional[OutputTokensDetails] = None |
| 24 |
"""Breakdown of output tokens by category. |
| 25 |
|
| 26 |
`output_tokens` remains the inclusive, authoritative total used for billing. |
| 27 |
This object provides a read-only decomposition for observability — for example, |
| 28 |
how many of the billed output tokens were spent on internal reasoning that may |
| 29 |
have been summarized before being returned to you. |
| 30 |
""" |
| 31 |
|
| 32 |
server_tool_use: Optional[ServerToolUsage] = None |
| 33 |
"""The number of server tool requests.""" |