Skip to main content

Documentation 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.

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 in 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.
TELEGRAM_BOT_TOKEN
string
required
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.
OPENROUTER_API_KEY
string
required
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.
OPENROUTER_MODEL
string
default:"nvidia/nemotron-3-super-120b-a12b:free"
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).
OPENROUTER_BASE_URL
string
default:"https://openrouter.ai/api/v1"
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.
PORT
number
default:"3000"
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

TELEGRAM_PROXY_URL
string
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('').
TELEGRAM_API_TIMEOUT
number
default:"30000"
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

GOOGLE_GENAI_API_KEY
string
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.
The repository’s .env.example does not include OPENROUTER_API_KEY, even though it is required by the Joi schema. You must add it manually to your .env file. Without it the application exits with a Joi validation error at startup.
TELEGRAM_BOT_TOKEN=TU_TOKEN_AQUI
GOOGLE_GENAI_API_KEY=TU_API_KEY_AQUI
PORT=3000
TELEGRAM_API_TIMEOUT=60000

# Opcional: Proxy para conexión a Telegram (útil en Render si hay restricciones de red)
# TELEGRAM_PROXY_URL=http://usuario:password@host:puerto

# Opcional: Timeout para API de Telegram en milisegundos (default: 30000)
# TELEGRAM_API_TIMEOUT=60000

Joi Validation Schema

The full validation schema is defined in src/app.module.ts inside ConfigModule.forRoot():
ConfigModule.forRoot({
  isGlobal: true,
  validationSchema: Joi.object({
    TELEGRAM_BOT_TOKEN: Joi.string().required(),
    OPENROUTER_API_KEY: Joi.string().required(),
    OPENROUTER_MODEL: Joi.string().default(
      'nvidia/nemotron-3-super-120b-a12b:free',
    ),
    OPENROUTER_BASE_URL: Joi.string().default(
      'https://openrouter.ai/api/v1',
    ),
    PORT: Joi.number().default(3000),
    TELEGRAM_PROXY_URL: Joi.string().optional().allow(''),
    TELEGRAM_API_TIMEOUT: Joi.number().default(30000),
  }),
}),
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.

Build docs developers (and LLMs) love