Sycophant.Pricing.Component (sycophant v0.5.0)

Copy Markdown

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

Summary

Functions

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

t()

Types

t()

@type t() :: %Sycophant.Pricing.Component{
  __type__: binary(),
  id: nil | binary(),
  kind: nil | binary(),
  meter: nil | binary(),
  notes: nil | binary(),
  per: nil | integer(),
  rate: nil | number(),
  size_class: nil | binary(),
  tool: nil | binary(),
  unit: nil | binary()
}

Functions

from_llmdb(map)

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

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

t()