Skip to content

Process configuration reference

ReferenceFacts to look up.

The settings of the process itself (apinx.yaml): ports, logging, storage, analytics, the request inspector, the master key and sign-in. Every setting has a flag and an environment variable; apinx config reference prints this table from the binary.

Apinx — Process Configuration Reference

Generated from the configuration schema (go test ./src/internal/platform/config -run Reference -args -update; the same table prints with apinx config reference). Do not edit by hand.

This file describes apinx.yaml, the configuration of the process: ports, storage, logging, observability, the demo backend. What the gateway serves (listeners, upstreams, routes, policies) is the gateway configuration, managed in the console and described in GATEWAY-CONFIG.md.

How a value is chosen

Every setting has a default. It can be changed in three ways; the highest wins:

  1. A command-line flag, named like the setting: --logging.level debug.
  2. An environment variable, APINX_ plus the path in upper case with dots as underscores: APINX_LOGGING_LEVEL=debug.
  3. The YAML file given with --config (default apinx.yaml in the working directory, used when present).

Unknown keys are rejected by name. Validation reports every failure at once, naming the field and the rule. apinx config show prints the effective configuration with secrets redacted.

Reloading

Settings marked hot take effect while the process runs: edit the file and the change applies within the watch interval, with a log line naming the fields that changed. Settings marked restart are read once at start; changing them in the file logs a warning until the next restart.

Settings

Durations are strings with a unit (30s, 5m, 1h). Lists in the environment are comma separated.

Setting Environment variable Default Reload Description
console.listen APINX_CONSOLE_LISTEN :9000 restart Address the console and Admin API listen on.
console.read_header_timeout APINX_CONSOLE_READ_HEADER_TIMEOUT 10s restart Maximum time to read request headers on the console listener.
console.public_url APINX_CONSOLE_PUBLIC_URL (empty) restart URL users open the console at, such as https://gateway.example.com, when it differs from the listen address (behind a load balancer). The identity provider redirect URI is built from it. Empty: the address of each request.
console.secure_cookies APINX_CONSOLE_SECURE_COOKIES false restart Mark the session cookies Secure so browsers send them over HTTPS only. Set it when a TLS reverse proxy fronts the console; implied when public_url is https.
console.session_ttl APINX_CONSOLE_SESSION_TTL 12h0m0s restart How long a console session may live at most, however active.
console.session_idle_timeout APINX_CONSOLE_SESSION_IDLE_TIMEOUT 1h0m0s restart A session left unused for this long ends; every request extends it, up to session_ttl. 0 disables the idle timeout.
console.errors.verbose APINX_CONSOLE_ERRORS_VERBOSE false hot Include remediation and details in error responses. Enable on development installs only.
console.errors.docs_url APINX_CONSOLE_ERRORS_DOCS_URL (empty) hot Base URL for per-error documentation links; the error code is appended. Empty disables the link.
proxy.config_file APINX_PROXY_CONFIG_FILE (empty) restart Path of the gateway configuration file (apiVersion apinx/v1, kind Gateway). Default gateway.yaml if present; without a file and with the demo enabled, a built-in configuration fronts the demo backend.
proxy.cache_bytes APINX_PROXY_CACHE_BYTES 0 restart Memory budget of the response cache policy, in bytes. 0 means 64 MiB. In the SaaS edition each organization's plan sets its budget instead.
proxy.callouts.max_per_request APINX_PROXY_CALLOUTS_MAX_PER_REQUEST 0 restart Most other backends one request may call through service callouts, whatever the policies say. 0: no cap.
proxy.callouts.max_deadline APINX_PROXY_CALLOUTS_MAX_DEADLINE 0s restart Longest deadline a service-callout policy gets for all its callouts of one request; a policy asking for more is held to this. 0: no cap.
proxy.public_url APINX_PROXY_PUBLIC_URL (empty) restart Public address of the gateway, such as https://api.example.com, used as the issuer of the access tokens the gateway issues to applications (/oauth2/token). Empty: the scheme, host and port each token request arrived on.
demo.enabled APINX_DEMO_ENABLED false restart Run the built-in demo backend so the gateway can be tried without a real service.
demo.listen APINX_DEMO_LISTEN 127.0.0.1:9100 restart Address the demo backend listens on. Keep it on the loopback interface.
logging.level APINX_LOGGING_LEVEL info hot Minimum log level: debug, info, warn or error.
logging.format APINX_LOGGING_FORMAT json restart Log encoding: json or text.
logging.add_source APINX_LOGGING_ADD_SOURCE false restart Record source file and line on every log record. Debug installs only.
access_log.enabled APINX_ACCESS_LOG_ENABLED true restart Write one JSON line per proxied request.
access_log.sink APINX_ACCESS_LOG_SINK stdout restart Where lines go: stdout, file, tcp (newline-delimited JSON to a collector such as Vector, Fluent Bit or Logstash), syslog (RFC 5424) or http (batches to Seq, Grafana Loki, Elasticsearch or OpenSearch, or any collector that takes NDJSON).
access_log.path APINX_ACCESS_LOG_PATH out/logs/access.log restart File path for the file sink. Created on first write.
access_log.sampling APINX_ACCESS_LOG_SAMPLING 1 hot Fraction of requests logged, 0 to 1. 1 logs everything.
access_log.always_log_errors APINX_ACCESS_LOG_ALWAYS_LOG_ERRORS true hot Log every 4xx and 5xx regardless of sampling.
access_log.fields APINX_ACCESS_LOG_FIELDS [] restart Fields to include; empty uses the default set. See docs/GETTING-STARTED.md for the list.
access_log.queue APINX_ACCESS_LOG_QUEUE 0 restart Lines a remote sink (tcp, syslog, http) holds while the collector is slow or away; the newest are dropped, and counted, when it is full. 100 to 1000000; 0 means 10000 (about 4 MB).
access_log.tcp.address APINX_ACCESS_LOG_TCP_ADDRESS (empty) restart host:port of the collector's socket (sink tcp).
access_log.tcp.tls APINX_ACCESS_LOG_TCP_TLS false restart Connect with TLS.
access_log.tcp.ca_file APINX_ACCESS_LOG_TCP_CA_FILE (empty) restart PEM file of the CA that signed the collector's certificate, when it is not in the system trust store.
access_log.tcp.timeout APINX_ACCESS_LOG_TCP_TIMEOUT 0s restart Bound on one connection or write. 0 means 10s.
access_log.syslog.network APINX_ACCESS_LOG_SYSLOG_NETWORK udp restart udp (the default), tcp or tls. Streams use octet counting (RFC 6587).
access_log.syslog.address APINX_ACCESS_LOG_SYSLOG_ADDRESS (empty) restart host:port of the syslog server (sink syslog).
access_log.syslog.ca_file APINX_ACCESS_LOG_SYSLOG_CA_FILE (empty) restart PEM file of the CA that signed the server's certificate (network tls), when it is not in the system trust store.
access_log.syslog.facility APINX_ACCESS_LOG_SYSLOG_FACILITY local0 restart Syslog facility: local0 (the default) to local7, or user, daemon and the other standard names. The severity follows the status: informational, warning for 4xx, error for 5xx.
access_log.syslog.app_name APINX_ACCESS_LOG_SYSLOG_APP_NAME apinx restart APP-NAME on every message. Default apinx. HOSTNAME is cluster.node or the host name.
access_log.syslog.timeout APINX_ACCESS_LOG_SYSLOG_TIMEOUT 0s restart Bound on one connection or write. 0 means 10s.
access_log.http.url APINX_ACCESS_LOG_HTTP_URL (empty) restart Where batches are posted (sink http): Seq https://seq.example.com/ingest/clef, Loki https://loki.example.com/loki/api/v1/push, Elasticsearch or OpenSearch https://es.example.com/_bulk, or any collector that takes NDJSON.
access_log.http.format APINX_ACCESS_LOG_HTTP_FORMAT ndjson restart ndjson (the default: one JSON object per line), loki (the push format, with labels), elasticsearch (the bulk format, into index) or seq (CLEF events).
access_log.http.api_key APINX_ACCESS_LOG_HTTP_API_KEY (secret) restart Sent as X-Seq-ApiKey with format seq, as the Authorization header otherwise: write it in full, such as Bearer … for Loki behind a proxy or ApiKey … for Elasticsearch. Use APINX_ACCESS_LOG_HTTP_API_KEY.
access_log.http.headers APINX_ACCESS_LOG_HTTP_HEADERS [] restart Extra request headers, each Name: value (a Loki tenant: X-Scope-OrgID: team-a).
access_log.http.labels APINX_ACCESS_LOG_HTTP_LABELS [] restart Loki stream labels, each name=value, beside job=apinx and node.
access_log.http.index APINX_ACCESS_LOG_HTTP_INDEX apinx-access restart Elasticsearch index or data stream. Default apinx-access.
access_log.http.compress APINX_ACCESS_LOG_HTTP_COMPRESS false restart Gzip every batch.
access_log.http.ca_file APINX_ACCESS_LOG_HTTP_CA_FILE (empty) restart PEM file of the CA that signed the collector's certificate, when it is not in the system trust store.
access_log.http.batch APINX_ACCESS_LOG_HTTP_BATCH 500 restart Lines per request, 1 to 10000; a batch also goes when the oldest line in it is a second old. 0 means 500.
access_log.http.timeout APINX_ACCESS_LOG_HTTP_TIMEOUT 0s restart Bound on one request. 0 means 10s. A 5xx or 429 is retried twice, after one and two seconds; a 4xx is not.
otel.enabled APINX_OTEL_ENABLED false restart Export traces and metrics to an OpenTelemetry collector over OTLP. Off by default: nothing leaves the server. The request inspector in the console works either way.
otel.endpoint APINX_OTEL_ENDPOINT (empty) restart The collector: host:port with protocol grpc (otel.example.com:4317), an http(s) URL with protocol http (https://otel.example.com:4318). Required when enabled.
otel.protocol APINX_OTEL_PROTOCOL grpc restart grpc (the default) or http (OTLP over HTTP with protobuf).
otel.insecure APINX_OTEL_INSECURE false restart grpc without TLS, for a collector on localhost or a private network.
otel.ca_file APINX_OTEL_CA_FILE (empty) restart PEM file of the CA that signed the collector's certificate, when it is not in the system trust store.
otel.authorization APINX_OTEL_AUTHORIZATION (secret) restart The Authorization header sent with every export (Bearer …, Basic …). A bare token is sent as Bearer . Use APINX_OTEL_AUTHORIZATION.
otel.headers APINX_OTEL_HEADERS [] restart Extra headers on every export, each Name: value (a tenant such as X-Scope-OrgID: team-a).
otel.service_name APINX_OTEL_SERVICE_NAME apinx restart service.name on every span and metric. Default apinx. The instance's cluster.node is service.instance.id.
otel.sampling APINX_OTEL_SAMPLING 1 restart Share of traces exported, 0 to 1; a request whose client sent a sampled traceparent is always exported. 1 exports every request.
otel.metrics APINX_OTEL_METRICS false restart Export the Prometheus metrics over OTLP as well, every interval. Off by default: a traces-only collector (Jaeger, Tempo) refuses them; turn it on for an OpenTelemetry Collector or Grafana Cloud. /metrics serves Prometheus either way.
otel.interval APINX_OTEL_INTERVAL 1m0s restart How often metrics are exported. 0 means 1m.
otel.timeout APINX_OTEL_TIMEOUT 10s restart Bound on one export. 0 means 10s. A collector that is away costs retries in the background, never a request.
inspector.enabled APINX_INSPECTOR_ENABLED true hot Keep recent requests in memory for the Traffic screen and the request inspector (tracing). The default: administrators switch it on or off in the console (Traffic, Settings > Observability), which then wins until reset. In Apinx Cloud each organization's tracing is off until one of its editors or administrators starts it for two minutes; false turns tracing off for every organization.
inspector.capacity APINX_INSPECTOR_CAPACITY 2000 restart Number of most recent requests kept.
inspector.retention APINX_INSPECTOR_RETENTION 15m0s restart How long a captured request stays visible.
inspector.shared APINX_INSPECTOR_SHARED false restart Keep captured requests in Redis as well (redis.address), so the Traffic screen and the request inspector find a request whichever instance served it (cluster.mode ha). Each instance keeps its own memory too; capacity and retention bound the shared copy likewise. Written off the request path in batches; a Redis that is away costs nothing but the shared copy.
inspector.body_preview_chars APINX_INSPECTOR_BODY_PREVIEW_CHARS 1000 hot Characters of each request and response body shown in the request inspector (the first ones). 0 captures no bodies. The default: the console can switch request and response bodies separately, keep them for a limited time only (debug window) and change the length. Bodies may hold personal data: lower it, or set 0, where that matters. Apinx Cloud never keeps a body, whatever this says.
analytics.enabled APINX_ANALYTICS_ENABLED true restart Aggregate traffic into minute, hour and day rollups for the dashboard.
analytics.path APINX_ANALYTICS_PATH out/data/analytics.db restart Path of the analytics SQLite file, separate from the configuration store. Ignored on PostgreSQL.
analytics.dsn APINX_ANALYTICS_DSN (secret) restart PostgreSQL connection string for the rollup tables. Empty: the rollups use the configuration store's database when storage.driver is postgres, otherwise the SQLite file at path. Use APINX_ANALYTICS_DSN.
analytics.flush_interval APINX_ANALYTICS_FLUSH_INTERVAL 10s restart How often in-memory aggregates are written to the file.
analytics.retention.minute APINX_ANALYTICS_RETENTION_MINUTE 48h0m0s restart Retention of per-minute rollups. At least 2h so hours can be rolled up first.
analytics.retention.hour APINX_ANALYTICS_RETENTION_HOUR 720h0m0s restart Retention of per-hour rollups. At least 48h.
analytics.retention.day APINX_ANALYTICS_RETENTION_DAY 9600h0m0s restart Retention of per-day rollups.
storage.driver APINX_STORAGE_DRIVER sqlite restart Database engine: sqlite (one file, the default) or postgres.
storage.path APINX_STORAGE_PATH out/data/apinx.db restart Path of the SQLite database file. Created on first start. Ignored with driver postgres.
storage.dsn APINX_STORAGE_DSN (secret) restart PostgreSQL connection string with driver postgres, for example postgres://apinx:secret@db:5432/apinx?sslmode=require. Tables are created on first start. Use APINX_STORAGE_DSN rather than the file.
security.master_key_provider APINX_SECURITY_MASTER_KEY_PROVIDER (empty) restart Where the master key comes from: key, file, vault, command or generated. Empty picks key or file when one is set, otherwise generated: a key file created on first start at master_key_file (default: next to the configuration file), development only; the console warns.
security.master_key APINX_SECURITY_MASTER_KEY (secret) restart The master key, 32 bytes as base64 (provider key). Use the APINX_SECURITY_MASTER_KEY environment variable rather than the file.
security.master_key_file APINX_SECURITY_MASTER_KEY_FILE (empty) restart Path of a file holding the master key, 32 bytes raw or base64, readable by Apinx only (provider file). Also where a generated key is written.
security.master_key_command APINX_SECURITY_MASTER_KEY_COMMAND [] restart Program and arguments that wrap (argument wrap) or unwrap (argument unwrap) a data key on stdin/stdout, e.g. a script around aws kms encrypt (provider command).
security.previous_master_key APINX_SECURITY_PREVIOUS_MASTER_KEY (secret) restart The master key being retired, during a rotation: data keys it wrapped are re-wrapped under the current key on start. Remove it afterwards.
security.previous_master_key_file APINX_SECURITY_PREVIOUS_MASTER_KEY_FILE (empty) restart File form of previous_master_key.
security.vault.address APINX_SECURITY_VAULT_ADDRESS (empty) restart Vault address, e.g. https://vault.example.com:8200.
security.vault.token APINX_SECURITY_VAULT_TOKEN (secret) restart Vault token. Use APINX_SECURITY_VAULT_TOKEN.
security.vault.transit_key APINX_SECURITY_VAULT_TRANSIT_KEY (empty) restart Transit key that wraps Apinx's data keys (provider vault).
security.vault.transit_mount APINX_SECURITY_VAULT_TRANSIT_MOUNT transit restart Mount path of the Transit engine.
security.vault.timeout APINX_SECURITY_VAULT_TIMEOUT 5s restart Timeout of each Vault call (start-up and reference resolution only, never on the request path).
license.file APINX_LICENSE_FILE (empty) hot Path of the licence file issued by MoznHub. Read at start and whenever it changes.
license.text APINX_LICENSE_TEXT (empty) hot The licence itself, inline; in containers prefer the APINX_LICENSE_TEXT environment variable.
platform.driver APINX_PLATFORM_DRIVER sqlite restart SaaS edition only. sqlite (a developer machine) or postgres (production) for the platform database. Ignored by the on-premises build.
platform.path APINX_PLATFORM_PATH out/data/platform.db restart SaaS edition only. SQLite file of the platform database; created on first start.
platform.dsn APINX_PLATFORM_DSN (secret) restart SaaS edition only. PostgreSQL connection string of the platform database, preferably through APINX_PLATFORM_DSN. A database of its own, never the gateway store's.
saas.website_host APINX_SAAS_WEBSITE_HOST (empty) restart SaaS edition only. Host of the product website, e.g. apinx.io.
saas.console_host APINX_SAAS_CONSOLE_HOST (empty) restart SaaS edition only. Host of the console and the Admin API; organizations live under /{org}, operators under /ops.
saas.gateway_host APINX_SAAS_GATEWAY_HOST (empty) restart SaaS edition only. Host of tenant traffic; organizations live under /{org}.
saas.org_host_suffix APINX_SAAS_ORG_HOST_SUFFIX (empty) restart SaaS edition only. Domain under which every organization also answers at a host of its own, {org}. (apinx.io gives acme.apinx.io): the address for gRPC clients, which cannot add the /{org} segment. Empty: the path form only.
saas.gateway_listen APINX_SAAS_GATEWAY_LISTEN :8080 restart SaaS edition only. Address of the shared gateway listener for tenant traffic, e.g. :8080. Organizations' own listener definitions are not bound.
saas.gateway_max_connections APINX_SAAS_GATEWAY_MAX_CONNECTIONS 0 restart SaaS edition only. Most connections the shared gateway listener holds open at once; past it new callers queue in the kernel until one closes. 0: 10,000. -1: no bound (the process's open-files limit is then the only one).
saas.allow_private_upstreams APINX_SAAS_ALLOW_PRIVATE_UPSTREAMS false restart SaaS edition only. Allow tenant upstreams on loopback, private and link-local addresses. Development only: in production the shared gateway must not reach the platform's own network.
shutdown.drain_timeout APINX_SHUTDOWN_DRAIN_TIMEOUT 30s restart Maximum time to wait for in-flight requests and components to stop.
cluster.mode APINX_CLUSTER_MODE single restart single (the default): one instance; what it needs lives in its own memory and its database, SQLite or PostgreSQL, nothing else to run. ha: several instances share one PostgreSQL database behind a load balancer; each applies what any of them deploys, reloads consumers when they change, and one at a time runs the background jobs. Needs storage.driver postgres and a configured master key.
cluster.node APINX_CLUSTER_NODE (empty) restart This instance's name in traces and logs (ha). Empty: the host name.
cluster.watch_interval APINX_CLUSTER_WATCH_INTERVAL 2s restart How often an instance looks for a deployment, a consumer change or an inspector setting made on another instance (ha). Two short queries per interval in Apinx Cloud, whatever the number of organizations; four single-row queries per interval on premises.
redis.address APINX_REDIS_ADDRESS (empty) restart host:port of one Redis 6 or later server. Empty, with addresses empty too: no shared counters; rate limits, quotas and concurrency limits count per instance.
redis.addresses APINX_REDIS_ADDRESSES [] restart Several host:port entries: the Sentinel instances when master_name is set, the Cluster nodes otherwise. Use instead of address.
redis.master_name APINX_REDIS_MASTER_NAME (empty) restart The master Sentinel monitors; addresses then names the Sentinels.
redis.username APINX_REDIS_USERNAME (empty) restart User for Redis ACLs; empty for the default user.
redis.password APINX_REDIS_PASSWORD (secret) restart Password, preferably through APINX_REDIS_PASSWORD.
redis.db APINX_REDIS_DB 0 restart Database number.
redis.tls APINX_REDIS_TLS false restart Connect with TLS.
redis.timeout APINX_REDIS_TIMEOUT 200ms restart Bound on one counter operation. Past it the request is counted on this instance alone and Redis is left alone for two seconds.
redis.key_prefix APINX_REDIS_KEY_PREFIX apinx restart Prefix of every key, so one Redis can serve several installations.
redis.pool_size APINX_REDIS_POOL_SIZE 64 restart Connections kept to Redis at most. Each request with a shared limit holds one for its round trip, so size it near the requests in flight at once; 0 means 64.
assistant.enabled APINX_ASSISTANT_ENABLED false restart Offer the console assistant. It also needs an AI key, here or in Admin › Assistant.
assistant.api_key APINX_ASSISTANT_API_KEY (secret) restart Claude API key. Use APINX_ASSISTANT_API_KEY.
assistant.base_url APINX_ASSISTANT_BASE_URL (empty) restart Address of the Claude API. Empty: Anthropic's endpoint. Set it to reach the API through a corporate proxy.
assistant.model APINX_ASSISTANT_MODEL claude-sonnet-5-5 restart The model that answers.
assistant.guard_model APINX_ASSISTANT_GUARD_MODEL claude-sonnet-5-5 restart The model that checks each question is in English and about Apinx.
assistant.monthly_token_cap APINX_ASSISTANT_MONTHLY_TOKEN_CAP 0 restart Tokens the assistant may use per calendar month, for the whole organization. 0: no cap.
assistant.max_output_tokens APINX_ASSISTANT_MAX_OUTPUT_TOKENS 2000 restart Longest answer per model call, in tokens.
assistant.questions_per_user_hour APINX_ASSISTANT_QUESTIONS_PER_USER_HOUR 20 restart Questions one person may ask per hour.
assistant.retention_days APINX_ASSISTANT_RETENTION_DAYS 30 restart Days a conversation is kept after its last message.
assistant.max_in_flight APINX_ASSISTANT_MAX_IN_FLIGHT 32 restart Answers running at once on this instance; the next question is told to try again.
capacity.nginx_status_url APINX_CAPACITY_NGINX_STATUS_URL (empty) restart Address of nginx's stub_status page on this host, e.g. http://127.0.0.1:8099/nginx_status. Empty: nginx is not watched.
capacity.nginx_max_connections APINX_CAPACITY_NGINX_MAX_CONNECTIONS 0 restart The most connections nginx holds at once: worker_connections times worker_processes in nginx.conf. 0: unknown; the view shows the count without a share.
capacity.link_mbps APINX_CAPACITY_LINK_MBPS 0 restart The server's network speed in megabits per second, from the hosting plan, when the network card does not report it. 0: as the card reports, or unknown.

Minimal file

console:
  listen: ":9000"
proxy:
  config_file: gateway.yaml   # seeds an empty store; ignored once something is published
storage:
  path: /var/lib/apinx/apinx.db
analytics:
  path: /var/lib/apinx/analytics.db

Ready-to-run examples: configs/apinx.example.yaml (development), deploy/docker/apinx.yaml, deploy/systemd/apinx.yaml and the ConfigMap in deploy/kubernetes/apinx.yaml.