# `Gemini.Types.Interactions.CachedTokensByModality`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/interactions/usage.ex#L1)

Cached token count for a response modality.

# `modality`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/interactions/usage.ex#L10)

```elixir
@type modality() :: String.t()
```

# `t`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/interactions/usage.ex#L13)

```elixir
@type t() :: %Gemini.Types.Interactions.CachedTokensByModality{
  modality: modality() | nil,
  tokens: non_neg_integer() | nil
}
```

# `from_api`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/interactions/usage.ex#L19)

```elixir
@spec from_api(map() | nil) :: t() | nil
```

# `to_api`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/interactions/usage.ex#L30)

```elixir
@spec to_api(t() | map() | nil) :: map() | nil
```

---

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