• Estimate the number of tokens a message will use. Note that using the message within a prompt will add extra tokens, so you might want to use promptTokensEstimate instead.

    Parameters

    • message: ChatCompletionMessageParam

      An OpenAI chat message

    Returns number

    An estimate for the number of tokens the message will use