agentskit.js

priceFor

Auto-generated API reference for priceFor.

Function: priceFor()

priceFor(model, prices?): TokenPrice

Defined in: observability/src/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