PhoenixAI.Store.CostTracking.CostRecord (PhoenixAI.Store v0.1.0)

Copy Markdown View Source

A cost record linked to a conversation turn.

Records the token usage and computed cost for a single AI provider call, using Decimal for all monetary values.

Summary

Types

t()

@type t() :: %PhoenixAI.Store.CostTracking.CostRecord{
  conversation_id: String.t(),
  id: String.t() | nil,
  input_cost: Decimal.t(),
  input_tokens: non_neg_integer(),
  metadata: map(),
  model: String.t(),
  output_cost: Decimal.t(),
  output_tokens: non_neg_integer(),
  provider: atom(),
  recorded_at: DateTime.t() | nil,
  total_cost: Decimal.t(),
  user_id: String.t() | nil
}