Salud IA Bot is configured entirely through environment variables — there are no config files to edit at runtime. The application uses a Joi validation schema (registered inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/RubenDarioGuerreroNeira/Ecosistema-IA-Colombia/llms.txt
Use this file to discover all available pages before exploring further.
AppModule via @nestjs/config) that runs at startup, so any misconfiguration fails fast before the NestJS process binds to a port. The variables below map directly to the Joi schema defined in src/app.module.ts.
Required Variables
These two variables must be present in your environment or the process will exit with a validation error before the bot starts.The Telegram Bot API token issued by @BotFather. This token authenticates every outbound call to the Telegram API and is passed directly to the
TelegrafModule factory in AppModule. The bot cannot start without it.Your OpenRouter API key, used by
GenkitService to authenticate requests to the OpenRouter inference endpoint (https://openrouter.ai/api/v1). Get a key at openrouter.ai. All LLM fallback responses — and the general-query handler — go through this key.Optional Variables with Defaults
These variables are optional. If omitted, the Joi schema injects the defaults shown below.The OpenRouter model identifier used by
GenkitService. The Joi schema default is nvidia/nemotron-3-super-120b-a12b:free, while the runtime fallback in genkit.service.ts resolves to meta-llama/Meta-Llama-3.1-70B-Instruct when the env var is absent. Any OpenAI-compatible model available on OpenRouter can be substituted here — simply provide the full model slug (e.g., openai/gpt-4o, anthropic/claude-3.5-sonnet).The base URL for the OpenRouter API. Override this only if you are proxying through a custom gateway that implements the OpenAI-compatible chat completions interface.
The HTTP port on which the NestJS server listens. Used by the health-check endpoint (
AppController) and any hosting platform (Render, Railway, Fly.io) that routes traffic to the process. Must be a valid integer.Optional Network Variables
A full proxy URL injected into the
https-proxy-agent that wraps Telegraf’s underlying HTTP client. Use this on platforms (such as Render’s free tier) where direct outbound connections to api.telegram.org are blocked or throttled.Format: http://user:password@host:portWhen set, AppModule creates an HttpsProxyAgent and attaches it to the Telegraf telegram.agent option. Leave unset (or set to an empty string) for direct connections — the Joi schema marks it as optional().allow('').Timeout in milliseconds for Telegram Bot API calls, passed as
handlerTimeout to Telegraf. Increase to 60000 (or higher) when running on slow or geographically distant network environments. The .env.example ships with this set to 60000 as a conservative default for cloud deployments.Legacy Variables
A leftover credential from an earlier Google Genkit integration. This variable is present in
.env.example but is not included in the Joi validation schema and is not read by any active service — all LLM calls go through OPENROUTER_API_KEY. You may safely remove it from your .env file; keeping it has no effect on runtime behavior.Complete .env Example
The .env.example file at the repository root can be copied to .env and filled in.
Joi Validation Schema
The full validation schema is defined insrc/app.module.ts inside ConfigModule.forRoot():
The app uses Joi schema validation (via
@nestjs/config) to validate environment variables at startup. If TELEGRAM_BOT_TOKEN or OPENROUTER_API_KEY are missing, the process exits with a validation error before the server starts.