Gemini Flash for Anti-Spam Bots: A Million Free Tokens Per Day
For the Telegram bot SpamAway, which filters 5,000 messages daily across 10–15 chats, a model with fast processing and a high free limit is essential. A few-shot prompt with rules takes 500 tokens, a message 50–100, totaling 600 tokens per check. Russian models like GigaChat and YandexGPT provide accurate analysis of slang and sarcasm, but their APIs limit concurrency and free traffic.
Gemini Flash 2.5 offers 1 million tokens per day for free — enough for up to 1,600 checks without delays.
Limitations of GigaChat API
Sber's freemium plan: 900,000 tokens per year for Lite. At 600 tokens per request, that's 1,500 checks annually, less than 5 per day. The key drawback is single-threading: requests from different chats are queued, which is critical for anti-spam where instant response is needed.
For Pro/Max — 50,000 tokens per year, even less. The limit is suitable for testing, not for a production bot.
YandexGPT: Transition to Paid Mode
Yandex AI Studio provides a starting grant of 4,000 rubles for 60 days. After that:
- Lite: 0.20 rubles per 1,000 tokens.
- Pro: 0.40 rubles per 1,000 tokens.
One check costs 0.012 rubles. It requires a Yandex Cloud account, billing setup, and a card. For open-source or freemium projects, this is a barrier.
Advantages of Gemini Flash
Google Free tier:
- 15 requests per minute (RPM).
- 1,000,000 tokens per day.
- Multi-threading within RPM limits.
With a load of 5,000 messages per day, the margin is huge. No strict queues, delays are minimal. The downside for Russia is access via proxy/VPN.
Comparison of Key Metrics
| Parameter | GigaChat Free | YandexGPT Lite | Gemini Flash Free |
|-------------------|---------------|----------------|-------------------|
| Free limit | 1,500 checks/year | 60-day grant | 1,600 checks/day |
| Concurrency | 1 thread | Several | 15 RPM |
| Cost (100K tokens) | ~6.5 rubles | 20 rubles | $0 |
| Access from Russia | Native | Native | Proxy/VPN |
Data shows: Gemini wins in terms of free traffic volume and speed for low-load bots.
Key Takeaways
- GigaChat Freemium: The annual limit would be exhausted in hours under real load due to single-threading.
- YandexGPT: Low cost after the grant, but billing complicates launch.
- Gemini Flash: 1 million tokens/day covers 10–15 chats with room to spare, concurrency solves queue issues.
- For Russia: A proxy is essential for stable access to Gemini.
- Quality: All models handle Russian slang well; choice depends on API.
Integration Recommendations
In SpamAway, Gemini is integrated via API with a few-shot prompt. Testing showed spam classification accuracy on par with GigaChat at a speed suitable for chats.
For scaling: Monitor RPM, add a fallback to local models if limits are exceeded. A proxy server minimizes downtime.
— Editorial Team
No comments yet.