Skip to main content

Function: maxInputTokens()

maxInputTokens(req): number | undefined

Defined in: packages/agentos/src/api/runtime/modelPricing.ts:377

An upper bound on the prompt tokens a request can be billed: one token per UTF-8 byte of its messages (as JSON), its system prompt and its tool definitions (as JSON), plus MAX_COST_TOKENS_PER_MESSAGE for each message and for the system prompt, plus MAX_COST_TOOL_USE_TOKENS once when it sends a tool. Undefined when the request holds a part or a tool its text does not bound (see estimateMaxCallCostUSD).

Parameters​

req​

Pick<MaxCostRequest, "messages" | "system" | "tools">

Returns​

number | undefined