Skip to content

Telegram: linking, the free-tier gate, and alerts

Sleepy uses Telegram for three things: linking your account (for the CLI's device flow and notifications), a **free-tier group-membership gate**, and **usage alerts** as you approach your monthly…

Sleepy uses Telegram for three things: linking your account (for the CLI's device flow and notifications), a free-tier group-membership gate, and usage alerts as you approach your monthly allowance.

Link your Telegram account

  1. Open Dashboard → Settings and start the Telegram link flow.
  2. A link token is generated (short-lived); you confirm it via the bot.
  3. Your telegramId is stored against your account.

Linking is required for the free-tier group gate and for usage-alert DMs.

The free-tier group gate

On the free plan, requests are blocked (403) until your Telegram account is linked and you're a member of the required Telegram group. This is the "join the Telegram group" prompt free users see.

  • Paid subscriptions are exempt — an active, unexpired subscription never hits this gate.
  • Membership is cached per user with a configurable TTL (hours), so you aren't re-checked on every request. Once verified, you're good until the cache expires.
  • If the deployment hasn't configured a group, the gate is a no-op.
  • If the bot can't verify (not configured), the request is allowed through rather than blocked.

To clear it: link Telegram, join the group the dashboard names, and verify. The next request proceeds.

Usage alerts

A background job watches monthly usage and DMs you when you cross a threshold. Bands are 80%, 90%, and 100% of your plan's monthly allowance:

  • 80 / 90% — "You've used X% of your $Y monthly allowance; only $Z remaining. Consider purchasing extra credits."
  • 100% — "Monthly allowance exhausted. To continue using the API, purchase extra credits. Your balance: $B."

Each band fires once per billing period (a period rollover resets it), and jumping bands (79% → 95%) sends only the 90% alert. Alerts go to the linked Telegram account.

The bot token and the group-membership requirement are admin-configurable (Admin → Settings / Telegram). The group gate itself can be toggled off entirely.

The bot

The deployment runs a Telegram bot (long-polling, with a webhook for the group verification callback). On the hosted service the bot is @sleepyai — join t.me/sleepyai for community and support.

Next: Usage limits · Billing & credits