# `Raxol.AgentClientProtocol.Schema.Cost`
[🔗](https://github.com/DROOdotFOO/raxol-agent/blob/raxol_agent_client_protocol-v0.1.0/packages/raxol_agent_client_protocol/lib/raxol/agent_client_protocol/schema/session_update.ex#L571)

Cumulative session cost information -- the optional `cost` field of
`UsageUpdate`.

Not present in f1729; ported straight from the pinned v1.19.0 oracle
schema (`priv/schema-oracle/v1/schema.json`, `$defs/Cost`), no upstream
attribution. `amount`/`currency` are both required (no
`x-deserialize-default-on-error` on either in the oracle).

# `t`

```elixir
@type t() :: %Raxol.AgentClientProtocol.Schema.Cost{
  _meta: map(),
  amount: number(),
  currency: String.t()
}
```

# `from_json`

```elixir
@spec from_json(term()) :: {:ok, t()} | {:error, term()}
```

Total: never raises. A missing/non-number `amount` or missing/non-string `currency` is the only failure mode (both required).

# `new`

```elixir
@spec new(number(), String.t()) :: t()
```

# `to_json`

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

---

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