Telegram Bot + Evrona
Your own bot is easiest to build on grammY: it takes messages from Telegram and answers from the gateway through the official OpenAI SDK.
What to prepare
No key yet? Create an account — keys are created in the dashboard under “API keys”, and the full value is shown only once. Copy the Model ID from the catalog in full, including the prefix before “/”.
Connection steps
Take a bot token from @BotFather.
Install grammy and openai, then paste in the code below.
Set the BOT_TOKEN and EVRONA_API_KEY environment variables, then launch the bot.
// npm i grammy openai
import { Bot } from "grammy";
import OpenAI from "openai";
const ai = new OpenAI({
apiKey: process.env.EVRONA_API_KEY,
baseURL: "https://evrona.ru/v1",
});
const bot = new Bot(process.env.BOT_TOKEN);
bot.on("message:text", async (ctx) => {
const answer = await ai.chat.completions.create({
model: "google/gemini-3.7-flash",
messages: [{ role: "user", content: ctx.message.text }],
});
await ctx.reply(answer.choices[0].message.content ?? "");
});
bot.start();For long answers switch streaming on and edit the message you already sent as the text arrives — otherwise the person stares into an empty chat for tens of seconds.
Function calling is supported, so agentic modes work. Strict JSON mode (response_format) and the retired functions format are turned down with an unsupported_parameter error — no parameter is lost in silence. Image input is taken by models marked "Understands images" in the catalog: a content part of type image_url with a data:image/png;base64,… URL (PNG, JPEG or WebP, up to 5 MB each, up to 50 per request). Remote URLs are not fetched, and a model without that mark returns unsupported_capability — both errors name the reason outright.