agentskit.js

priceFor

Auto-generated API reference for priceFor.

Function: priceFor()

priceFor(model, prices?): TokenPrice

Defined in: cost-guard.ts:82

Look up the best price match for a model id. Prefix match — 'gpt-4o-mini' matches its own entry before 'gpt-4o'. Returns { input: 0, output: 0 } (free) for unknown models plus a console warning once.

#Parameters

#model

string | undefined

#prices?

Record<string, TokenPrice> = DEFAULT_PRICES

#Returns

TokenPrice

Explore nearby

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page