Skip to content

TokenCount

Base classes

Name Children Inherits
dict
builtins
dict() -> new empty dictionary

⋔ Inheritance diagram

graph TD
  95970871583520["field_meta.TokenCount"]
  125067848556736["builtins.dict"]
  125067848591872["builtins.object"]
  125067848556736 --> 95970871583520
  125067848591872 --> 125067848556736

🛈 DocStrings

Bases: TypedDict

Token counts of a turn or model (shape shared by claude-agent-acp and codex-acp).

Source code in src/aclientp/schema/field_meta.py
class TokenCount(TypedDict):
    """Token counts of a turn or model (shape shared by claude-agent-acp and codex-acp)."""

    totalTokens: int
    """All tokens, including cache reads and writes."""

    inputTokens: int
    """Uncached input tokens."""

    cachedInputTokens: int
    """Cache reads."""

    cachedWriteTokens: NotRequired[int]
    """Cache writes (claude-agent-acp only)."""

    outputTokens: int
    """Output tokens."""

    reasoningOutputTokens: int
    """Reasoning tokens (always ``0`` for Claude, which counts them as output)."""

cachedInputTokens instance-attribute

cachedInputTokens: int

Cache reads.

cachedWriteTokens instance-attribute

cachedWriteTokens: NotRequired[int]

Cache writes (claude-agent-acp only).

inputTokens instance-attribute

inputTokens: int

Uncached input tokens.

outputTokens instance-attribute

outputTokens: int

Output tokens.

reasoningOutputTokens instance-attribute

reasoningOutputTokens: int

Reasoning tokens (always 0 for Claude, which counts them as output).

totalTokens instance-attribute

totalTokens: int

All tokens, including cache reads and writes.

:fa-brands-github: Show source on GitHub