# Environment Variables Reference {#environment-variables-reference}


Comprehensive reference of all environment variables used by Ever Gauzy.


## Core {#core}


| Variable   | Required | Default     | Description      |
| ---------- | -------- | ----------- | ---------------- |
| `NODE_ENV` | No       | development | Environment mode |
| `PORT`     | No       | 3000        | API server port  |
| `HOST`     | No       | 0.0.0.0     | API bind host    |


## Database {#database}


| Variable       | Required | Default   | Description                   |
| -------------- | -------- | --------- | ----------------------------- |
| `DB_TYPE`      | Yes      | sqlite    | `sqlite`, `postgres`, `mysql` |
| `DB_HOST`      | Postgres | localhost | Database host                 |
| `DB_PORT`      | Postgres | 5432      | Database port                 |
| `DB_NAME`      | Yes      | gauzy     | Database name                 |
| `DB_USER`      | Postgres | postgres  | Database user                 |
| `DB_PASS`      | Postgres | —         | Database password             |
| `DB_SSL_MODE`  | No       | false     | Enable SSL                    |
| `DB_POOL_SIZE` | No       | 40        | Connection pool size          |
| `DB_ORM`       | No       | typeorm   | `typeorm` or `mikroorm`       |


## Authentication {#authentication}


| Variable                       | Required | Description                |
| ------------------------------ | -------- | -------------------------- |
| `JWT_SECRET`                   | Yes      | JWT signing secret         |
| `JWT_REFRESH_SECRET`           | Yes      | Refresh token secret       |
| `JWT_TOKEN_EXPIRATION`         | No       | Token expiry (default: 1d) |
| `JWT_REFRESH_TOKEN_EXPIRATION` | No       | Refresh expiry (7d)        |


## Redis {#redis}


| Variable     | Required | Default   | Description               |
| ------------ | -------- | --------- | ------------------------- |
| `REDIS_URL`  | Prod     | —         | Full Redis connection URL |
| `REDIS_HOST` | No       | localhost | Redis host                |
| `REDIS_PORT` | No       | 6379      | Redis port                |


## URLs {#urls}


| Variable          | Required | Description    |
| ----------------- | -------- | -------------- |
| `API_BASE_URL`    | Yes      | Public API URL |
| `CLIENT_BASE_URL` | Yes      | Web app URL    |


## Email (SMTP) {#email-smtp}


| Variable            | Required | Description      |
| ------------------- | -------- | ---------------- |
| `MAIL_FROM_ADDRESS` | Yes      | Sender email     |
| `MAIL_HOST`         | Yes      | SMTP server host |
| `MAIL_PORT`         | No       | SMTP port (587)  |
| `MAIL_USERNAME`     | Yes      | SMTP username    |
| `MAIL_PASSWORD`     | Yes      | SMTP password    |


## File Storage {#file-storage}


| Variable                | S3  | Description                   |
| ----------------------- | --- | ----------------------------- |
| `FILE_PROVIDER`         | —   | LOCAL, S3, WASABI, CLOUDINARY |
| `AWS_ACCESS_KEY_ID`     | S3  | AWS key                       |
| `AWS_SECRET_ACCESS_KEY` | S3  | AWS secret                    |
| `AWS_REGION`            | S3  | AWS region                    |
| `AWS_S3_BUCKET`         | S3  | S3 bucket name                |


## Integrations {#integrations}


| Variable                      | Description           |
| ----------------------------- | --------------------- |
| `GAUZY_GITHUB_CLIENT_ID`      | GitHub App client ID  |
| `GAUZY_GITHUB_CLIENT_SECRET`  | GitHub App secret     |
| `GAUZY_GITHUB_WEBHOOK_SECRET` | GitHub webhook secret |
| `GOOGLE_CLIENT_ID`            | Google OAuth client   |
| `GOOGLE_CLIENT_SECRET`        | Google OAuth secret   |
| `SENTRY_DSN`                  | Sentry error tracking |


## Observability {#observability}


| Variable                    | Description              |
| --------------------------- | ------------------------ |
| `SENTRY_DSN`                | Sentry DSN               |
| `SENTRY_TRACES_SAMPLE_RATE` | Trace sampling rate      |
| `LOG_LEVEL`                 | debug, info, warn, error |
| `LOG_FORMAT`                | text or json             |


## Rate Limiting {#rate-limiting}


| Variable         | Default | Description             |
| ---------------- | ------- | ----------------------- |
| `THROTTLE_TTL`   | 60      | Window in seconds       |
| `THROTTLE_LIMIT` | 100     | Max requests per window |


## AI Chat {#ai-chat}


See the [AI Chat Plugin](https://sourcey-gauzy.pages.dev/plugins-built-in/ai-chat-plugin/index.md) page for the full setup guide.

| Variable                         | Description                                                       |
| -------------------------------- | ----------------------------------------------------------------- |
| `GAUZY_AI_CHAT_ENABLED`          | Enable/disable the AI chat feature (`false` hides it everywhere)  |
| `GAUZY_AI_CHAT_DEFAULT_PROVIDER` | Default provider id (e.g. `anthropic`)                            |
| `GAUZY_AI_CHAT_DEFAULT_MODEL`    | Default model id for the default provider                         |
| `ANTHROPIC_API_KEY`              | Anthropic server-wide key                                         |
| `OPENAI_API_KEY`                 | OpenAI server-wide key (also powers voice dictation)              |
| `OPENROUTER_API_KEY`             | OpenRouter server-wide key                                        |
| `OPENROUTER_PLATFORM_API_KEY`    | Shared free-tier key, restricted to free models (resolved last)   |
| `GEMINI_API_KEY`                 | Google Gemini key (or `GOOGLE_GENERATIVE_AI_API_KEY`)             |
| `XAI_API_KEY`                    | xAI Grok key (or `GROK_API_KEY`)                                  |
| `AI_GATEWAY_API_KEY`             | Vercel AI Gateway key                                             |
| `GAUZY_AI_CHAT_MCP_URL`          | Optional external MCP server for extra agent tools (off by default) |
| `GAUZY_AI_CHAT_SELF_API_URL`     | Override the base URL the agent uses to call the Gauzy API        |


## Related Pages {#related-pages}


- [Configuration System](https://sourcey-gauzy.pages.dev/architecture/configuration-system/index.md) — config architecture
- [Production Deployment](https://sourcey-gauzy.pages.dev/devops/production-deployment/index.md) — deployment setup
