Bluestep JS Documentation
    Preparing search index...

    Interface AiCountTokensOptions

    Which model to count against. Both optional; omit to count against the configured default.

    interface AiCountTokensOptions {
        model?: string;
        provider?: string;
        tools?: AiTool[];
    }
    Index
    model?: string

    Model 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.

    provider?: string

    Provider to count against (e.g. anthropic, openai). Omit for the configured default.

    tools?: AiTool[]

    Tools 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.