Your bot receives the message, the model drafts the reply
Your Telegram bot and Modelseed use separate credentials. Your server receives Telegram events, builds a short request to an available model and sends the reply to the chat. Start with one authorized test chat and a short history.
- Create the bot through BotFather and store its token separately from MODELSEED_API_KEY. Read both values only on the server.
- Serve /help directly from your app. For normal messages, check access, cap the input length and call the text API using an available ID.
- Remember handled update_id values so Telegram redelivery does not trigger a second charge. On error, send a short message asking the user to retry later.
Limit usage and check the launch
Test three actions: /help without an inference call, one text message with one API call, and redelivery of the same event without a second call. For production, set per-user request limits, history length and response caps. Keep credentials and full private conversations out of logs.