This page documents every REST endpoint exposed by the Dummy Gemini Bot admin server, including request parameters and response fields. All endpoints require Bearer authentication — see API Overview for authentication details.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AmiraliNotFound/dummy-gemini-bot/llms.txt
Use this file to discover all available pages before exploring further.
Stats
GET /api/stats
Returns live database statistics and the most recent error log entries. Useful for monitoring bot health from the admin dashboard. No request parameters. Response fields:Total number of messages stored across all chats in the database.
Number of distinct chats that have at least one message on record.
Current size of the SQLite database file in kilobytes.
Cumulative bytes downloaded for media processing (yt-dlp, Telegram files, etc.) since the database was created.
Cumulative bytes uploaded to Telegram (sent media, voice messages, etc.) since the database was created.
The last 10 entries from the
error_logs table. Each object contains:timestamp— ISO datetime string of when the error occurredtype— short error category string (e.g."TELEGRAM_API_ERROR")message— human-readable error descriptionstack_trace— full Python traceback, if captured
Configuration
GET /api/config
Returns all runtime configuration key-value pairs currently loaded from theconfig database table.
No request parameters.
Response: A flat JSON object with every config key as a property. The full set of default keys is defined in config.py’s DEFAULT_CONFIG, including MODEL_ID, CONTEXT_LIMIT, SYSTEM_INSTRUCTION, TTS_ENGINE, and others.
Example response:
POST /api/config
Updates one or more configuration keys. Changes are persisted to theconfig table and take effect immediately in the running bot via the in-memory runtime_config dictionary.
Request body (JSON): An object containing any subset of config keys as properties. Unrecognised keys are also stored — they are simply ignored by handlers that do not read them.
Example request body:
Chats
GET /api/chats
Returns all rows from thechat_metadata table, ordered by last_active descending. Used by the admin dashboard to display and manage active conversations.
No request parameters.
Response: Array of chat objects, each with the following fields:
| Field | Type | Description |
|---|---|---|
chat_id | integer | Telegram chat ID |
name | string | Chat or user display name |
type | string | Chat type ("private", "group", "supergroup", "channel", or "unknown") |
msg_count | integer | Total messages logged for this chat |
last_active | string | ISO datetime of the most recent message |
is_muted | integer | 1 if the bot is muted in this chat, 0 otherwise |
custom_roast_chance | float | null | Per-chat random roast probability override |
custom_cooldown | integer | null | Per-chat cooldown override in seconds |
custom_tts_engine | string | null | Per-chat TTS engine override ("edge" or "gemini") |
custom_model | string | null | Per-chat Gemini model ID override |
custom_system_instruction | string | null | Per-chat system prompt override |
username | string | null | Telegram username of the chat or user |
is_discussion | integer | 1 if the chat is in discussion (scientific/technical) mode |
POST /api/chat/settings
Updates one or more settings for a specific chat. Only fields present in the request body are modified; omitted fields are left unchanged. Request body parameters:Telegram ID of the target chat.
Set to
1 to mute the bot in this chat, 0 to unmute.Override the random roast probability for this chat (
0.0–1.0). Pass an empty string "" to reset to the global default.Override the message cooldown for this chat in seconds. Pass an empty string
"" to reset to the global default.Override the TTS engine for this chat. Accepted values:
"edge" or "gemini". Pass an empty string "" to reset.Override the Gemini model ID used in this chat (e.g.
"gemini-2.5-flash"). Pass an empty string "" to reset.Override the system instruction / persona prompt for this chat. Pass an empty string
"" to reset.Set to
1 to enable discussion mode (scientific/technical tone), 0 to disable.POST /api/chat/leave
Instructs the bot to leave a group chat via the Telegram Bot API. Request body:POST /api/chat/alert
Sends a plain or Markdown-formatted message to a specific chat on behalf of the bot. Request body:GET /api/chat/top_users
Returns the top message senders for a given chat, ranked by message count. Query parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | integer | Yes | Telegram chat ID to query |
limit | integer | No | Number of results to return (default: 5) |
Moderation
GET /api/blocked
Returns all blocked users and groups stored in theblocked table.
No request parameters.
Response: Array of blocked-target objects:
POST /api/block
Blocks a user or group by Telegram ID. If the target is a group (negative ID), the bot will also attempt to leave it automatically. Request body:Telegram user or chat ID to block.
Entity type —
"user" or "group". Defaults to "unknown" if omitted.Display name to show in the blocked list. Defaults to
"Unknown" if omitted.POST /api/unblock
Removes a target from the block list. The bot will start responding to that user or group again on the next message. Request body:GET /api/specials
Returns all VIP users who have a custom system instruction configured. No request parameters. Response: Array of VIP user objects:POST /api/specials
Adds a new VIP user or updates the instruction for an existing one. The@ prefix is stripped from the username automatically.
Request body:
Telegram username without the
@ prefix.Custom system instruction to inject when the bot is replying to this user.
POST /api/specials/delete
Removes a VIP user and their custom instruction. Request body:Broadcast
POST /api/broadcast
Sends a message to every chat ID recorded in the database. The bot first attempts to send with Markdown parse mode; if that fails it retries with plain text before marking the delivery as failed. Request body:| Field | Type | Description |
|---|---|---|
status | string | "success" or "error" |
sent | integer | Number of chats that received the message |
total | integer | Total number of chats attempted |
Tools
POST /api/upload_cookies
Uploads a newcookies.txt file used by yt-dlp for authenticated media downloads (e.g. age-restricted YouTube videos). The file is written to both the database directory and the project root.
Request body (JSON):
Full text content of the Netscape-format
cookies.txt file.POST /api/update_ytdlp
Upgrades yt-dlp to the latest version by runningpip install --upgrade yt-dlp in a subprocess.
No request body required.
Response:
500 with a "reason" field containing the stderr output from pip.
Quota Monitoring
GET /api/model_limits
Returns per-model Gemini API request statistics derived from theapi_requests_log table, along with model metadata fetched from the Gemini API. All models currently configured via MODEL_ID, FALLBACK_MODELS, and TTS_GEMINI_MODEL are included.
No request parameters.
Response: An object with two top-level keys:
models— array of model detail objects (one per active model), each containing:
| Field | Type | Description |
|---|---|---|
model_id | string | Model identifier as configured |
display_name | string | Human-readable name from the Gemini API |
description | string | Model description from the Gemini API |
input_token_limit | integer | null | Max input tokens supported |
output_token_limit | integer | null | Max output tokens supported |
status | string | "active" or "error" |
is_tts | boolean | true if this model is used for TTS |
error | string | null | Error message if the model could not be queried |
limits | object | Configured rate limits: { "rpm": N, "tpm": N, "rpd": N } |
usage | object | Per-model usage stats (see below) |
usage— aggregate usage stats split by request type ("text"and"tts"), each withlast_minuteandlast_24_hoursbuckets.
usage object inside each model entry has this shape:
POST /api/chat/send_profile_link
Sends the requesting admin a Telegram message containing an inline button that deep-links to a target user’s profile (tg://user?id=<target_id>). The message is sent directly to the authenticated admin’s Telegram DM.
Request body:
Telegram user ID whose profile link should be sent.
Display name to show on the inline button label (default:
"User").