# `Sycophant.Pricing.Component`

A single pricing component from LLMDB's pricing model.

Components have a `kind` that determines their billing unit:
- `"token"` -- per-token rates (input, output, cache, reasoning)
- `"tool"` -- per-call rates for built-in tools (web_search, file_search, etc.)
- `"image"` -- per-image rates by size/quality
- `"storage"` -- per-unit storage rates

# `t`

```elixir
@type t() :: %Sycophant.Pricing.Component{
  id: String.t() | nil,
  kind: String.t() | nil,
  meter: String.t() | nil,
  notes: String.t() | nil,
  per: pos_integer() | nil,
  rate: number() | nil,
  size_class: String.t() | nil,
  tool: String.t() | nil,
  unit: String.t() | nil
}
```

# `from_llmdb`

```elixir
@spec from_llmdb(map()) :: t()
```

Converts an LLMDB component map (atom-keyed) into a Component struct.

# `from_map`

```elixir
@spec from_map(map()) :: t()
```

Reconstructs a Component struct from a serialized map (string-keyed).

---

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