class

Arcana::AI::Pricing::Table

Inherits YAML::Serializable < Reference < Object

A set of rates, as in pricing/rates.yml.

Constructors

default

The table arcana-ai ships, from the providers' published prices.

Source
new(version : String, models : Array(Arcana::AI::Pricing::Entry) = [] of Entry, providers : Hash(String, Arcana::AI::Pricing::ProviderRates) = {} of String => ProviderRates)
Source
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source

Instance methods

after_initialize
Source
lookup(provider : String, model : String, at : Time = Time.utc) : Entry | Nil

The rates for a model on a date, or nil when the table has none.

Source
merge(other : Table) : Table

This table with other laid over it: where both have rates for a model, other's win.

Source
models
Source
providers
Source
version

Names the table and its edition, as "arcana-ai 2026-10-13"; every Cost priced from it carries this.

Source
web_search_rate(entry : Entry) : BigDecimal | Nil
Source