OptionalmodelModel to count against. Omit for the provider's configured default. Counts are model-specific, so a count taken against one model is not a count for another.
OptionalproviderProvider to count against (e.g. anthropic, openai). Omit for the configured default.
OptionaltoolsTools that would be declared alongside the conversation. Omit only if the call being sized declares none.
A declared tool's schema is sent on every request and occupies input tokens like any other text — a handful of them runs into five figures — so a count taken without them understates a tool-using conversation by however large its schemas are.
Which model to count against. Both optional; omit to count against the configured default.
Example: ```javascript const size = B.ai.countTokens(transcript, { provider: "anthropic", model: "claude-opus-5" }); ```