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:
bash
postgres://user:password@host:5432/dbname?sslmode=requireRedis URL format:
bash
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 automatic data cleanup |
retention.log_retention_days | int | 30 | Days to keep logs |
retention.eval_result_retention_days | int | 90 | Days to keep eval results |
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
yamlingate.yaml
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
yamlingate.yaml
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: true
log_retention_days: 30
eval_result_retention_days: 90
scheduler:
enabled: true
interval_secs: 300
batch_size: 100Containers
In Docker and Kubernetes, prefer environment variables, which take precedence over config files. See Deployment for examples.