Skip to content
Notis

Count Gemini tokens for Telegram text on demand

Text a block of content to Telegram and Gemini returns the token count, so you can estimate cost and check input limits before committing to a run.

Trigger

New Message Received

Triggered when your bot receives a new message in a private chat, group, or supergroup. To receive every message in a group, Privacy Mode must be disabled for the bot in BotFather.

Action

Count Tokens (Gemini)

Counts the number of tokens in text using gemini tokenization. useful for estimating costs, checking input limits, and optimizing prompts before making api calls.

Why this helps

Guessing whether a prompt fits within limits or blows the budget, then finding out only after it fails.

  • Estimates cost before you run an expensive generation
  • Confirms text fits within model input limits
  • Removes guesswork from prompt sizing

Setup

Build it in a few focused steps.

  • 1Connect Telegram and Gemini to Notis once in the portal.
  • 2Create the automation under Automations, or ask Notis in plain language.
  • 3Describe the outcome: when I text content to Telegram, have Gemini count the tokens.
  • 4Select the New Message Received trigger and the channel for run reports.
  • 5Send a test block of text and confirm the token count comes back.

Questions about this workflow

Why count tokens?

Token counts let you estimate API cost, check input limits, and trim prompts before running a real generation.

Does it run the prompt too?

No. This workflow only counts tokens so you can decide before spending on a full run.

When this happens · Trigger

Do this · Action

Supported Triggers and Actions

Notis builds workflows that link Telegram to Gemini. A trigger fires from one place; an action lands in another.

Telegram triggers

Gemini actions

New Message Received

Triggered when your bot receives a new message in a private chat, group, or supergroup. To receive every message in a group, Privacy Mode must be disabled for the bot in BotFather.

TriggerInstant

Count Tokens (Gemini)

Counts the number of tokens in text using gemini tokenization. useful for estimating costs, checking input limits, and optimizing prompts before making api calls.

ActionInstant

New Channel Post

Triggered when a new post is published to a channel where your bot is an administrator.

TriggerInstant

Download Video (Veo)

Downloads a generated veo video to local storage. takes the video uri from a completed operation and saves it to the specified file path.

ActionInstant

Callback Query Received

Triggered when a user taps an inline keyboard button attached to one of your bot's messages.

TriggerInstant

Embed Content (Gemini)

Generates text embeddings using gemini embedding models. converts text into numerical vectors for semantic search, similarity comparison, clustering, and classification tasks.

ActionInstant

Message Edited

Triggered when a message in a chat your bot can see is edited by its sender.

TriggerInstant

Generate Content (Gemini)

Generates text content from prompts using gemini models. supports various models like gemini flash and pro with configurable temperature, token limits, and safety settings for diverse text generation tasks.

ActionInstant

New Chat Member

Triggered when a new member joins a group or supergroup the bot belongs to, including when the bot itself is added.

TriggerInstant

Generate Image (Gemini 2.5 Flash)

Generates images from text prompts using gemini 2.5 flash image preview model. supports creative image generation with customizable parameters like aspect ratio, safety settings, and optional file saving.

ActionInstant

Generate Videos (Veo)

Generates videos from text prompts using google's veo models. creates high-quality video content with customizable aspect ratios, duration, and style controls. returns operation id for tracking progress.

ActionInstant

Get Videos Operation (Veo)

Checks the status of a veo video generation operation. use the operation name from generatevideos to track progress and get the download url when complete.

ActionInstant

List Models (Gemini API)

Lists available gemini and veo models with their capabilities and limits. useful for discovering supported models and their features before making generation requests.

ActionInstant

Connect any two apps with Notis in the middle.

Not just Telegram and Gemini. Any combination from 1,000+ integrations.

When this happens · Trigger

Do this · Action

Save your first hour today.

7 days free trial with 20$ free usage included.
No card. Works with personal or business Gemini.