# `PhoenixAI.Store.Adapter.TokenUsage`
[🔗](https://github.com/franciscpd/phoenix-ai-store/blob/v0.1.0/lib/phoenix_ai/store/adapter.ex#L117)

Sub-behaviour for adapters that support token usage aggregation.

Used by the TokenBudget guardrail policy to efficiently query
accumulated token counts without loading full message lists.

# `sum_conversation_tokens`

```elixir
@callback sum_conversation_tokens(
  conversation_id :: String.t(),
  keyword()
) :: {:ok, non_neg_integer()} | {:error, term()}
```

# `sum_user_tokens`

```elixir
@callback sum_user_tokens(
  user_id :: String.t(),
  keyword()
) :: {:ok, non_neg_integer()} | {:error, term()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
