Skip to main content
This page details the environment variables that can be used to configure the Tyk Edge Gateway.
The Edge Gateway binary, its Helm values, and its container images use the older name microgateway (for example ./microgateway, the microgateway.enabled Helm value, and the tykio/tyk-microgateway-ent image). These docs use “Edge Gateway” for the same component.

Configuration

Tyk Edge Gateway (Edge Gateway) is configured primarily using environment variables.

Configuration Precedence

The application loads configuration in the following order of precedence (highest to lowest):
  1. Shell Environment Variables: Variables set in the OS/Shell (e.g., export PORT=9090) always override everything else.
  2. .env File: Variables loaded from the file specified by the -env flag.
    • Note: Before the application loads a variable from the file, it checks the environment for that variable. This keeps the shell variables.

Command Line Flags

You can specify a .env file using the -env flag when starting the binary:

Supported Formats

  • Main Configuration: Only the .env format (key=value pairs) is supported via the -env flag.
  • Plugin Configuration: Supports JSON and YAML files for plugin definitions, specified via the PLUGINS_CONFIG_PATH environment variable.

Environment Variable Type Mapping

When configuring Tyk components using environment variables, it’s important to understand how different data types are represented. The type of each variable is based on its definition in the Go source code. This section provides a guide on how to format values for common data types.
For complex types like map[string]interface{}, the value should be a valid JSON string. For []string and map[string]string, ensure there are no spaces around the commas unless they are part of the value itself.

Variables

PORT

ENV: PORT
Type: integer
Default: 8080
The port for the server to listen on.

HOST

ENV: HOST
Type: string
Default: 0.0.0.0
The host for the server to bind to.

TLS_ENABLED

ENV: TLS_ENABLED
Type: boolean
Default: false
Enable TLS.

TLS_CERT_PATH

ENV: TLS_CERT_PATH
Type: string
The path to the TLS certificate file.

TLS_KEY_PATH

ENV: TLS_KEY_PATH
Type: string
The path to the TLS key file.

READ_TIMEOUT

ENV: READ_TIMEOUT
Type: string
Default: 300s
The read timeout for the server.

WRITE_TIMEOUT

ENV: WRITE_TIMEOUT
Type: string
Default: 300s
The write timeout for the server.

IDLE_TIMEOUT

ENV: IDLE_TIMEOUT
Type: string
Default: 120s
The idle timeout for the server.

SHUTDOWN_TIMEOUT

ENV: SHUTDOWN_TIMEOUT
Type: string
Default: 30s
The shutdown timeout for the server.

DATABASE_TYPE

ENV: DATABASE_TYPE
Type: string
Default: sqlite
The type of database to use (sqlite or postgres).

DATABASE_DSN

ENV: DATABASE_DSN
Type: string
Default: file:./data/microgateway.db?mode=rwc
The database connection string. For a SQLite file, from v2.3.0, the Edge Gateway adds _journal_mode=WAL, _busy_timeout=5000, _synchronous=NORMAL, and _txlock=immediate when the string does not set them, and removes cache=shared. On a network file system, set _journal_mode=DELETE.

DB_MAX_OPEN_CONNS

ENV: DB_MAX_OPEN_CONNS
Type: integer
Default: 25
The maximum number of open database connections.

DB_MAX_IDLE_CONNS

ENV: DB_MAX_IDLE_CONNS
Type: integer
Default: 25
The maximum number of idle database connections.

DB_CONN_MAX_LIFETIME

ENV: DB_CONN_MAX_LIFETIME
Type: string
Default: 5m
The maximum lifetime of a database connection.

DB_AUTO_MIGRATE

ENV: DB_AUTO_MIGRATE
Type: boolean
Default: true
Enable automatic database migrations.

DB_LOG_LEVEL

ENV: DB_LOG_LEVEL
Type: string
Default: warn
The log level for the database.

CACHE_ENABLED

ENV: CACHE_ENABLED
Type: boolean
Default: true
Enable caching.

CACHE_MAX_SIZE

ENV: CACHE_MAX_SIZE
Type: integer
Default: 1000
The maximum size of the cache.

CACHE_TTL

ENV: CACHE_TTL
Type: string
Default: 1h
The time-to-live for cache entries.

CACHE_CLEANUP_INTERVAL

ENV: CACHE_CLEANUP_INTERVAL
Type: string
Default: 10m
The cleanup interval for the cache.

CACHE_PERSIST_TO_DB

ENV: CACHE_PERSIST_TO_DB
Type: boolean
Default: false
Persist the cache to the database.

GATEWAY_TIMEOUT

ENV: GATEWAY_TIMEOUT
Type: string
Default: 30s
The timeout for the gateway.

GATEWAY_MAX_REQUEST_SIZE

ENV: GATEWAY_MAX_REQUEST_SIZE
Type: integer
Default: 10485760
The maximum request size for the gateway.

GATEWAY_MAX_RESPONSE_SIZE

ENV: GATEWAY_MAX_RESPONSE_SIZE
Type: integer
Default: 52428800
The maximum response size for the gateway.

GATEWAY_ENABLE_FILTERS

ENV: GATEWAY_ENABLE_FILTERS
Type: boolean
Default: true
Enable filters in the gateway.

GATEWAY_ENABLE_ANALYTICS

ENV: GATEWAY_ENABLE_ANALYTICS
Type: boolean
Default: true
Enable analytics in the gateway.

ANALYTICS_ENABLED

ENV: ANALYTICS_ENABLED
Type: boolean
Default: true
Enable analytics.

ANALYTICS_BUFFER_SIZE

ENV: ANALYTICS_BUFFER_SIZE
Type: integer
Default: 1000
The buffer size for analytics.

ANALYTICS_FLUSH_INTERVAL

ENV: ANALYTICS_FLUSH_INTERVAL
Type: string
Default: 10s
The flush interval for analytics.

ANALYTICS_RETENTION_DAYS

ENV: ANALYTICS_RETENTION_DAYS
Type: integer
Default: 7 when the analytics pulse is on, otherwise 90
The retention period for analytics in days. The Edge Gateway deletes older analytics rows in small batches.

ANALYTICS_REALTIME

ENV: ANALYTICS_REALTIME
Type: boolean
Default: false
Enable real-time analytics.

ANALYTICS_STORE_REQUESTS

ENV: ANALYTICS_STORE_REQUESTS
Type: boolean
Default: false
Stores the request body of each proxied LLM request in the analytics of the Edge Gateway. The Edge Gateway truncates a body to ANALYTICS_MAX_BODY_SIZE bytes (default 4096). When this setting is off, the analytics pulse sends no request bodies to AI Studio.

ANALYTICS_STORE_RESPONSES

ENV: ANALYTICS_STORE_RESPONSES
Type: boolean
Default: false
Stores the response body of each proxied LLM request in the analytics of the Edge Gateway. The Edge Gateway truncates a body to ANALYTICS_MAX_BODY_SIZE bytes (default 4096). When this setting is off, the analytics pulse sends no response bodies to AI Studio.

JWT_SECRET

ENV: JWT_SECRET
Type: string
Default: change-me-in-production
The secret key for JWTs.

ENCRYPTION_KEY

ENV: ENCRYPTION_KEY
Type: string
Default: change-me-in-production
The encryption key. Change the default value in production. From v2.3.0, a standalone Edge Gateway uses this key to hash its stored API tokens. An Edge Gateway in edge mode uses it to encrypt its stored configuration snapshot. If you change the key, all API tokens stop working, and the Edge Gateway cannot read the stored snapshot.

BCRYPT_COST

ENV: BCRYPT_COST
Type: integer
Default: 10
The cost factor for bcrypt.

TOKEN_LENGTH

ENV: TOKEN_LENGTH
Type: integer
Default: 32
The length of generated tokens.

SESSION_TIMEOUT

ENV: SESSION_TIMEOUT
Type: string
Default: 24h
The timeout for sessions.

ENABLE_IP_WHITELIST

ENV: ENABLE_IP_WHITELIST
Type: boolean
Default: false
Enable IP whitelisting.

LOG_LEVEL

ENV: LOG_LEVEL
Type: string
Default: info
The log level.

LOG_FORMAT

ENV: LOG_FORMAT
Type: string
Default: text
The log format (json or text).

ENABLE_METRICS

ENV: ENABLE_METRICS
Type: boolean
Default: true
Enable metrics. The Edge Gateway serves /metrics only when you also set METRICS_AUTH_TOKEN or METRICS_ALLOW_UNAUTHENTICATED.

METRICS_PATH

ENV: METRICS_PATH
Type: string
Default: /metrics
The path for metrics.

ENABLE_TRACING

ENV: ENABLE_TRACING
Type: boolean
Default: false
Enable tracing.

TRACING_ENDPOINT

ENV: TRACING_ENDPOINT
Type: string
The endpoint for tracing.

ENABLE_PROFILING

ENV: ENABLE_PROFILING
Type: boolean
Default: false
Enable profiling.

GATEWAY_MODE

ENV: GATEWAY_MODE
Type: string
Default: standalone
The gateway mode (standalone or edge). The value control is deprecated: register Edge Gateways with AI Studio. In Enterprise builds, a gateway in control mode serves only the default namespace.

CONTROL_ENDPOINT

ENV: CONTROL_ENDPOINT
Type: string
The gRPC endpoint of the control plane. To give the Edge Gateway more than one control plane, use CONTROL_ENDPOINTS. Do not set both variables.

EDGE_ID

ENV: EDGE_ID
Type: string
A unique ID for the edge gateway.

EDGE_NAMESPACE

ENV: EDGE_NAMESPACE
Type: string
The namespace for the edge gateway.

EDGE_RECONNECT_INTERVAL

ENV: EDGE_RECONNECT_INTERVAL
Type: string
Default: 5s
The interval to wait before reconnecting to the control plane.

EDGE_HEARTBEAT_INTERVAL

ENV: EDGE_HEARTBEAT_INTERVAL
Type: string
Default: 30s
The interval for sending heartbeats to the control plane.

EDGE_SYNC_TIMEOUT

ENV: EDGE_SYNC_TIMEOUT
Type: string
Default: 10s
The timeout for syncing configuration from the control plane.

EDGE_AUTH_TOKEN

ENV: EDGE_AUTH_TOKEN
Type: string
The authentication token for connecting to the control plane.

EDGE_TLS_ENABLED

ENV: EDGE_TLS_ENABLED
Type: boolean
Default: true
Enable TLS for the connection to the control plane.

EDGE_TLS_CERT_PATH

ENV: EDGE_TLS_CERT_PATH
Type: string
The path to the client TLS certificate file.

EDGE_TLS_KEY_PATH

ENV: EDGE_TLS_KEY_PATH
Type: string
The path to the client TLS key file.

EDGE_TLS_CA_PATH

ENV: EDGE_TLS_CA_PATH
Type: string
The path to the CA certificate file for verifying the control plane’s certificate. The Edge Gateway loads this file and uses it instead of the system root certificates.

EDGE_SKIP_TLS_VERIFY

ENV: EDGE_SKIP_TLS_VERIFY
Type: boolean
Default: false
Skip TLS certificate verification.

EDGE_ALLOW_INSECURE

ENV: EDGE_ALLOW_INSECURE
Type: boolean
Default: false
Allow insecure connections to the control plane.

GATEWAY_UNIFIED_ROUTER_PATH

ENV: GATEWAY_UNIFIED_ROUTER_PATH
Type: string
Default: /v1
The base path of the Main Ingress on the Edge Gateway. Set it to the same value as UNIFIED_ROUTER_PATH on AI Studio.

GATEWAY_UNIFIED_ROUTER_DISABLED

ENV: GATEWAY_UNIFIED_ROUTER_DISABLED
Type: boolean
Default: false
Turns off the Main Ingress on the Edge Gateway.

GATEWAY_SERVER_TIMING

ENV: GATEWAY_SERVER_TIMING
Type: boolean
Default: false
Adds a Server-Timing header to LLM responses. The header splits the latency into gateway time and upstream time.

METRICS_AUTH_TOKEN

ENV: METRICS_AUTH_TOKEN
Type: string
The bearer token that a scraper must send to read /metrics. If you do not set this variable or METRICS_ALLOW_UNAUTHENTICATED, the Edge Gateway does not serve /metrics.

METRICS_ALLOW_UNAUTHENTICATED

ENV: METRICS_ALLOW_UNAUTHENTICATED
Type: boolean
Default: false
Serves /metrics without a token, for example for scrapes inside a cluster. Use it only where a firewall or network policy limits access to the endpoint.

OCI_PLUGINS_MAX_PLUGIN_SIZE

ENV: OCI_PLUGINS_MAX_PLUGIN_SIZE
Type: string
Default: 512MB
The maximum size of one plugin layer that the Edge Gateway downloads from an OCI registry.

EDGE_TOKEN_CACHE_TTL

ENV: EDGE_TOKEN_CACHE_TTL
Type: duration
Default: 5m
How long the Edge Gateway keeps the result of an App key validation from AI Studio. From v2.3.0, AI Studio tells connected Edge Gateways about each change to an App key, and they drop the cached result. An Edge Gateway that is not connected uses the cached result until it expires.

EDGE_TOKEN_CACHE_STALE_GRACE

ENV: EDGE_TOKEN_CACHE_STALE_GRACE
Type: duration
Default: 0
Lets the Edge Gateway use a token validation that just expired while AI Studio is not reachable. 0 refuses the token (fails closed).

EDGE_TLS_SERVER_NAME

ENV: EDGE_TLS_SERVER_NAME
Type: string
The server name to verify on the AI Studio certificate.

ANALYTICS_WRITER_QUEUE_SIZE

ENV: ANALYTICS_WRITER_QUEUE_SIZE
Type: integer
Default: 50000
The size of the analytics writer queue.

ANALYTICS_WRITER_BATCH_SIZE

ENV: ANALYTICS_WRITER_BATCH_SIZE
Type: integer
Default: 500
The number of analytics records in each write batch.

ANALYTICS_WRITER_FLUSH_INTERVAL

ENV: ANALYTICS_WRITER_FLUSH_INTERVAL
Type: duration
Default: 100ms
How often the analytics writer flushes a batch.

OVERLOAD_SHEDDING_ENABLED

ENV: OVERLOAD_SHEDDING_ENABLED
Type: boolean
Default: true
Rejects new requests with 503 when memory use is near the limit, instead of running out of memory.

OVERLOAD_MEMORY_LIMIT

ENV: OVERLOAD_MEMORY_LIMIT
Type: string
The memory limit for load shedding. When not set, the Edge Gateway uses GOMEMLIMIT or the container memory limit.

OVERLOAD_MEMORY_THRESHOLD

ENV: OVERLOAD_MEMORY_THRESHOLD
Type: float
Default: 0.85
The fraction of the memory limit at which load shedding starts.

MAX_INFLIGHT_REQUESTS

ENV: MAX_INFLIGHT_REQUESTS
Type: integer
Default: 0
The maximum number of concurrent proxy requests. 0 turns off the limit.

PROFILING_ADDR

ENV: PROFILING_ADDR
Type: string
Default: 127.0.0.1:6060
The address where the Edge Gateway serves pprof when ENABLE_PROFILING is true.

GOGC

ENV: GOGC
Type: integer
The Go garbage collector setting. When not set, the Edge Gateway uses an adaptive value that starts at 400.

GOMEMLIMIT

ENV: GOMEMLIMIT
Type: string
The Go soft memory limit. When not set, the Edge Gateway sets it to 90% of the container memory limit.

CONTROL_ENDPOINTS

ENV: CONTROL_ENDPOINTS
Type: string
An ordered, comma-separated list of control planes (host:port). Put the control plane of the Edge Gateway’s own region first. When the connection fails, the Edge Gateway tries the other endpoints in list order. All endpoints must be replicas of one AI Studio deployment. Do not set both CONTROL_ENDPOINTS and CONTROL_ENDPOINT: the Edge Gateway does not start. For more information, see Active-active deployment. Available from v2.3.0.

EDGE_CONTROL_FAILBACK_INTERVAL

ENV: EDGE_CONTROL_FAILBACK_INTERVAL
Type: duration
Default: 0
When the Edge Gateway is not connected to the first endpoint of CONTROL_ENDPOINTS, it tries that endpoint at this interval, for example 5m. 0 turns this off: the Edge Gateway stays on its current control plane until the connection ends. Available from v2.3.0.

EDGE_START_FROM_LAST_KNOWN_GOOD

ENV: EDGE_START_FROM_LAST_KNOWN_GOOD
Type: boolean
Default: false
When no control plane answers at startup, the Edge Gateway starts from the configuration snapshot that it applied last. The snapshot is in the database of the Edge Gateway, encrypted with ENCRYPTION_KEY. The Edge Gateway can then serve LLMs, Apps, and filters that an administrator removed after the snapshot, until it connects again. Available from v2.3.0.

EDGE_STARTUP_CONTROL_TIMEOUT

ENV: EDGE_STARTUP_CONTROL_TIMEOUT
Type: duration
Default: 30s
How long the Edge Gateway tries its control endpoints at startup before it uses the stored snapshot. Applies when EDGE_START_FROM_LAST_KNOWN_GOOD is true. Available from v2.3.0.

EDGE_LAST_KNOWN_GOOD_MAX_AGE

ENV: EDGE_LAST_KNOWN_GOOD_MAX_AGE
Type: duration
Default: 72h
The maximum time since the last contact with a control plane for a start from the stored snapshot. When this time is longer, the Edge Gateway does not start. 0 sets no limit. Available from v2.3.0.

EDGE_CREDENTIAL_SYNC

ENV: EDGE_CREDENTIAL_SYNC
Type: string
Default: on_demand
How the Edge Gateway validates App keys:
  • on_demand: the Edge Gateway asks the control plane about a key that it has not seen, and caches the answer.
  • full: the Edge Gateway keeps keyed hashes of the App keys of its namespace in its database. It validates keys from that list, also when no control plane is available. It asks the control plane about a key that is not on the list. full needs Enterprise Edition on the Edge Gateway and on AI Studio v2.3.0 or later. A Community Edition Edge Gateway logs a warning and uses on_demand.
Available from v2.3.0.

EDGE_CREDENTIAL_SYNC_MAX_AGE

ENV: EDGE_CREDENTIAL_SYNC_MAX_AGE
Type: duration
Default: 24h
How long the Edge Gateway trusts the synced key list after the last successful sync. After this time, it validates keys on demand until a sync succeeds. 0 sets no limit. Enterprise Edition only. Available from v2.3.0.

CONTROL_PAYLOAD_RETENTION_HOURS

ENV: CONTROL_PAYLOAD_RETENTION_HOURS
Type: integer
Default: 24
How long, in hours, the Edge Gateway keeps the payloads that plugins send to AI Studio. The Edge Gateway deletes older payloads, sent or not. It also stops trying to send a payload after this time.

GATEWAY_PUBLIC_URL

ENV: GATEWAY_PUBLIC_URL
Type: string
The absolute base URL at which clients reach the Edge Gateway. Native API operations use it in the URLs they return, for example the results_url of an Anthropic batch. When not set, these URLs are relative paths. Available from v2.3.0.

PLUGINS_ALLOWED_SOURCES

ENV: PLUGINS_ALLOWED_SOURCES
Type: string
A comma-separated list of the plugin deployment types that the Edge Gateway accepts: oci, file, and grpc. When not set, the Edge Gateway accepts all types. The Edge Gateway applies this list to the plugins that AI Studio sends. It does not load a plugin of a type that is not in the list. An unknown type stops startup. For more information, see Plugin security. Available from v2.3.0.

OCI_PLUGINS_ALLOWED_REGISTRIES

ENV: OCI_PLUGINS_ALLOWED_REGISTRIES
Type: string
A comma-separated list of OCI registry hosts. When set, the Edge Gateway refuses an oci:// plugin from any other registry. When not set, the Edge Gateway accepts all registries.

PLUGIN_COMMAND_ALLOWLIST

ENV: PLUGIN_COMMAND_ALLOWLIST
Type: string
A comma-separated list of substrings for plugin commands. The list is advisory. The Edge Gateway logs a warning for a plugin command that does not contain one of the substrings, but it accepts the command. Entries are plain substrings, not wildcards.

PLUGIN_BLOCK_INTERNAL_URLS

ENV: PLUGIN_BLOCK_INTERNAL_URLS
Type: boolean
Default: false
Deprecated. When true, the Edge Gateway refuses a plugin command that contains an internal address anywhere, for example in a host:port argument. When false, the Edge Gateway logs a warning for such a command. From v2.3.0, the Edge Gateway refuses internal plugin hosts without this setting. Refer to Internal Registries and Hosts.

OCI_PLUGINS_REQUIRE_SIGNATURE

ENV: OCI_PLUGINS_REQUIRE_SIGNATURE
Type: boolean
Default: true
Requires a valid signature on OCI plugins. The Edge Gateway does not load an unsigned plugin, or a plugin that has a signature from a key that you did not configure. An invalid value stops startup. Enterprise Edition only.

OCI_PLUGINS_PUBKEY_*

ENV: OCI_PLUGINS_PUBKEY_*
Type: string
Public keys for OCI plugin signatures. OCI_PLUGINS_PUBKEY_<N> and OCI_PLUGINS_PUBKEY_<NAME> hold a PEM key. OCI_PLUGINS_PUBKEY_FILE_<NAME> holds the path to a PEM file. When a plugin command does not name a key with ?pubkey=, the Edge Gateway accepts the plugin if one of the configured keys verifies it. Configure the same keys on AI Studio and on each Edge Gateway. Enterprise Edition only.

OCI_PLUGINS_TLOG_POLICY

ENV: OCI_PLUGINS_TLOG_POLICY
Type: string
Default: required
Sets whether an OCI plugin signature needs a transparency log (Rekor) entry. required needs an entry. optional checks an entry when the signature has one. disabled checks the signature against the key only. An invalid value stops startup. Enterprise Edition only. Available from v2.3.0.

OCI_PLUGINS_TRUSTED_ROOT_FILE

ENV: OCI_PLUGINS_TRUSTED_ROOT_FILE
Type: string
The path to a Sigstore trusted_root.json file for a private Sigstore deployment. When not set, the Edge Gateway uses its built-in Sigstore trusted root. Enterprise Edition only. Available from v2.3.0.

LLM_UPSTREAM_BLOCK_INTERNAL

ENV: LLM_UPSTREAM_BLOCK_INTERNAL
Type: boolean
Default: true
Refuses outbound connections to internal and reserved IP addresses, by IP address or by a hostname that resolves to one. For the addresses and the covered connections, refer to Outbound Network Policy. Set the same value on AI Studio and on each Edge Gateway. A value that is not a boolean stops startup. From v2.3.0, the default is true.

LLM_UPSTREAM_ALLOWED_HOSTS

ENV: LLM_UPSTREAM_ALLOWED_HOSTS
Type: string
A comma-separated allow list of upstream hostnames. An entry that starts with . matches the domain and all its subdomains. When not set, the Edge Gateway allows all hosts.

LLM_UPSTREAM_ALLOWED_INTERNAL_HOSTS

ENV: LLM_UPSTREAM_ALLOWED_INTERNAL_HOSTS
Type: string
A comma-separated list of internal hostnames that the Edge Gateway allows when LLM_UPSTREAM_BLOCK_INTERNAL is true. For example, .svc.cluster.local allows all Kubernetes Services. Name internal plugin registries here too.

AI_STUDIO_VERTEX_ADC

ENV: AI_STUDIO_VERTEX_ADC
Type: boolean
Default: false
Lets a Gemini Platform (Vertex) LLM with an empty API key use the Google credentials of this edge (Application Default Credentials). Each edge then needs its own GCP identity with access to Vertex AI. A Workload Identity Federation credential (external_account) also needs this setting. The name and the behavior are the same as on AI Studio. Refer to AI_STUDIO_VERTEX_ADC. Available from v2.3.0.

ALLOW_INTERNAL_NETWORK_ACCESS

ENV: ALLOW_INTERNAL_NETWORK_ACCESS
Type: boolean
Default: false
Turns off all internal address checks. Use it for development only. The Edge Gateway logs a warning at startup. Plugins do not get this variable unless you add it to PLUGIN_ENV_PASSTHROUGH.

TYK_AI_LICENSE

ENV: TYK_AI_LICENSE
Type: string
The license key of an Enterprise Edge Gateway. An Enterprise Edge Gateway with a missing, expired, or invalid license stops before it opens its database. From v2.3.0, the Edge Gateway does not start with a license issued for v2.2 or earlier. A -migrate run also needs the license.

PLUGIN_ENV_PASSTHROUGH

ENV: PLUGIN_ENV_PASSTHROUGH
Type: string
A comma-separated list of host environment variables to pass to plugins. Plugins get only a built-in list of process, locale, TLS, proxy, and Go runtime variables, plus the variables in this list. An entry that ends in * matches a prefix. An entry that starts with * matches a suffix. Available from v2.3.0.

PLUGIN_GRPC_MAX_MSG_BYTES

ENV: PLUGIN_GRPC_MAX_MSG_BYTES
Type: integer
Default: 67108864
The largest message in bytes between the Edge Gateway and its plugins (64 MiB). A plugin that you build with an SDK earlier than v2.3.0 keeps a limit of 4 MiB. Available from v2.3.0.

DB_LOG_SQL_PARAMS

ENV: DB_LOG_SQL_PARAMS
Type: boolean
Default: false
Adds the values of SQL parameters to SQL log lines. The values can contain credentials, so use this setting for local debugging only. Available from v2.3.0.

NATIVE_API_*

ENV: NATIVE_API_*
Type: integer or duration
The limits and timings of native API operations, such as Anthropic Message Batches: NATIVE_API_MAX_BODY_BYTES, NATIVE_API_MAX_CONCURRENT_CREATES, NATIVE_API_MAX_FILTERED_ITEMS, NATIVE_API_MAX_GUARDRAIL_CALLS, NATIVE_API_MAX_IN_PROGRESS_PER_APP, NATIVE_API_RECONCILE_INTERVAL, NATIVE_API_RECONCILE_BATCH, NATIVE_API_RECONCILE_WORKERS, NATIVE_API_POLL_INTERVAL, and NATIVE_API_POLL_MAX_BACKOFF. The names, defaults, and meanings are the same as on AI Studio. For more information, see the AI Studio environment variables. Available from v2.3.0.

FILTER_*

ENV: FILTER_*
Type: duration, integer, or boolean
The filter script limits: FILTER_SCRIPT_TIMEOUT, FILTER_SCRIPT_MAX_ALLOCS, FILTER_SCRIPT_ALLOW_OS, FILTER_HTTP_TIMEOUT, FILTER_HTTP_MAX_RESPONSE_BYTES, and FILTER_LLM_TIMEOUT. The Edge Gateway reads them from its own environment. The names, defaults, and meanings are the same as on AI Studio. For more information, see the AI Studio environment variables. Enterprise Edition only.

GUARDRAIL_*

ENV: GUARDRAIL_*
Type: integer, duration, or string
The guardrail cache, scan, and shadow settings. The names, defaults, and meanings are the same as on AI Studio. For more information, see the AI Studio environment variables. Enterprise Edition only. Available from v2.3.0.

GODEBUG

ENV: GODEBUG
Type: string
Go runtime settings. A FIPS build of the Edge Gateway starts in FIPS 140-3 mode. GODEBUG=fips140=off turns off FIPS mode. GODEBUG=fips140=only refuses all algorithms that FIPS does not approve, for tests. Refer to FIPS 140-3 Compliance. Available from v2.3.0.

AGENT_TRACING_ENABLED

ENV: AGENT_TRACING_ENABLED
Type: boolean
Default: false
Turns on capture for Agent Call Tracing on the Edge Gateway. The Edge Gateway sends the captured events to AI Studio. AI Studio sets all other tracing settings. Refer to Agent Call Tracing. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_QUEUE_MAX_EVENTS

ENV: AGENT_TRACING_QUEUE_MAX_EVENTS
Type: integer
Default: 10000
The maximum number of events in the in-memory capture queue. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_QUEUE_MAX_BYTES

ENV: AGENT_TRACING_QUEUE_MAX_BYTES
Type: integer
Default: 67108864
The maximum size in bytes of the in-memory capture queue (64 MiB). Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_MAX_STREAM_BUFFER_BYTES

ENV: AGENT_TRACING_MAX_STREAM_BUFFER_BYTES
Type: integer
Default: 1048576
The maximum size in bytes of the buffer for one streamed response that tracing captures (1 MiB). Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_FLUSH_INTERVAL

ENV: AGENT_TRACING_FLUSH_INTERVAL
Type: duration
Default: 10s
How often the Edge Gateway sends captured events to AI Studio. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_FLUSH_MAX_EVENTS

ENV: AGENT_TRACING_FLUSH_MAX_EVENTS
Type: integer
Default: 500
The maximum number of events in one flush. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_CHUNK_MAX_BYTES

ENV: AGENT_TRACING_CHUNK_MAX_BYTES
Type: integer
Default: 4194304
The maximum size in bytes of the captured events in one pulse (4 MiB). A value above 8 MiB uses the default. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_KEEP_LIVE_SPAN

ENV: AGENT_TRACING_KEEP_LIVE_SPAN
Type: boolean
Default: false
Keeps the OpenTelemetry span of the Edge Gateway for captured calls while AI Studio exports the assembled spans. Use it when the OpenTelemetry collector of the Edge Gateway is not the export target of AI Studio. With a shared collector, each call appears two times. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_BAGGAGE_ALLOWLIST

ENV: AGENT_TRACING_BAGGAGE_ALLOWLIST
Type: string
Default: session.id
A comma-separated list of the W3C baggage keys that the Edge Gateway forwards to LLM and tool upstreams. The Edge Gateway removes all other keys. none forwards no baggage. This setting applies in all editions, also when tracing is off. Available from v2.3.0.

AGENT_TRACING_COMPAT_HEADERS

ENV: AGENT_TRACING_COMPAT_HEADERS
Type: string
Default: helicone,portkey,openrouter,bifrost,agent_router,cloudflare,agentcore,mcp_session
A comma-separated list of the header families of other gateways that tracing reads as declared context. none sets an empty list. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_HARNESS_SESSION_HEADERS

ENV: AGENT_TRACING_HARNESS_SESSION_HEADERS
Type: string
Default: claude_code,codex_cli,opencode
A comma-separated list of the coding tools whose session headers tracing reads. Other entries are header names that tracing reads as a session ID. none sets an empty list. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_PROPAGATE_LLM_PROVIDERS

ENV: AGENT_TRACING_PROPAGATE_LLM_PROVIDERS
Type: boolean
Default: true
Sends trace context to LLM providers. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_PROPAGATE_HTTP_UPSTREAMS

ENV: AGENT_TRACING_PROPAGATE_HTTP_UPSTREAMS
Type: boolean
Default: true
Sends trace context to HTTP upstreams, such as tools. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_PROPAGATE_MCP

ENV: AGENT_TRACING_PROPAGATE_MCP
Type: boolean
Default: true
Sends trace context to MCP servers. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_OPENAI_CLIENT_REQUEST_ID

ENV: AGENT_TRACING_OPENAI_CLIENT_REQUEST_ID
Type: boolean
Default: true
Sends the span ID to OpenAI upstreams in the X-Client-Request-Id header. Enterprise Edition only. Available from v2.3.0.