--- description: Look up every OpenViking Gateway configuration field, environment variable, context profile setting and upstream setting. --- # OpenViking Gateway configuration reference This page is for operators editing `ov.conf`, `gateway.conf` or environment variables, and for anyone mapping a Studio label to its management API name. Every table gives the name, default and accepted values; what a setting does and when to change it are on the feature page linked from each section. ## Where the settings live {#configuration-reference} An embedded and a standalone gateway share most fields; they differ in which file holds them and how you create it. The **Form** column under [Gateway fields](#gateway-fields) marks the fields that only one form uses. | | Embedded | Standalone | | --- | --- | --- | | File | The `gateway` section of `ov.conf` | The root of `gateway.conf`, with no `gateway` wrapper | | Created by | `openviking-server init` | `openviking-gateway init` | | Which file is read | The server's own `ov.conf` | `--config` or `OPENVIKING_GATEWAY_CONFIG_FILE`, which must point to an existing file; otherwise the first of `~/.openviking/gateway.conf` and `/etc/openviking/gateway.conf` that exists | | Host, port and workers | Come from the server | The `host`, `port` and `workers` fields | `OPENVIKING_CONFIG_FILE` only selects the server's configuration; it never points a standalone gateway at a file. ## Gateway fields {#gateway-fields} | Field | Form | Default | Accepted values | Meaning | | --- | --- | --- | --- | --- | | `enabled` | Embedded | `false` | | Turns the gateway on inside the server | | `openviking_url` | Standalone | — (required) | HTTP(S) URL | Address of the OpenViking Server | | `host` | Standalone | `127.0.0.1` | | Listen address | | `port` | Standalone | `1935` | 1–65,535 | Listen port | | `workers` | Standalone | `1` | 1–64 | Worker processes | | `public_url` | Both | empty | HTTP(S) URL, without `/gateway` | The external address clients use; the gateway appends `/gateway` itself. When empty, an embedded gateway uses the server's public address; with neither, setup guides use the request's origin, and MCP file uploads and downloads do not work unless `mcp_file_links` is `direct`. See [Public address](../guides/22-gateway-operations.md#public-address) | | `mcp_file_links` | Both | `proxy` | `proxy`, `direct` | How links from the MCP upload and download tools reach the client. `proxy` rewrites them to `public_url` plus `/gateway/uploads` or `/gateway/downloads` and needs `public_url`. `direct` passes OpenViking's links through unchanged and needs the server's `OPENVIKING_PUBLIC_BASE_URL` (or `server.public_base_url`) to be reachable by the client | | `storage_path` | Both | `~/.openviking/gateway` | | Local storage directory | | `encryption` | Standalone | not set (plain text) | Same fields as the `encryption` section of `ov.conf` | Encrypts stored data; see [Encryption](../guides/22-gateway-operations.md#encryption). Embedded gateways use the server's section | | `management_key` | Both | empty | At least 32 characters | Optional [gateway management key](../guides/22-gateway-operations.md#gateway-management-key) | | `min_server_version` | Both | `0.4.16` | Version string | Lowest OpenViking Server version a standalone gateway accepts | | `session_ttl_days` | Both | `30` | 1 or more | Days of inactivity before a conversation expires | | `response_ttl_seconds` | Both | `2592000` (30 days) | 60 or more | Seconds to remember which upstream created a Responses response | | `log_retention_days` | Both | `30` | 1 or more | Days to keep request logs | | `max_body_bytes` | Both | `33554432` (32 MiB) | 1,024 or more | Size limit for requests and uploads, in bytes | | `upstream_timeout_seconds` | Both | `600` | More than 0 | Timeout for provider requests | | `health_interval_seconds` | Both | `60` | 1 or more | Seconds between OpenViking status checks | | `client_rules` | Both | `{}` (packaged rules only) | See [Client rules](#client-rules) | Text added to or removed from what the gateway recognizes as housekeeping requests and client-inserted messages | ## Environment variables {#environment-variables} Every gateway field can be set as an environment variable named `OPENVIKING_GATEWAY_` plus the field name in upper case, in both forms: ```bash OPENVIKING_GATEWAY_PUBLIC_URL=https://ov.example.com OPENVIKING_GATEWAY_MANAGEMENT_KEY='' ``` - **Environment variables override the file.** A non-empty variable wins over the value in the file; an empty variable counts as unset. - Values that start with `tcp://` or `udp://` are ignored, so the variables Kubernetes sets for a Service named `openviking-gateway` (such as `OPENVIKING_GATEWAY_PORT=tcp://…`) do not override the file. - A value in the file can also be a `"$VAR"` reference, resolved from the environment. - The `encryption` block can only be set in the file. - `client_rules` takes the whole section as JSON: `OPENVIKING_GATEWAY_CLIENT_RULES='{"auxiliary_patterns":{"add":["You are the Acme title writer"]}}'`. - Containers usually need no file: set the fields they need as variables. ## Validation {#validation} | What | Rule | | --- | --- | | `openviking_url` and `public_url` | HTTP(S), with no credentials, query or fragment | | Upstream `base_url` | Its own rules; see [Endpoint](07-upstreams.md#endpoint) | | `management_key` | At least 32 characters once `$VAR` references are resolved; an unresolved `$VAR` fails | | `client_rules` | Every added pattern must be a valid Python regular expression; added tag names start with an ASCII letter and use only ASCII letters, digits, `_`, `.`, `:` and `-` | | Unknown fields | Fail validation | | Removed fields | Ignored, with a startup warning: `encryption_key_env`, and in `ov.conf` also the v0.5 fields listed in [Migration](../guides/22-gateway-operations.md#migration) | ## Client rules {#client-rules} The gateway tells [housekeeping requests](10-overview-and-requests.md#request-types) and the messages clients insert on the user's behalf apart from real user messages by fixed text, listed in the packaged [`client-rules.json`](https://github.com/volcengine/OpenViking/blob/main/openviking_gateway/client-rules.json). When a client's title or summary requests show up as **New message** in the request log, or a real message is treated as housekeeping, add or remove entries in `client_rules`: ```json { "gateway": { "enabled": true, "client_rules": { "auxiliary_patterns": { "add": ["You are the Acme title writer"], "remove": ["Create a short.{0,40}title"] }, "noise_tags": { "add": ["acme-context"] } } } } ``` In `gateway.conf`, `client_rules` sits at the root, without the `gateway` wrapper. | List | Entries | What a match does | | --- | --- | --- | | `auxiliary_patterns` | Regular expressions, ignoring case | Each is matched separately against the Messages `system` field, the Responses `instructions` and the latest user message. A match makes the request **Housekeeping**. System and developer messages inside Chat Completions `messages` or Responses `input` are not checked, so for those clients match text in the user message. | | `noise_patterns` | Regular expressions, case-sensitive | Ignored when the gateway reads the conversation: left out of request classification, the memory search and saved messages and tool results, but still sent to the model unchanged. A user message left empty is not a new user message, so the request continues the turn. | | `noise_tags` | Tag names | `…` blocks, in any letter case, handled the same way as `noise_patterns`. | | `plugin_tags` | Tag names | `