Skip to content

AI: count tokens

Plugin ID: ai_eca_interceptor_count_tokens

Available since: 2.0.0

Count tokens for a text using the AI Tokenizer and store the integer count in a named token.

Fields

Text — config key: text

The text to count tokens for. Token replacement is supported, so you can pass e.g. [event:input_text].
This field supports tokens.

Type: textarea · Required: yes · Default: empty string

Model id — config key: model

The model id used to select the tokenizer encoding. Leave empty to use the AI event model id when running inside an AI event flow.
This field supports tokens.

Type: textfield · Required: no · Default: empty string

Value format: The machine name of a model configured on the target site.

Result token name — config key: token_name

The ECA token name to store the integer count in, e.g. "token_count". Please provide the token name only, without brackets.

Type: textfield · Required: yes · Default: empty string