Configuration
Configuration reference for the self-hosted Ingate gateway: config file, environment variables, CLI flags, and every option with its default.
Overview
This page is the configuration reference for a self-hosted Ingate gateway. On Ingate Cloud, configuration is managed for you through the dashboard at app.ingateai.com, so none of the file or environment setup below applies.
Configuration is loaded in this precedence order (highest wins):
- CLI flags (
--port,--host) - Environment variables (
INGATE_SERVER_PORT) - Config file (
ingate.yaml) - Built-in defaults
Config File Locations
Ingate searches for ingate.yaml in:
- Current directory (
.) ~/.ingate//etc/ingate/
Override with --config /path/to/ingate.yaml.
Environment Variable Mapping
Every config key maps to an env var with the INGATE_ prefix and _ separators:
| Config Key | Environment Variable |
|---|---|
server.port | INGATE_SERVER_PORT |
server.host | INGATE_SERVER_HOST |
database.postgresql_url | INGATE_DATABASE_POSTGRESQL_URL |
database.redis_url | INGATE_DATABASE_REDIS_URL |
auth.enabled | INGATE_AUTH_ENABLED |
All Options
server
| Key | Type | Default | Description |
|---|---|---|---|
server.host | string | "" | Listen host (empty = all interfaces) |
server.port | int | 7100 | Listen port |
server.max_body_bytes | int | 10485760 | Max request body size in bytes (10MB) |
server.timeout_seconds | int | 300 | Upstream request timeout (5 minutes) |
server.cors_origins | string | "" | Allowed CORS origins. * for all, comma-separated for specific |
server.admin_auth | bool | false | Require X-Ingate-Key for /api/* and /ui/* endpoints |
server.tls.cert_file | string | "" | TLS certificate file path |
server.tls.key_file | string | "" | TLS private key file path |
providers
See Providers for full documentation.
| Key | Type | Default | Description |
|---|---|---|---|
providers.<name>.base_url | string | required | Upstream API URL |
providers.<name>.api_key | string | "" | API key |
providers.<name>.enabled | bool | false | Whether this provider is active |
providers.<name>.auth_header | string | Authorization | Custom auth header name |
providers.<name>.auth_scheme | string | Bearer | Auth value prefix |
providers.<name>.path_prefix | string | "" | Path prepended to every request |
providers.<name>.query_params | map | {} | Static query parameters |
providers.<name>.headers | map | {} | Static headers |
auth
| Key | Type | Default | Description |
|---|---|---|---|
auth.enabled | bool | false | Enable X-Ingate-Key authentication |
auth.keys | string[] | [] | List of valid API keys (stored as SHA-256 hashes internally) |
rate_limit
Requires Redis.
| Key | Type | Default | Description |
|---|---|---|---|
rate_limit.enabled | bool | false | Enable per-key rate limiting |
rate_limit.requests_per_minute | int | 60 | Max requests per minute per key |
fallback
| Key | Type | Default | Description |
|---|---|---|---|
fallback.enabled | bool | false | Enable automatic provider fallback |
fallback.max_retries | int | 1 | Max fallback attempts |
fallback.fallback_map | map | {} | Provider → fallback provider mapping |
database
| Key | Type | Default | Description |
|---|---|---|---|
database.postgresql_url | string | "" | PostgreSQL connection string |
database.redis_url | string | "" | Redis connection string |
PostgreSQL URL format:
postgres://user:password@host:5432/dbname?sslmode=requireRedis URL format:
redis://[:password@]host:6379[/db]
rediss://[:password@]host:6380[/db] # TLSlogging
| Key | Type | Default | Description |
|---|---|---|---|
logging.buffer_size | int | 10000 | Async pipeline channel buffer |
logging.workers | int | 4 | Number of background writer goroutines |
retention
| Key | Type | Default | Description |
|---|---|---|---|
retention.enabled | bool | false | Enable the bounded startup and hourly cleanup worker |
retention.log_retention_days | int | 30 | Enterprise log eligibility period; free-plan logs use 7 days when the worker is enabled |
retention.eval_result_retention_days | int | 90 | Native evaluation result and completed-run eligibility period; failed runs remain retained. Externally submitted log verdict details are outside this worker stage |
Automatic retention is disabled by default. Review your retention policy and holds before opting in; the complete example below keeps cleanup disabled. Enabling the worker does not prove deletion is complete or establish a deletion SLA. Sweeps can make partial progress, and linked log deletion can remove native evaluation results before their own period expires. External log verdict details can remain organization-scoped after the source log is deleted. Read record-class, hold, retry and export limits and inspect actual worker/database outcomes before interpreting or retrying a sweep.
scheduler
| Key | Type | Default | Description |
|---|---|---|---|
scheduler.enabled | bool | false | Enable periodic eval scheduler |
scheduler.interval_secs | int | 300 | Run interval (5 minutes) |
scheduler.batch_size | int | 100 | Max logs per scheduled run |
Minimal Config
providers:
openai:
base_url: https://api.openai.com
api_key: sk-...
enabled: true
database:
postgresql_url: postgres://ingate:pass@localhost:5432/ingate?sslmode=disableProduction Config
server:
port: 7100
max_body_bytes: 10485760
timeout_seconds: 300
cors_origins: "https://app.yourcompany.com"
admin_auth: true
tls:
cert_file: /etc/ingate/tls/cert.pem
key_file: /etc/ingate/tls/key.pem
providers:
openai:
base_url: https://api.openai.com
api_key: ${OPENAI_API_KEY}
enabled: true
anthropic:
base_url: https://api.anthropic.com
api_key: ${ANTHROPIC_API_KEY}
enabled: true
auth:
enabled: true
keys:
- ${INGATE_KEY_TEAM_A}
- ${INGATE_KEY_TEAM_B}
rate_limit:
enabled: true
requests_per_minute: 120
fallback:
enabled: true
max_retries: 1
fallback_map:
openai: anthropic
anthropic: openai
database:
postgresql_url: ${DATABASE_URL}
redis_url: ${REDIS_URL}
retention:
enabled: false
log_retention_days: 30
eval_result_retention_days: 90
scheduler:
enabled: true
interval_secs: 300
batch_size: 100Containers