GigaChat API icon

GigaChat API

Consume GigaChat API functions

Токены → Посчитать токены

AI-generated

Summary

Count the number of tokens and characters in a given prompt text using a selected GigaChat model.

Inputs

  • modelId — Select the GigaChat model to use for token counting; optional but recommended to specify.
  • prompt (required) — Input text string to count tokens for. Enter the message you want to evaluate.

Output shape

a JSON object containing the token count and character count for the provided prompt

Returns fields 'tokens' (number of tokens) and 'characters' (number of characters) in the prompt. Output is one item per input message. Requires GigaChat API credentials configured in the node.

Links

Discussion