Contracts / costUsd / priceFor
Contract
costUsd / priceFor
Turns the Executive’s token counts into dollars. TokenUsage is input, output, cacheRead and cacheWrite.
Signature
priceFor(model): Price costUsd(price: Price, usage: TokenUsage) : number
Rules
- The Executive depends on the Treasurer for the Price and TokenUsage types only.
Where it appears
- Carry a model callGatekeeper
- Count tokens and report usageExecutive
- Price a model callTreasurer