Skip to main content

Availability

This page details the environment variables that can be used to configure Tyk AI Studio.

Configuration

Tyk AI Studio 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 SERVER_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

Only the .env format (key=value pairs) is supported via the -env flag.

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

From v2.3.0, AI Studio does not read vendor keys and endpoints from environment variables such as OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY, HF_TOKEN, PINECONE_API_KEY, CHROMA_URL, and OLLAMA_HOST. Set the key and endpoint on each LLM, embedder, and data source.

SERVER_PORT

ENV: SERVER_PORT
Type: string
Default: 8080
The port for the AI Studio server to listen on.

ALLOW_REGISTRATIONS

ENV: ALLOW_REGISTRATIONS
Type: boolean
Default: true
Allow new users to register.

SITE_URL

ENV: SITE_URL
Type: string
The public URL of the AI Studio.

FROM_EMAIL

ENV: FROM_EMAIL
Type: string
The email address to send emails from.

DEVMODE

ENV: DEVMODE
Type: boolean
Default: false
Enable development mode.

BRANDING_STORAGE_PATH

ENV: BRANDING_STORAGE_PATH
Type: string
Default: ./data/branding
The directory where AI Studio stored uploaded logos and favicons before v2.3.0. From v2.3.0, AI Studio stores these files in the database. At start, AI Studio imports a logo or favicon from this directory one time, when the branding settings name a custom file and the database does not have it yet. After the import, AI Studio does not use the directory. AI Studio does not delete the files.

DEBUG_HTTP

ENV: DEBUG_HTTP
Type: boolean
Default: false
Enable HTTP debugging.

DEBUG_HTTP_PROXY

ENV: DEBUG_HTTP_PROXY
Type: boolean
Default: false
Enable HTTP proxy debugging.

DATABASE_URL

ENV: DATABASE_URL
Type: string
Default: midsommar.db
The database connection string.
  • PostgreSQL: the string can name more than one host. With target_session_attrs=read-write, AI Studio connects to the host that accepts writes and follows a failover without a restart.
  • SQLite: from v2.3.0, AI Studio 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.

DATABASE_TYPE

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

ECHO_CONVERSATION

ENV: ECHO_CONVERSATION
Type: boolean
Default: false
Echo conversation messages for debugging.

TYK_AI_SECRET_KEY

ENV: TYK_AI_SECRET_KEY
Type: string
The secret key that encrypts the secret store at rest. From v2.3.0, it also encrypts LLM credentials and App keys. SSO needs this key: without it, AI Studio refuses all SSO logins. Do not change the key after the first start: App keys stop working, and AI Studio cannot read encrypted values. AI Studio does not start when the value is still a __REPLACE_WITH_ placeholder from the quickstart files.

DOCS_PORT

ENV: DOCS_PORT
Type: integer
Default: 8989
The port of the bundled documentation server.

DOCS_URL_OVERRIDE

ENV: DOCS_URL_OVERRIDE
Type: string
The URL of the documentation link in the UI. When not set, the link is http://localhost:<DOCS_PORT>.

DOCS_DISABLED

ENV: DOCS_DISABLED
Type: boolean
Default: false
Turns off the bundled documentation server.

PROXY_URL

ENV: PROXY_URL
Type: string
The URL for the proxy.

TOOL_DISPLAY_URL

ENV: TOOL_DISPLAY_URL
Type: string
The display URL for tools in the UI.

DATASOURCE_DISPLAY_URL

ENV: DATASOURCE_DISPLAY_URL
Type: string
The display URL for datasources in the UI.

FILTER_SIGNUP_DOMAINS

ENV: FILTER_SIGNUP_DOMAINS
Type: string
A comma-separated list of domains to allow for signup.

DEFAULT_SIGNUP_MODE

ENV: DEFAULT_SIGNUP_MODE
Type: string
Default: both
The default signup mode.

DEFAULT_APP_QUOTA

ENV: DEFAULT_APP_QUOTA
Type: string
Default: 1
Enterprise Edition. The number of Apps that each user can create in the AI Portal or through a plugin, when no Team of the user sets a quota. Use a number, or * for no limit. 0 stops users from creating Apps. If the value is not valid, AI Studio logs a warning and uses 1. Refer to App Quota.

AI_STUDIO_OCI_CACHE_DIR

ENV: AI_STUDIO_OCI_CACHE_DIR
Type: string
The directory to cache OCI plugins.

AI_STUDIO_OCI_MAX_CACHE_SIZE

ENV: AI_STUDIO_OCI_MAX_CACHE_SIZE
Type: integer
Default: 1073741824
The maximum size of the OCI cache in bytes.

AI_STUDIO_OCI_REQUIRE_SIGNATURE

ENV: AI_STUDIO_OCI_REQUIRE_SIGNATURE
Type: boolean
Default: true
Requires a valid signature on OCI plugins. AI Studio 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. Community Edition cannot verify signatures: it logs a warning and loads OCI plugins as unverified. From v2.3.0, the default is true.

AI_STUDIO_OCI_ALLOWED_REGISTRIES

ENV: AI_STUDIO_OCI_ALLOWED_REGISTRIES
Type: string
A comma-separated list of allowed OCI registries.

AI_STUDIO_OCI_TIMEOUT

ENV: AI_STUDIO_OCI_TIMEOUT
Type: string
Default: 30s
The timeout for OCI operations.

AI_STUDIO_OCI_RETRY_ATTEMPTS

ENV: AI_STUDIO_OCI_RETRY_ATTEMPTS
Type: integer
Default: 3
The number of retry attempts for OCI operations.

AI_STUDIO_OCI_GC_INTERVAL

ENV: AI_STUDIO_OCI_GC_INTERVAL
Type: string
Default: 24h
The garbage collection interval for the OCI cache.

AI_STUDIO_OCI_KEEP_VERSIONS

ENV: AI_STUDIO_OCI_KEEP_VERSIONS
Type: integer
Default: 3
The number of plugin versions to keep in the OCI cache.

AI_STUDIO_OCI_INSECURE_REGISTRIES

ENV: AI_STUDIO_OCI_INSECURE_REGISTRIES
Type: string
A comma-separated list of insecure OCI registries.

OCI_PLUGINS_REGISTRY_*

ENV: OCI_PLUGINS_REGISTRY_*
Type: string
Authentication for private OCI registries. See the .env.example file for more details.

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=, AI Studio 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.

ALLOW_INTERNAL_NETWORK_ACCESS

ENV: ALLOW_INTERNAL_NETWORK_ACCESS
Type: boolean
Default: false
Turns off all internal address checks on the platform. Use it for development only. AI Studio logs a warning at startup. From v2.3.0, plugins do not get this variable unless you add it to PLUGIN_ENV_PASSTHROUGH.

QUEUE_TYPE

ENV: QUEUE_TYPE
Type: string
Default: inmemory
The message queue backend: inmemory, postgres, or nats. AI Studio uses inmemory and logs a warning for any other value. The in-memory queue works on one replica only. When you run more than one replica, set postgres or nats. For NATS, refer to NATS.

LOG_LEVEL

ENV: LOG_LEVEL
Type: string
Default: info
The log level (e.g., trace, debug, info, warn, error).

SESSION_DURATION

ENV: SESSION_DURATION
Type: string
Default: 6h
The duration of user sessions.

TYK_AI_LICENSE

ENV: TYK_AI_LICENSE
Type: string
The license key for Enterprise Edition. From v2.3.0, AI Studio does not start with a license issued for v2.2 or earlier. Community Edition needs no license. Set the same license on each AI Studio replica and on each Enterprise Edge Gateway.

LICENSE_TELEMETRY_URL

ENV: LICENSE_TELEMETRY_URL
Type: string
Default: https://telemetry.tyk.technology/api/track
The URL for license telemetry.

LICENSE_TELEMETRY_PERIOD

ENV: LICENSE_TELEMETRY_PERIOD
Type: string
Default: 1h
The period for sending license telemetry.

LICENSE_VALIDITY_CHECK_PERIOD

ENV: LICENSE_VALIDITY_CHECK_PERIOD
Type: string
Default: 24h
The period for checking license validity.

LICENSE_DISABLE_TELEMETRY

ENV: LICENSE_DISABLE_TELEMETRY
Type: boolean
Default: true
Turns off license telemetry. Set to false or 0 to send license usage reports to Tyk. Any other value keeps license telemetry off. From v2.3.0, the default is true. In the Helm chart, set config.licenseTelemetryEnabled: true. Refer to Telemetry. Enterprise Edition only.

TELEMETRY_ENABLED

ENV: TELEMETRY_ENABLED
Type: boolean
Default: false
Sends anonymized usage statistics to Tyk. Set to true or 1 to turn on usage telemetry. From v2.3.0, the default is false. In the Helm chart, set config.telemetryEnabled: true. Refer to Telemetry.

LICENSE_TELEMETRY_CONCURRENCY

ENV: LICENSE_TELEMETRY_CONCURRENCY
Type: integer
Default: 20
The maximum number of concurrent telemetry requests.

GATEWAY_MODE

ENV: GATEWAY_MODE
Type: string
Default: standalone
The gateway mode (standalone or control).

GRPC_PORT

ENV: GRPC_PORT
Type: integer
Default: 50051
The gRPC server port.

GRPC_HOST

ENV: GRPC_HOST
Type: string
Default: 0.0.0.0
The gRPC server host.

GRPC_TLS_INSECURE

ENV: GRPC_TLS_INSECURE
Type: boolean
Default: false
Set to true to disable TLS for the gRPC server.

GRPC_TLS_CERT_PATH

ENV: GRPC_TLS_CERT_PATH
Type: string
The path to the TLS certificate for the gRPC server.

GRPC_TLS_KEY_PATH

ENV: GRPC_TLS_KEY_PATH
Type: string
The path to the TLS key for the gRPC server.

GRPC_AUTH_TOKEN

ENV: GRPC_AUTH_TOKEN
Type: string
The authentication token for edge gateways to connect to the control plane.

GRPC_AUTH_TOKEN_NEXT

ENV: GRPC_AUTH_TOKEN_NEXT
Type: string
The next authentication token for zero-downtime rotation.

MICROGATEWAY_ENCRYPTION_KEY

ENV: MICROGATEWAY_ENCRYPTION_KEY
Type: string
The key that encrypts the credentials in the configuration that AI Studio sends to Edge Gateways. Set the same value in ENCRYPTION_KEY on each Edge Gateway. The key must have exactly 32 characters. When GATEWAY_MODE is control, AI Studio does not start if the key is not set, does not have 32 characters, or is the built-in insecure default. AI Studio also does not start when the value is still a __REPLACE_WITH_ placeholder from the quickstart files. From v2.3.0, AI Studio also uses this key for the hashes of App keys that it sends to Edge Gateways for full credential sync. Use the same value on all AI Studio replicas.

UNIFIED_ROUTER_PATH

ENV: UNIFIED_ROUTER_PATH
Type: string
Default: /v1
The base path of the Main Ingress (/v1/chat/completions, /v1/completions, and /v1/models) on AI Studio. Set the Edge Gateway variable GATEWAY_UNIFIED_ROUTER_PATH to the same value.

UNIFIED_ROUTER_DISABLED

ENV: UNIFIED_ROUTER_DISABLED
Type: boolean
Default: false
Turns off the Main Ingress on AI Studio. The per-LLM endpoints are not affected.

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, AI Studio 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.

METRICS_LEGACY_NAMES

ENV: METRICS_LEGACY_NAMES
Type: boolean
Default: true
Keeps the aistudio_* metric names together with the OpenTelemetry GenAI gen_ai.* names. Set to false to export only the new names.

ENABLE_TRACING

ENV: ENABLE_TRACING
Type: boolean
Default: false
Exports OpenTelemetry trace spans. Trace propagation (traceparent) works whatever this value is.

TRACING_ENDPOINT

ENV: TRACING_ENDPOINT
Type: string
The OTLP endpoint for trace spans, for example otel-collector.observability:4317. A bare host:port uses no TLS. Use an https:// URL for TLS.

GATEWAY_SERVER_TIMING

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

CORS_ALLOWED_ORIGINS

ENV: CORS_ALLOWED_ORIGINS
Type: string
Default: *
A comma-separated list of origins for CORS on the OAuth, metadata, and plugin UI endpoints. In production, replace * with the list of origins that you trust.

CSRF_TRUSTED_ORIGINS

ENV: CSRF_TRUSTED_ORIGINS
Type: string
Additional origins that CSRF protection trusts. Applies only when DEVMODE is true, for local tests over plain HTTP.

LLM_UPSTREAM_ALLOWED_HOSTS

ENV: LLM_UPSTREAM_ALLOWED_HOSTS
Type: string
A comma-separated allow list of LLM upstream hostnames. An entry that starts with . matches the domain and all its subdomains, for example .anthropic.com. When not set, all hosts are allowed. In production, set this list to the LLM hosts that you use.

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, the covered connections, and the ways to allow an internal host, refer to Outbound Network Policy. Set the same value on each Edge Gateway. A value that is not a boolean stops startup. From v2.3.0, the default is true.

LLM_UPSTREAM_ALLOWED_INTERNAL_HOSTS

ENV: LLM_UPSTREAM_ALLOWED_INTERNAL_HOSTS
Type: string
A comma-separated list of internal hostnames that are allowed when LLM_UPSTREAM_BLOCK_INTERNAL is true, for example a model server in the cluster. An entry that starts with . matches the domain and all its subdomains, for example .svc.cluster.local. 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 the host (Application Default Credentials). AI Studio looks for GOOGLE_APPLICATION_CREDENTIALS, then the gcloud credentials, then the GCP metadata server, for example GKE Workload Identity or Cloud Run. The credential of an LLM always has priority. A Workload Identity Federation credential (external_account) also needs this setting. Set the same value on each Edge Gateway that serves the LLM. Available from v2.3.0.

AI_STUDIO_PLUGIN_ALLOWED_DIRS

ENV: AI_STUDIO_PLUGIN_ALLOWED_DIRS
Type: string
A list of directories that plugin binaries can run from, separated by : on Linux. AI Studio adds them to a built-in list. Refer to Restrict Plugin Sources.

AI_STUDIO_OCI_MAX_PLUGIN_SIZE

ENV: AI_STUDIO_OCI_MAX_PLUGIN_SIZE
Type: string
Default: 512MB
The maximum size of one plugin layer that AI Studio downloads from an OCI registry.

ALLOW_SSO_USER_API_KEYS

ENV: ALLOW_SSO_USER_API_KEYS
Type: boolean
Default: false
Lets users with the users:write permission issue personal API keys to users that come from SSO.

SSO_API_KEY_LIVENESS

ENV: SSO_API_KEY_LIVENESS
Type: duration
Default: 720h
The API key of an SSO user works only for this period after the user’s last SSO login. Set to 0 to turn off the check.

CHAT_UI_V2_ENABLED

ENV: CHAT_UI_V2_ENABLED
Type: boolean
Default: true
Selects the current chat interface. Set to false to use the previous chat interface.

CHAT_SESSION_IDLE_TTL

ENV: CHAT_SESSION_IDLE_TTL
Type: duration
Default: 10m
How long an idle chat or agent session stays in memory between turns. Keep it short when you use NATS queues, because each session holds a connection.

FILTER_SCRIPT_TIMEOUT

ENV: FILTER_SCRIPT_TIMEOUT
Type: duration
Default: 5s
The maximum time for one filter script run. When a script times out, request filters block the request and response filters let it continue. 0 turns off the limit. A number without a unit is in seconds. Enterprise Edition only.

FILTER_SCRIPT_MAX_ALLOCS

ENV: FILTER_SCRIPT_MAX_ALLOCS
Type: integer
Default: 10000000
The maximum number of objects that one filter script run can allocate. 0 turns off the limit. Enterprise Edition only.

FILTER_SCRIPT_ALLOW_OS

ENV: FILTER_SCRIPT_ALLOW_OS
Type: boolean
Default: false
Gives filter scripts access to the Tengo os module (environment variables, file system, and processes). Set to true only for old scripts that need it, because the process environment holds the secrets key. From v2.3.0, AI Studio logs a warning at startup when this setting is on. Enterprise Edition only.

FILTER_HTTP_TIMEOUT

ENV: FILTER_HTTP_TIMEOUT
Type: duration
Default: 10s
The maximum time for one tyk.makeHTTPRequest call from a filter script. Enterprise Edition only.

FILTER_HTTP_MAX_RESPONSE_BYTES

ENV: FILTER_HTTP_MAX_RESPONSE_BYTES
Type: integer
Default: 1048576
The largest response body that tyk.makeHTTPRequest returns. A larger body is an error. Enterprise Edition only.

FILTER_LLM_TIMEOUT

ENV: FILTER_LLM_TIMEOUT
Type: duration
Default: 30s
The maximum time for one tyk.llm call from a filter script. Enterprise Edition only.

SKIP_FILTER_DEFAULTS

ENV: SKIP_FILTER_DEFAULTS
Type: boolean
Default: false
Does not create the four default guardrails on a new database. Enterprise Edition only.

AUDIT_ENABLED

ENV: AUDIT_ENABLED
Type: boolean
Default: true
Records management API actions in the audit trail. Enterprise Edition only.

AUDIT_STORE_TYPE

ENV: AUDIT_STORE_TYPE
Type: string
Default: db
Where AI Studio writes audit records: db, file, or both. Enterprise Edition only.

AUDIT_FILE_PATH

ENV: AUDIT_FILE_PATH
Type: string
Default: ./data/audit/audit.log
The audit file when AUDIT_STORE_TYPE is file or both. Enterprise Edition only.

AUDIT_FILE_FORMAT

ENV: AUDIT_FILE_FORMAT
Type: string
Default: json
The format of the audit file. Enterprise Edition only.

AUDIT_DETAILED_RECORDING

ENV: AUDIT_DETAILED_RECORDING
Type: boolean
Default: false
Also stores the request and response bodies of each audited action. The bodies can contain personal or confidential data. AI Studio redacts known secrets. Use AUDIT_REDACT_KEYS and AUDIT_REDACT_HEADERS to redact more fields. Enterprise Edition only.

AUDIT_RECORD_READS

ENV: AUDIT_RECORD_READS
Type: boolean
Default: false
Also records GET requests. Enterprise Edition only.

AUDIT_RETENTION_DAYS

ENV: AUDIT_RETENTION_DAYS
Type: integer
Default: 90
The number of days that AI Studio keeps audit records. 0 keeps them forever. Enterprise Edition only.

AUDIT_MAX_BODY_BYTES

ENV: AUDIT_MAX_BODY_BYTES
Type: integer
Default: 65536
The maximum size of each stored request or response body. Enterprise Edition only.

AUDIT_QUEUE_SIZE

ENV: AUDIT_QUEUE_SIZE
Type: integer
Default: 4096
The size of the in-memory queue before the audit writer. Enterprise Edition only.

AUDIT_REDACT_KEYS

ENV: AUDIT_REDACT_KEYS
Type: string
A comma-separated list of extra keys to redact from audit records, in addition to the built-in list. Enterprise Edition only.

AUDIT_REDACT_HEADERS

ENV: AUDIT_REDACT_HEADERS
Type: string
A comma-separated list of extra headers to redact from audit records, in addition to the built-in list. Enterprise Edition only.

WEBHOOKS_ENABLED

ENV: WEBHOOKS_ENABLED
Type: boolean
Default: true
Turns on outbound webhooks. Webhooks need TYK_AI_SECRET_KEY. Enterprise Edition only.

WEBHOOKS_WORKER_ENABLED

ENV: WEBHOOKS_WORKER_ENABLED
Type: boolean
Default: true
Set to false to manage webhook targets on this node without sending deliveries. Enterprise Edition only.

WEBHOOKS_WORKER_COUNT

ENV: WEBHOOKS_WORKER_COUNT
Type: integer
Default: 4
The number of delivery workers on each node, from 1 to 64. Enterprise Edition only.

WEBHOOKS_MAX_ATTEMPTS

ENV: WEBHOOKS_MAX_ATTEMPTS
Type: integer
Default: 10
The number of attempts before a delivery goes to the dead-letter queue, from 1 to 50. Enterprise Edition only.

WEBHOOKS_BASE_BACKOFF

ENV: WEBHOOKS_BASE_BACKOFF
Type: duration
Default: 5s
The first retry delay. Later delays increase exponentially, with jitter, and respect Retry-After. Enterprise Edition only.

WEBHOOKS_MAX_BACKOFF

ENV: WEBHOOKS_MAX_BACKOFF
Type: duration
Default: 1h
The maximum retry delay. Enterprise Edition only.

WEBHOOKS_REQUEST_TIMEOUT

ENV: WEBHOOKS_REQUEST_TIMEOUT
Type: duration
Default: 10s
The HTTP timeout for each delivery attempt. The maximum is 60s. Enterprise Edition only.

WEBHOOKS_ALLOW_INTERNAL_TARGETS

ENV: WEBHOOKS_ALLOW_INTERNAL_TARGETS
Type: boolean
Default: false
Allows webhook targets on loopback and private IP ranges, for example local receivers. Enterprise Edition only.

WEBHOOKS_ALLOWED_HOSTS

ENV: WEBHOOKS_ALLOWED_HOSTS
Type: string
A comma-separated allow list of webhook target hosts. An entry that starts with . matches the domain and all its subdomains. When not set, any public host is allowed. AI Studio refuses internal targets (loopback, private ranges, link-local, and cloud metadata addresses) unless WEBHOOKS_ALLOW_INTERNAL_TARGETS is true. An exact host in this list can be an internal address. An entry that starts with . does not allow internal addresses. Enterprise Edition only.

WEBHOOKS_DENIED_HOSTS

ENV: WEBHOOKS_DENIED_HOSTS
Type: string
A comma-separated list of webhook target hosts that AI Studio always refuses. Enterprise Edition only.

WEBHOOKS_RETENTION_DAYS

ENV: WEBHOOKS_RETENTION_DAYS
Type: integer
Default: 14
The number of days that AI Studio keeps succeeded and cancelled deliveries. 0 keeps them forever. Enterprise Edition only.

WEBHOOKS_DEAD_LETTER_RETENTION_DAYS

ENV: WEBHOOKS_DEAD_LETTER_RETENTION_DAYS
Type: integer
Default: 30
The number of days that AI Studio keeps dead-lettered deliveries. Enterprise Edition only.

WEBHOOKS_MAX_RESPONSE_SNIPPET_BYTES

ENV: WEBHOOKS_MAX_RESPONSE_SNIPPET_BYTES
Type: integer
Default: 4096
The size of the response body that the delivery log keeps for each attempt. Enterprise Edition only.

WEBHOOKS_REQUIRE_DIFFERENT_APPROVER

ENV: WEBHOOKS_REQUIRE_DIFFERENT_APPROVER
Type: boolean
Default: false
When true, the user who creates a webhook target cannot approve it. Enterprise Edition only.

WEBHOOKS_SECRET_ROTATION_GRACE

ENV: WEBHOOKS_SECRET_ROTATION_GRACE
Type: duration
Default: 24h
After you rotate a signing secret, AI Studio sends both signatures for this period. Enterprise Edition only.

WEBHOOKS_REDACT_KEYS

ENV: WEBHOOKS_REDACT_KEYS
Type: string
A comma-separated list of extra key fragments to redact from webhook payloads. Enterprise Edition only.

WEBHOOKS_AUDIT_DELIVERIES

ENV: WEBHOOKS_AUDIT_DELIVERIES
Type: boolean
Default: false
Also records successful deliveries in the audit trail. Dead-lettered deliveries are always recorded. Enterprise Edition only.

WEBHOOKS_SHUTDOWN_DRAIN_TIMEOUT

ENV: WEBHOOKS_SHUTDOWN_DRAIN_TIMEOUT
Type: duration
Default: 15s
The time that in-flight deliveries get to finish when AI Studio stops. Enterprise Edition only.

TYK_MCP_ENABLED

ENV: TYK_MCP_ENABLED
Type: boolean
Default: true
Turns on the Tyk Dashboard MCP integration. You can use it only to turn the integration off. Enterprise Edition only.

TYK_MCP_SYNC_MIN_INTERVAL

ENV: TYK_MCP_SYNC_MIN_INTERVAL
Type: duration
Default: 60s
The minimum sync interval for each Tyk Dashboard connection. The lowest value is 10s. Enterprise Edition only.

TYK_MCP_REQUEST_TIMEOUT

ENV: TYK_MCP_REQUEST_TIMEOUT
Type: duration
Default: 10s
The timeout for reads from a Tyk Dashboard. Writes get three times this value. The maximum is 60s. Enterprise Edition only.

TYK_MCP_RATE_LIMIT_PER_SECOND

ENV: TYK_MCP_RATE_LIMIT_PER_SECOND
Type: integer
Default: 10
The maximum number of outbound requests per second for each connection. Enterprise Edition only.

TYK_MCP_ALLOWED_HOSTS

ENV: TYK_MCP_ALLOWED_HOSTS
Type: string
A comma-separated list of Tyk Dashboard and MDCB hosts that connections can use (exact names, or .suffix). The list also applies to the upstream MCP hosts that the registration wizard calls for tool discovery. When not set, any public host is allowed. Enterprise Edition only.

TYK_MCP_DENIED_HOSTS

ENV: TYK_MCP_DENIED_HOSTS
Type: string
A comma-separated list of hosts that connections can never use. Enterprise Edition only.

TYK_MCP_REQUIRE_DIFFERENT_ACTIVATOR

ENV: TYK_MCP_REQUIRE_DIFFERENT_ACTIVATOR
Type: boolean
Default: false
When true, the user who creates a connection cannot activate it. Enterprise Edition only.

TYK_MCP_SYNC_RUN_RETENTION

ENV: TYK_MCP_SYNC_RUN_RETENTION
Type: duration
Default: 720h
How long AI Studio keeps sync run records. Enterprise Edition only.

BASE_PATH

ENV: BASE_PATH
Type: string
Serves the API, OAuth, and the console under this path prefix. SITE_URL keeps its path.

DATABASE_SCHEMA

ENV: DATABASE_SCHEMA
Type: string
PostgreSQL only. Keeps all AI Studio tables in this schema. Use 41 characters or fewer.

MIGRATION_LOCK_TIMEOUT

ENV: MIGRATION_LOCK_TIMEOUT
Type: duration
Default: 15m
How long an instance that starts waits for the database migrations of another instance.

CSRF_KEY

ENV: CSRF_KEY
Type: string
The secret for the CSRF key. When not set, AI Studio creates a random secret for each process. Set it so that CSRF tokens stay valid after a restart. ENV: CSRF_COOKIE_NAME
Type: string
Default: _gorilla_csrf
The name of the CSRF cookie.

GRPC_MAX_MESSAGE_SIZE

ENV: GRPC_MAX_MESSAGE_SIZE
Type: string
Default: 16MB
The send and receive limit for messages between AI Studio and Edge Gateways.

GRPC_MAX_CONNECTION_AGE

ENV: GRPC_MAX_CONNECTION_AGE
Type: duration
Default: 0
Closes Edge Gateway streams after this age, so that they rebalance behind a load balancer. 0 turns this off. Needs a non-zero GRPC_MAX_CONNECTION_AGE_GRACE. Each cycle disconnects an Edge Gateway for about 5 seconds, so use minutes or hours.

GRPC_MAX_CONNECTION_AGE_GRACE

ENV: GRPC_MAX_CONNECTION_AGE_GRACE
Type: duration
Default: 0
The time that open streams get to finish after GRPC_MAX_CONNECTION_AGE. 0 means no limit: the server waits for open streams forever, and because an Edge Gateway stream stays open, it never closes. Set a non-zero value when you set GRPC_MAX_CONNECTION_AGE.

METRICS_ENABLED

ENV: METRICS_ENABLED
Type: boolean
Default: true
Enables the Prometheus metrics endpoint. Set to false or 0 to turn it off. AI Studio 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 of the metrics endpoint.

AI_STUDIO_ENV_REF_ALLOWLIST

ENV: AI_STUDIO_ENV_REF_ALLOWLIST
Type: string
A comma-separated list of environment variable names that a $ENV/NAME reference can resolve. Names must match exactly. When not set, no $ENV/ reference resolves. The setting applies to LLMs, tools, data sources, embedders, and guardrails. Plugin configuration resolves only $SECRET/ references. Available from v2.3.0.

AI_STUDIO_OCI_TLOG_POLICY

ENV: AI_STUDIO_OCI_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, for example for plugins that you sign without a transparency log in an air-gapped network. An invalid value stops startup. Enterprise Edition only. Available from v2.3.0.

AI_STUDIO_OCI_TRUSTED_ROOT_FILE

ENV: AI_STUDIO_OCI_TRUSTED_ROOT_FILE
Type: string
The path to a Sigstore trusted_root.json file for a private Sigstore deployment. When not set, AI Studio uses its built-in Sigstore trusted root. An invalid file stops startup. Enterprise Edition only. Available from v2.3.0.

AI_STUDIO_PLUGIN_ALLOWED_SOURCES

ENV: AI_STUDIO_PLUGIN_ALLOWED_SOURCES
Type: string
A comma-separated list of the plugin deployment types that AI Studio accepts: oci, file, and grpc. When not set, AI Studio accepts all types. An unknown type stops startup. Each Edge Gateway applies its own PLUGINS_ALLOWED_SOURCES. For more information, see Plugin security. Available from v2.3.0.

PLUGIN_COMMAND_ALLOWLIST

ENV: PLUGIN_COMMAND_ALLOWLIST
Type: string
A comma-separated list of substrings for plugin commands. The list is advisory. AI Studio 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, AI Studio refuses a plugin command that contains an internal address anywhere, for example in a host:port argument. When false, AI Studio logs a warning for such a command. From v2.3.0, AI Studio refuses internal plugin hosts without this setting. Refer to Internal Registries and Hosts.

PLUGIN_ENV_PASSTHROUGH

ENV: PLUGIN_ENV_PASSTHROUGH
Type: string
A comma-separated list of host environment variables to pass to plugins. Plugins do not get the host environment. They 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, for example GITHUB_RAG_*. An entry that starts with * matches a suffix. AI Studio ignores an entry of * alone, and logs a warning when the list passes a host secret. 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 AI Studio 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. AI Studio logs a warning at startup when the setting is on. Available from v2.3.0.

CLUSTER_NODE_LABEL

ENV: CLUSTER_NODE_LABEL
Type: string
A name for this replica, for example its region. The cluster status and the Held by column of the Edge Gateways list show the name. When not set, the replica has no label. Use at most 64 characters: letters, digits, spaces, and . _ - : / ( ). An invalid value stops startup. For more information, see Active-active deployment. Available from v2.3.0.

DATABASE_MAX_OPEN_CONNS

ENV: DATABASE_MAX_OPEN_CONNS
Type: integer
Default: 0
PostgreSQL only. The maximum number of connections that one replica opens. 0 sets no limit. Keep the total for all replicas below the max_connections value of the server. Available from v2.3.0.

DATABASE_MAX_IDLE_CONNS

ENV: DATABASE_MAX_IDLE_CONNS
Type: integer
Default: 2
PostgreSQL only. The number of idle connections that AI Studio keeps open. Available from v2.3.0.

DATABASE_CONN_MAX_LIFETIME

ENV: DATABASE_CONN_MAX_LIFETIME
Type: duration
Default: 30m
PostgreSQL only. AI Studio closes and replaces connections that are older than this value. After a planned switchover, the connections then move to the new primary. 0 keeps connections open. Available from v2.3.0.

DATABASE_CONNECT_TIMEOUT

ENV: DATABASE_CONNECT_TIMEOUT
Type: duration
Default: 10s
PostgreSQL only. The time for one connection attempt. A connect_timeout value in DATABASE_URL has priority. When DATABASE_URL names more than one host, a host that does not answer delays the next host by this time. Available from v2.3.0.

DATABASE_STARTUP_TIMEOUT

ENV: DATABASE_STARTUP_TIMEOUT
Type: duration
Default: 60s
PostgreSQL only. At startup, AI Studio waits this long for a database that accepts writes. After this time, AI Studio stops. 0 makes one attempt. Available from v2.3.0.

DATABASE_READY_GRACE

ENV: DATABASE_READY_GRACE
Type: duration
Default: 30s
PostgreSQL only. The time that the database can be unavailable before /ready returns 503. Keep this value longer than DATABASE_WRITE_RETRY_WINDOW. 0 makes /ready fail at the first failed database ping, as in v2.2. Available from v2.3.0.

DATABASE_WRITE_RETRY_WINDOW

ENV: DATABASE_WRITE_RETRY_WINDOW
Type: duration
Default: 15s
PostgreSQL only. During a failover, a request waits this long for a database server that accepts writes. After this time, AI Studio returns 503 with the error code database_unavailable. 0 turns off the wait. Available from v2.3.0.

PROMPT_TEMPLATE_MIN_ANCHORED_CONST_BYTES

ENV: PROMPT_TEMPLATE_MIN_ANCHORED_CONST_BYTES
Type: integer
Default: 16
The minimum length in bytes of the constant text at an anchored start or end of a trusted prompt template. Use a value from 8 to 32. All other constant parts need 32 bytes. Edge Gateways accept the templates that AI Studio approves, so set this variable on AI Studio only. Available from v2.3.0.

NATIVE_API_MAX_BODY_BYTES

ENV: NATIVE_API_MAX_BODY_BYTES
Type: integer
Default: 67108864
The size limit in bytes of a batch create request or a batch file upload on native API operations, such as Anthropic Message Batches. The maximum value is 256 MiB. 0 keeps the default. Available from v2.3.0.

NATIVE_API_MAX_CONCURRENT_CREATES

ENV: NATIVE_API_MAX_CONCURRENT_CREATES
Type: integer
Default: 4
The number of batch create requests that the gateway handles at the same time. Other requests wait. 0 keeps the default. Available from v2.3.0.

NATIVE_API_MAX_FILTERED_ITEMS

ENV: NATIVE_API_MAX_FILTERED_ITEMS
Type: integer
Default: 10000
The maximum number of requests in one batch when the LLM has request filters. 0 keeps the default. Available from v2.3.0.

NATIVE_API_MAX_GUARDRAIL_CALLS

ENV: NATIVE_API_MAX_GUARDRAIL_CALLS
Type: integer
Default: 10000
The maximum number of remote guardrail provider calls for one batch create or upload. The gateway refuses a batch that needs more calls with HTTP 400. 0 keeps the default. Enterprise Edition only. Available from v2.3.0.

NATIVE_API_MAX_IN_PROGRESS_PER_APP

ENV: NATIVE_API_MAX_IN_PROGRESS_PER_APP
Type: integer
Default: 0
The maximum number of batches in progress for each App and LLM. 0 sets no limit. Available from v2.3.0.

NATIVE_API_RECONCILE_INTERVAL

ENV: NATIVE_API_RECONCILE_INTERVAL
Type: duration
Default: 30s
How often the gateway looks for finished batches that nobody downloaded, to record their usage. 0 keeps the default. Available from v2.3.0.

NATIVE_API_RECONCILE_BATCH

ENV: NATIVE_API_RECONCILE_BATCH
Type: integer
Default: 50
The number of batches that one reconcile pass checks. 0 keeps the default. Available from v2.3.0.

NATIVE_API_RECONCILE_WORKERS

ENV: NATIVE_API_RECONCILE_WORKERS
Type: integer
Default: 4
The number of batches that the gateway reconciles at the same time. 0 keeps the default. Available from v2.3.0.

NATIVE_API_POLL_INTERVAL

ENV: NATIVE_API_POLL_INTERVAL
Type: duration
Default: 2m
The wait before the gateway polls an unfinished batch again. 0 keeps the default. Available from v2.3.0.

NATIVE_API_POLL_MAX_BACKOFF

ENV: NATIVE_API_POLL_MAX_BACKOFF
Type: duration
Default: 30m
The longest wait after failed polls. The wait doubles after each failure. 0 keeps the default. Available from v2.3.0.

GUARDRAIL_VERDICT_CACHE_ENTRIES

ENV: GUARDRAIL_VERDICT_CACHE_ENTRIES
Type: integer
Default: 100000
The number of guardrail verdicts that each node keeps in its cache. Enterprise Edition only. Available from v2.3.0.

GUARDRAIL_VERDICT_CACHE_MAX_BYTES

ENV: GUARDRAIL_VERDICT_CACHE_MAX_BYTES
Type: integer
Default: 67108864
The memory in bytes that the verdict cache of each node can use (64 MiB). Enterprise Edition only. Available from v2.3.0.

GUARDRAIL_VERDICT_CACHE_TTL

ENV: GUARDRAIL_VERDICT_CACHE_TTL
Type: duration
Default: 10m
How long a guardrail reuses a cached verdict. 0 turns off the cache. Enterprise Edition only. Available from v2.3.0.

GUARDRAIL_LOCAL_SCAN_SLOTS

ENV: GUARDRAIL_LOCAL_SCAN_SLOTS
Type: integer
The number of large scans that the built-in guardrail library runs at the same time. When not set, the value is half the number of CPUs, with a minimum of 1. Enterprise Edition only. Available from v2.3.0.

GUARDRAIL_LOCAL_SCAN_SMALL_SLOTS

ENV: GUARDRAIL_LOCAL_SCAN_SMALL_SLOTS
Type: integer
The number of small scans that run at the same time, in addition to the large scans. When not set, the value is a quarter of the number of CPUs, with a minimum of 1. Enterprise Edition only. Available from v2.3.0.

GUARDRAIL_LOCAL_SCAN_QUEUE_BYTES

ENV: GUARDRAIL_LOCAL_SCAN_QUEUE_BYTES
Type: integer
Default: 67108864
The amount of text in bytes that one tenant can have in the queue for a built-in scan (64 MiB). Enterprise Edition only. Available from v2.3.0.

GUARDRAIL_LOCAL_MAX_SCAN_BYTES

ENV: GUARDRAIL_LOCAL_MAX_SCAN_BYTES
Type: integer
Default: 8388608
The largest text segment in bytes that the built-in guardrail library scans (8 MiB). The library does not scan a larger segment and records it as unscanned. Enterprise Edition only. Available from v2.3.0.

GUARDRAIL_LOCAL_SCAN_MS_PER_MIB

ENV: GUARDRAIL_LOCAL_SCAN_MS_PER_MIB
Type: integer
Default: 2000
The extra scan time in milliseconds for each MiB of text, in addition to the timeout of the filter. Enterprise Edition only. Available from v2.3.0.

GUARDRAIL_SHADOW_WORKERS

ENV: GUARDRAIL_SHADOW_WORKERS
Type: integer
The number of shadow guardrail evaluations that run at the same time. When not set, the value is 4 for each CPU, with a minimum of 8. Enterprise Edition only. Available from v2.3.0.

GUARDRAIL_SHADOW_QUEUE_BYTES

ENV: GUARDRAIL_SHADOW_QUEUE_BYTES
Type: integer
Default: 67108864
The amount of text in bytes that can wait for a shadow evaluation (64 MiB). AI Studio drops text above this limit and records it as unscanned. Enterprise Edition only. Available from v2.3.0.

GUARDRAIL_UNIX_SOCKET_ALLOWLIST

ENV: GUARDRAIL_UNIX_SOCKET_ALLOWLIST
Type: string
A comma-separated list of Unix socket paths that an HTTP guardrail classifier can use, for example unix:///run/guard/guard.sock. An entry that ends in / allows all sockets in that directory. When not set, AI Studio refuses all socket endpoints. Enterprise Edition only. Available from v2.3.0.

GODEBUG

ENV: GODEBUG
Type: string
Go runtime settings. A FIPS build of AI Studio 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 Agent Call Tracing. Community Edition ignores this setting and logs a warning. An invalid value of an AGENT_TRACING_* variable keeps the default and logs a warning. An invalid content capture mode is off, not the default. Refer to Agent Call Tracing. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_KEY

ENV: AGENT_TRACING_KEY
Type: string
The root key for trace fingerprints and for the encryption of captured content. Use 16 bytes or more. When not set, AI Studio uses TYK_AI_SECRET_KEY. Tracing does not start without one of the two keys. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_KEY_PREVIOUS

ENV: AGENT_TRACING_KEY_PREVIOUS
Type: string
The previous root key during a key rotation. AI Studio can still read content that it encrypted with this key. Keep it until the payload retention period ends. 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_CONTENT_CEILING

ENV: AGENT_TRACING_CONTENT_CEILING
Type: string
The highest content capture mode that an App, the default mode, or a request header can use. The modes, from least to most content, are off, metadata, hashed, redacted, and full. When not set, the ceiling is the higher of AGENT_TRACING_CONTENT_DEFAULT_MODE and AGENT_TRACING_CONTENT_MAX_REQUEST_OVERRIDE. With the defaults, this is metadata, so an App set to redacted or full captures metadata only. You can set this value only in the environment. An invalid mode is off. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_CONTENT_DEFAULT_MODE

ENV: AGENT_TRACING_CONTENT_DEFAULT_MODE
Type: string
Default: off
The content capture mode for Apps that do not set their own mode. The value cannot be higher than the ceiling. You can set this value only in the environment. An invalid mode is off. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_CONTENT_MAX_REQUEST_OVERRIDE

ENV: AGENT_TRACING_CONTENT_MAX_REQUEST_OVERRIDE
Type: string
Default: metadata
The highest content capture mode that the X-Tyk-Trace-Capture request header can ask for. An invalid mode is off. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_STORE_CONTENT_MODE_CAP

ENV: AGENT_TRACING_STORE_CONTENT_MODE_CAP
Type: string
Default: full
The highest content capture mode that AI Studio stores, whatever the App allows. An invalid mode is off. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_REDACTION_DETECTORS

ENV: AGENT_TRACING_REDACTION_DETECTORS
Type: string
Default: email,phone,payment_card,iban,us_ssn,jwt,bearer_token,api_key,private_key
A comma-separated list of the personal data and secret detectors that the redacted mode uses. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_PAYLOAD_MAX_PART_BYTES

ENV: AGENT_TRACING_PAYLOAD_MAX_PART_BYTES
Type: integer
Default: 262144
The maximum size in bytes of one captured content part (256 KiB). The minimum value is 512. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_PAYLOAD_MAX_SPAN_BYTES

ENV: AGENT_TRACING_PAYLOAD_MAX_SPAN_BYTES
Type: integer
Default: 1048576
The maximum size in bytes of the captured content of one span (1 MiB). Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_PAYLOAD_STORE_BINARY

ENV: AGENT_TRACING_PAYLOAD_STORE_BINARY
Type: boolean
Default: false
Stores binary content. When false, AI Studio stores a reference to the binary content. Enterprise Edition only. Available from v2.3.0. ENV: AGENT_TRACING_MIN_LINK_CONFIDENCE
Type: string
Default: weak
The weakest link confidence that AI Studio uses to connect a span to a parent span: declared, exact, strong, or weak. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_TOOL_MATCH_WINDOW

ENV: AGENT_TRACING_TOOL_MATCH_WINDOW
Type: duration
Default: 300s
The time after a model asks for a tool in which a tool execution can match that request. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_CLOCK_SKEW_TOLERANCE

ENV: AGENT_TRACING_CLOCK_SKEW_TOLERANCE
Type: duration
Default: 2s
The clock difference between gateways that correlation allows. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_TURN_IDLE_TIMEOUT

ENV: AGENT_TRACING_TURN_IDLE_TIMEOUT
Type: duration
Default: 5m
A turn closes after this time without activity. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_SESSION_IDLE_TIMEOUT

ENV: AGENT_TRACING_SESSION_IDLE_TIMEOUT
Type: duration
Default: 30m
A session closes after this time without activity. An App can override this value. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_SESSION_MAX_DURATION

ENV: AGENT_TRACING_SESSION_MAX_DURATION
Type: duration
Default: 4h
An inferred session that is older than this value continues in a new session at its next turn. Declared sessions do not split. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_SESSION_MAX_SPANS

ENV: AGENT_TRACING_SESSION_MAX_SPANS
Type: integer
Default: 5000
An inferred session with this number of spans continues in a new session at its next turn. Declared sessions do not split. Enterprise Edition only. 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_TOOL_NAME_PREFIX_STRIP

ENV: AGENT_TRACING_TOOL_NAME_PREFIX_STRIP
Type: string
Default: mcp__{server}__,{server}__,{server}.
A comma-separated list of tool name prefixes that tracing ignores when it matches tool calls. 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. Each LLM can turn this off. 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.

AGENT_TRACING_FORWARD_TYK_HEADERS

ENV: AGENT_TRACING_FORWARD_TYK_HEADERS
Type: boolean
Default: false
Forwards the X-Tyk-* tracing headers to upstreams. 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 gateway forwards to LLM and tool upstreams. The 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_METADATA_RETENTION_DAYS

ENV: AGENT_TRACING_METADATA_RETENTION_DAYS
Type: integer
Default: 30
The number of days that AI Studio keeps sessions, turns, and spans. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_PAYLOAD_RETENTION_DAYS

ENV: AGENT_TRACING_PAYLOAD_RETENTION_DAYS
Type: integer
Default: 7
The number of days that AI Studio keeps captured content. The value cannot be higher than AGENT_TRACING_METADATA_RETENTION_DAYS. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_CORRELATION_KEY_TTL

ENV: AGENT_TRACING_CORRELATION_KEY_TTL
Type: duration
Default: 24h
The lifetime of the entries in the correlation index. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_STORE_SAMPLE_RATE

ENV: AGENT_TRACING_STORE_SAMPLE_RATE
Type: number
Default: 1.0
The fraction of sessions that AI Studio stores, from 0 to 1. AI Studio decides for each session. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_EXPORTERS_FILE

ENV: AGENT_TRACING_EXPORTERS_FILE
Type: string
The path to a YAML file with an exporters: list of OpenTelemetry exporters. When not set, AI Studio does not export traces. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_EXPORT_SEMCONV_PROFILE

ENV: AGENT_TRACING_EXPORT_SEMCONV_PROFILE
Type: string
Default: genai-1.41
The attribute mapping profile for exported spans, or the path to a mapping YAML file. An unknown profile name uses the default and logs a warning. A file that AI Studio cannot read turns off the export. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_EXPORT_AGENT_SPAN_MODE

ENV: AGENT_TRACING_EXPORT_AGENT_SPAN_MODE
Type: string
Default: tyk
The name format of exported agent spans: tyk or semconv. With semconv, declared agents get the name invoke_agent {name}. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_EXPORT_GATEWAY_EVENTS

ENV: AGENT_TRACING_EXPORT_GATEWAY_EVENTS
Type: string
Default: events
How AI Studio exports gateway decisions: events (span events) or spans (child spans). Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_EXPORT_CONTENT

ENV: AGENT_TRACING_EXPORT_CONTENT
Type: string
Default: none
The content that AI Studio exports with spans. The values reference and inline are not available yet. They log a warning and export metadata only. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_EXPORT_MAX_ATTRIBUTE_BYTES

ENV: AGENT_TRACING_EXPORT_MAX_ATTRIBUTE_BYTES
Type: integer
Default: 16384
The maximum length in bytes of an exported attribute value. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_EXPORT_MAX_DELAY

ENV: AGENT_TRACING_EXPORT_MAX_DELAY
Type: duration
Default: 30s
The longest time that a finished turn waits before export. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_EXPORT_INFERRED_SESSION_AS_SESSION_ID

ENV: AGENT_TRACING_EXPORT_INFERRED_SESSION_AS_SESSION_ID
Type: boolean
Default: true
Exports the IDs of inferred sessions in the session.id attribute. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_EXPORT_CONVERSATION_ID_FALLBACK

ENV: AGENT_TRACING_EXPORT_CONVERSATION_ID_FALLBACK
Type: string
Default: never
Set to inferred to also fill gen_ai.conversation.id from inferred sessions. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_EXPORT_USER_ID_MODE

ENV: AGENT_TRACING_EXPORT_USER_ID_MODE
Type: string
Default: hashed
How AI Studio exports the end user as user.id: off, hashed (a keyed pseudonym), or raw. When not set, the earlier variable AGENT_TRACING_EXPORT_INCLUDE_USER_ID still applies: true is raw and false is off. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_METRICS_ENABLED

ENV: AGENT_TRACING_METRICS_ENABLED
Type: boolean
Default: true
Exports agent tracing metrics. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_METRICS_INCLUDE_APP_ID

ENV: AGENT_TRACING_METRICS_INCLUDE_APP_ID
Type: boolean
Default: true
Adds the tyk.app.id attribute to agent tracing metrics. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_METRICS_EXPORT_INTERVAL

ENV: AGENT_TRACING_METRICS_EXPORT_INTERVAL
Type: duration
Default: 30s
The OTLP push interval for agent tracing metrics. Enterprise Edition only. Available from v2.3.0.

AGENT_TRACING_UI_MAX_PAYLOAD_VIEW_BYTES

ENV: AGENT_TRACING_UI_MAX_PAYLOAD_VIEW_BYTES
Type: integer
Default: 2097152
The largest captured content in bytes that the UI shows (2 MiB). Enterprise Edition only. Available from v2.3.0.