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):- Shell Environment Variables: Variables set in the OS/Shell (e.g.,
export SERVER_PORT=9090) always override everything else. .envFile: Variables loaded from the file specified by the-envflag.- 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_PORTType:
stringDefault:
8080The port for the AI Studio server to listen on.
ALLOW_REGISTRATIONS
ENV: ALLOW_REGISTRATIONSType:
booleanDefault:
trueAllow new users to register.
SITE_URL
ENV: SITE_URLType:
stringThe public URL of the AI Studio.
FROM_EMAIL
ENV: FROM_EMAILType:
stringThe email address to send emails from.
DEVMODE
ENV: DEVMODEType:
booleanDefault:
falseEnable development mode.
BRANDING_STORAGE_PATH
ENV: BRANDING_STORAGE_PATHType:
stringDefault:
./data/brandingThe 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_HTTPType:
booleanDefault:
falseEnable HTTP debugging.
DEBUG_HTTP_PROXY
ENV: DEBUG_HTTP_PROXYType:
booleanDefault:
falseEnable HTTP proxy debugging.
DATABASE_URL
ENV: DATABASE_URLType:
stringDefault:
midsommar.dbThe 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=immediatewhen the string does not set them, and removescache=shared. On a network file system, set_journal_mode=DELETE.
DATABASE_TYPE
ENV: DATABASE_TYPEType:
stringDefault:
sqliteThe type of database to use (e.g.,
sqlite, postgres).
ECHO_CONVERSATION
ENV: ECHO_CONVERSATIONType:
booleanDefault:
falseEcho conversation messages for debugging.
TYK_AI_SECRET_KEY
ENV: TYK_AI_SECRET_KEYType:
stringThe 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_PORTType:
integerDefault:
8989The port of the bundled documentation server.
DOCS_URL_OVERRIDE
ENV: DOCS_URL_OVERRIDEType:
stringThe URL of the documentation link in the UI. When not set, the link is
http://localhost:<DOCS_PORT>.
DOCS_DISABLED
ENV: DOCS_DISABLEDType:
booleanDefault:
falseTurns off the bundled documentation server.
PROXY_URL
ENV: PROXY_URLType:
stringThe URL for the proxy.
TOOL_DISPLAY_URL
ENV: TOOL_DISPLAY_URLType:
stringThe display URL for tools in the UI.
DATASOURCE_DISPLAY_URL
ENV: DATASOURCE_DISPLAY_URLType:
stringThe display URL for datasources in the UI.
FILTER_SIGNUP_DOMAINS
ENV: FILTER_SIGNUP_DOMAINSType:
stringA comma-separated list of domains to allow for signup.
DEFAULT_SIGNUP_MODE
ENV: DEFAULT_SIGNUP_MODEType:
stringDefault:
bothThe default signup mode.
DEFAULT_APP_QUOTA
ENV: DEFAULT_APP_QUOTAType:
stringDefault:
1Enterprise 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_DIRType:
stringThe directory to cache OCI plugins.
AI_STUDIO_OCI_MAX_CACHE_SIZE
ENV: AI_STUDIO_OCI_MAX_CACHE_SIZEType:
integerDefault:
1073741824The maximum size of the OCI cache in bytes.
AI_STUDIO_OCI_REQUIRE_SIGNATURE
ENV: AI_STUDIO_OCI_REQUIRE_SIGNATUREType:
booleanDefault:
trueRequires 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_REGISTRIESType:
stringA comma-separated list of allowed OCI registries.
AI_STUDIO_OCI_TIMEOUT
ENV: AI_STUDIO_OCI_TIMEOUTType:
stringDefault:
30sThe timeout for OCI operations.
AI_STUDIO_OCI_RETRY_ATTEMPTS
ENV: AI_STUDIO_OCI_RETRY_ATTEMPTSType:
integerDefault:
3The number of retry attempts for OCI operations.
AI_STUDIO_OCI_GC_INTERVAL
ENV: AI_STUDIO_OCI_GC_INTERVALType:
stringDefault:
24hThe garbage collection interval for the OCI cache.
AI_STUDIO_OCI_KEEP_VERSIONS
ENV: AI_STUDIO_OCI_KEEP_VERSIONSType:
integerDefault:
3The number of plugin versions to keep in the OCI cache.
AI_STUDIO_OCI_INSECURE_REGISTRIES
ENV: AI_STUDIO_OCI_INSECURE_REGISTRIESType:
stringA comma-separated list of insecure OCI registries.
OCI_PLUGINS_REGISTRY_*
ENV: OCI_PLUGINS_REGISTRY_*Type:
stringAuthentication for private OCI registries. See the
.env.example file for more details.
OCI_PLUGINS_PUBKEY_*
ENV: OCI_PLUGINS_PUBKEY_*Type:
stringPublic 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_ACCESSType:
booleanDefault:
falseTurns 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_TYPEType:
stringDefault:
inmemoryThe 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_LEVELType:
stringDefault:
infoThe log level (e.g.,
trace, debug, info, warn, error).
SESSION_DURATION
ENV: SESSION_DURATIONType:
stringDefault:
6hThe duration of user sessions.
TYK_AI_LICENSE
ENV: TYK_AI_LICENSEType:
stringThe 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_URLType:
stringDefault:
https://telemetry.tyk.technology/api/trackThe URL for license telemetry.
LICENSE_TELEMETRY_PERIOD
ENV: LICENSE_TELEMETRY_PERIODType:
stringDefault:
1hThe period for sending license telemetry.
LICENSE_VALIDITY_CHECK_PERIOD
ENV: LICENSE_VALIDITY_CHECK_PERIODType:
stringDefault:
24hThe period for checking license validity.
LICENSE_DISABLE_TELEMETRY
ENV: LICENSE_DISABLE_TELEMETRYType:
booleanDefault:
trueTurns 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_ENABLEDType:
booleanDefault:
falseSends 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_CONCURRENCYType:
integerDefault:
20The maximum number of concurrent telemetry requests.
GATEWAY_MODE
ENV: GATEWAY_MODEType:
stringDefault:
standaloneThe gateway mode (
standalone or control).
GRPC_PORT
ENV: GRPC_PORTType:
integerDefault:
50051The gRPC server port.
GRPC_HOST
ENV: GRPC_HOSTType:
stringDefault:
0.0.0.0The gRPC server host.
GRPC_TLS_INSECURE
ENV: GRPC_TLS_INSECUREType:
booleanDefault:
falseSet to
true to disable TLS for the gRPC server.
GRPC_TLS_CERT_PATH
ENV: GRPC_TLS_CERT_PATHType:
stringThe path to the TLS certificate for the gRPC server.
GRPC_TLS_KEY_PATH
ENV: GRPC_TLS_KEY_PATHType:
stringThe path to the TLS key for the gRPC server.
GRPC_AUTH_TOKEN
ENV: GRPC_AUTH_TOKENType:
stringThe authentication token for edge gateways to connect to the control plane.
GRPC_AUTH_TOKEN_NEXT
ENV: GRPC_AUTH_TOKEN_NEXTType:
stringThe next authentication token for zero-downtime rotation.
MICROGATEWAY_ENCRYPTION_KEY
ENV: MICROGATEWAY_ENCRYPTION_KEYType:
stringThe 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_PATHType:
stringDefault:
/v1The 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_DISABLEDType:
booleanDefault:
falseTurns off the Main Ingress on AI Studio. The per-LLM endpoints are not affected.
METRICS_AUTH_TOKEN
ENV: METRICS_AUTH_TOKENType:
stringThe 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_UNAUTHENTICATEDType:
booleanDefault:
falseServes
/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_NAMESType:
booleanDefault:
trueKeeps 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_TRACINGType:
booleanDefault:
falseExports OpenTelemetry trace spans. Trace propagation (
traceparent) works whatever this value is.
TRACING_ENDPOINT
ENV: TRACING_ENDPOINTType:
stringThe 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_TIMINGType:
booleanDefault:
falseAdds 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_ORIGINSType:
stringDefault:
*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_ORIGINSType:
stringAdditional 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_HOSTSType:
stringA 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_INTERNALType:
booleanDefault:
trueRefuses 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_HOSTSType:
stringA 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_ADCType:
booleanDefault:
falseLets 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_DIRSType:
stringA 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_SIZEType:
stringDefault:
512MBThe maximum size of one plugin layer that AI Studio downloads from an OCI registry.
ALLOW_SSO_USER_API_KEYS
ENV: ALLOW_SSO_USER_API_KEYSType:
booleanDefault:
falseLets users with the
users:write permission issue personal API keys to users that come from SSO.
SSO_API_KEY_LIVENESS
ENV: SSO_API_KEY_LIVENESSType:
durationDefault:
720hThe 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_ENABLEDType:
booleanDefault:
trueSelects the current chat interface. Set to
false to use the previous chat interface.
CHAT_SESSION_IDLE_TTL
ENV: CHAT_SESSION_IDLE_TTLType:
durationDefault:
10mHow 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_TIMEOUTType:
durationDefault:
5sThe 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_ALLOCSType:
integerDefault:
10000000The 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_OSType:
booleanDefault:
falseGives 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_TIMEOUTType:
durationDefault:
10sThe maximum time for one
tyk.makeHTTPRequest call from a filter script. Enterprise Edition only.
FILTER_HTTP_MAX_RESPONSE_BYTES
ENV: FILTER_HTTP_MAX_RESPONSE_BYTESType:
integerDefault:
1048576The largest response body that
tyk.makeHTTPRequest returns. A larger body is an error. Enterprise Edition only.
FILTER_LLM_TIMEOUT
ENV: FILTER_LLM_TIMEOUTType:
durationDefault:
30sThe maximum time for one
tyk.llm call from a filter script. Enterprise Edition only.
SKIP_FILTER_DEFAULTS
ENV: SKIP_FILTER_DEFAULTSType:
booleanDefault:
falseDoes not create the four default guardrails on a new database. Enterprise Edition only.
AUDIT_ENABLED
ENV: AUDIT_ENABLEDType:
booleanDefault:
trueRecords management API actions in the audit trail. Enterprise Edition only.
AUDIT_STORE_TYPE
ENV: AUDIT_STORE_TYPEType:
stringDefault:
dbWhere AI Studio writes audit records:
db, file, or both. Enterprise Edition only.
AUDIT_FILE_PATH
ENV: AUDIT_FILE_PATHType:
stringDefault:
./data/audit/audit.logThe audit file when
AUDIT_STORE_TYPE is file or both. Enterprise Edition only.
AUDIT_FILE_FORMAT
ENV: AUDIT_FILE_FORMATType:
stringDefault:
jsonThe format of the audit file. Enterprise Edition only.
AUDIT_DETAILED_RECORDING
ENV: AUDIT_DETAILED_RECORDINGType:
booleanDefault:
falseAlso 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_READSType:
booleanDefault:
falseAlso records
GET requests. Enterprise Edition only.
AUDIT_RETENTION_DAYS
ENV: AUDIT_RETENTION_DAYSType:
integerDefault:
90The number of days that AI Studio keeps audit records.
0 keeps them forever. Enterprise Edition only.
AUDIT_MAX_BODY_BYTES
ENV: AUDIT_MAX_BODY_BYTESType:
integerDefault:
65536The maximum size of each stored request or response body. Enterprise Edition only.
AUDIT_QUEUE_SIZE
ENV: AUDIT_QUEUE_SIZEType:
integerDefault:
4096The size of the in-memory queue before the audit writer. Enterprise Edition only.
AUDIT_REDACT_KEYS
ENV: AUDIT_REDACT_KEYSType:
stringA 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_HEADERSType:
stringA 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_ENABLEDType:
booleanDefault:
trueTurns on outbound webhooks. Webhooks need
TYK_AI_SECRET_KEY. Enterprise Edition only.
WEBHOOKS_WORKER_ENABLED
ENV: WEBHOOKS_WORKER_ENABLEDType:
booleanDefault:
trueSet to
false to manage webhook targets on this node without sending deliveries. Enterprise Edition only.
WEBHOOKS_WORKER_COUNT
ENV: WEBHOOKS_WORKER_COUNTType:
integerDefault:
4The number of delivery workers on each node, from 1 to 64. Enterprise Edition only.
WEBHOOKS_MAX_ATTEMPTS
ENV: WEBHOOKS_MAX_ATTEMPTSType:
integerDefault:
10The 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_BACKOFFType:
durationDefault:
5sThe first retry delay. Later delays increase exponentially, with jitter, and respect
Retry-After. Enterprise Edition only.
WEBHOOKS_MAX_BACKOFF
ENV: WEBHOOKS_MAX_BACKOFFType:
durationDefault:
1hThe maximum retry delay. Enterprise Edition only.
WEBHOOKS_REQUEST_TIMEOUT
ENV: WEBHOOKS_REQUEST_TIMEOUTType:
durationDefault:
10sThe HTTP timeout for each delivery attempt. The maximum is
60s. Enterprise Edition only.
WEBHOOKS_ALLOW_INTERNAL_TARGETS
ENV: WEBHOOKS_ALLOW_INTERNAL_TARGETSType:
booleanDefault:
falseAllows webhook targets on loopback and private IP ranges, for example local receivers. Enterprise Edition only.
WEBHOOKS_ALLOWED_HOSTS
ENV: WEBHOOKS_ALLOWED_HOSTSType:
stringA 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_HOSTSType:
stringA comma-separated list of webhook target hosts that AI Studio always refuses. Enterprise Edition only.
WEBHOOKS_RETENTION_DAYS
ENV: WEBHOOKS_RETENTION_DAYSType:
integerDefault:
14The 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_DAYSType:
integerDefault:
30The number of days that AI Studio keeps dead-lettered deliveries. Enterprise Edition only.
WEBHOOKS_MAX_RESPONSE_SNIPPET_BYTES
ENV: WEBHOOKS_MAX_RESPONSE_SNIPPET_BYTESType:
integerDefault:
4096The size of the response body that the delivery log keeps for each attempt. Enterprise Edition only.
WEBHOOKS_REQUIRE_DIFFERENT_APPROVER
ENV: WEBHOOKS_REQUIRE_DIFFERENT_APPROVERType:
booleanDefault:
falseWhen
true, the user who creates a webhook target cannot approve it. Enterprise Edition only.
WEBHOOKS_SECRET_ROTATION_GRACE
ENV: WEBHOOKS_SECRET_ROTATION_GRACEType:
durationDefault:
24hAfter you rotate a signing secret, AI Studio sends both signatures for this period. Enterprise Edition only.
WEBHOOKS_REDACT_KEYS
ENV: WEBHOOKS_REDACT_KEYSType:
stringA comma-separated list of extra key fragments to redact from webhook payloads. Enterprise Edition only.
WEBHOOKS_AUDIT_DELIVERIES
ENV: WEBHOOKS_AUDIT_DELIVERIESType:
booleanDefault:
falseAlso records successful deliveries in the audit trail. Dead-lettered deliveries are always recorded. Enterprise Edition only.
WEBHOOKS_SHUTDOWN_DRAIN_TIMEOUT
ENV: WEBHOOKS_SHUTDOWN_DRAIN_TIMEOUTType:
durationDefault:
15sThe time that in-flight deliveries get to finish when AI Studio stops. Enterprise Edition only.
TYK_MCP_ENABLED
ENV: TYK_MCP_ENABLEDType:
booleanDefault:
trueTurns 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_INTERVALType:
durationDefault:
60sThe minimum sync interval for each Tyk Dashboard connection. The lowest value is
10s. Enterprise Edition only.
TYK_MCP_REQUEST_TIMEOUT
ENV: TYK_MCP_REQUEST_TIMEOUTType:
durationDefault:
10sThe 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_SECONDType:
integerDefault:
10The maximum number of outbound requests per second for each connection. Enterprise Edition only.
TYK_MCP_ALLOWED_HOSTS
ENV: TYK_MCP_ALLOWED_HOSTSType:
stringA 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_HOSTSType:
stringA comma-separated list of hosts that connections can never use. Enterprise Edition only.
TYK_MCP_REQUIRE_DIFFERENT_ACTIVATOR
ENV: TYK_MCP_REQUIRE_DIFFERENT_ACTIVATORType:
booleanDefault:
falseWhen
true, the user who creates a connection cannot activate it. Enterprise Edition only.
TYK_MCP_SYNC_RUN_RETENTION
ENV: TYK_MCP_SYNC_RUN_RETENTIONType:
durationDefault:
720hHow long AI Studio keeps sync run records. Enterprise Edition only.
BASE_PATH
ENV: BASE_PATHType:
stringServes the API, OAuth, and the console under this path prefix.
SITE_URL keeps its path.
DATABASE_SCHEMA
ENV: DATABASE_SCHEMAType:
stringPostgreSQL only. Keeps all AI Studio tables in this schema. Use 41 characters or fewer.
MIGRATION_LOCK_TIMEOUT
ENV: MIGRATION_LOCK_TIMEOUTType:
durationDefault:
15mHow long an instance that starts waits for the database migrations of another instance.
CSRF_KEY
ENV: CSRF_KEYType:
stringThe 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.
CSRF_COOKIE_NAME
ENV: CSRF_COOKIE_NAMEType:
stringDefault:
_gorilla_csrfThe name of the CSRF cookie.
GRPC_MAX_MESSAGE_SIZE
ENV: GRPC_MAX_MESSAGE_SIZEType:
stringDefault:
16MBThe send and receive limit for messages between AI Studio and Edge Gateways.
GRPC_MAX_CONNECTION_AGE
ENV: GRPC_MAX_CONNECTION_AGEType:
durationDefault:
0Closes 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_GRACEType:
durationDefault:
0The 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_ENABLEDType:
booleanDefault:
trueEnables 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_PATHType:
stringDefault:
/metricsThe path of the metrics endpoint.
AI_STUDIO_ENV_REF_ALLOWLIST
ENV: AI_STUDIO_ENV_REF_ALLOWLISTType:
stringA 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_POLICYType:
stringDefault:
requiredSets 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_FILEType:
stringThe 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_SOURCESType:
stringA 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_ALLOWLISTType:
stringA 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_URLSType:
booleanDefault:
falseDeprecated. 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_PASSTHROUGHType:
stringA 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_BYTESType:
integerDefault:
67108864The 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_PARAMSType:
booleanDefault:
falseAdds 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_LABELType:
stringA 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_CONNSType:
integerDefault:
0PostgreSQL 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_CONNSType:
integerDefault:
2PostgreSQL only. The number of idle connections that AI Studio keeps open. Available from v2.3.0.
DATABASE_CONN_MAX_LIFETIME
ENV: DATABASE_CONN_MAX_LIFETIMEType:
durationDefault:
30mPostgreSQL 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_TIMEOUTType:
durationDefault:
10sPostgreSQL 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_TIMEOUTType:
durationDefault:
60sPostgreSQL 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_GRACEType:
durationDefault:
30sPostgreSQL 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_WINDOWType:
durationDefault:
15sPostgreSQL 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_BYTESType:
integerDefault:
16The 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_BYTESType:
integerDefault:
67108864The 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_CREATESType:
integerDefault:
4The 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_ITEMSType:
integerDefault:
10000The 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_CALLSType:
integerDefault:
10000The 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_APPType:
integerDefault:
0The 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_INTERVALType:
durationDefault:
30sHow 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_BATCHType:
integerDefault:
50The 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_WORKERSType:
integerDefault:
4The 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_INTERVALType:
durationDefault:
2mThe 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_BACKOFFType:
durationDefault:
30mThe 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_ENTRIESType:
integerDefault:
100000The 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_BYTESType:
integerDefault:
67108864The 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_TTLType:
durationDefault:
10mHow 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_SLOTSType:
integerThe 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_SLOTSType:
integerThe 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_BYTESType:
integerDefault:
67108864The 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_BYTESType:
integerDefault:
8388608The 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_MIBType:
integerDefault:
2000The 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_WORKERSType:
integerThe 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_BYTESType:
integerDefault:
67108864The 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_ALLOWLISTType:
stringA 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: GODEBUGType:
stringGo 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_ENABLEDType:
booleanDefault:
falseTurns 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_KEYType:
stringThe 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_PREVIOUSType:
stringThe 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_EVENTSType:
integerDefault:
10000The 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_BYTESType:
integerDefault:
67108864The 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_BYTESType:
integerDefault:
1048576The 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_CEILINGType:
stringThe 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_MODEType:
stringDefault:
offThe 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_OVERRIDEType:
stringDefault:
metadataThe 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_CAPType:
stringDefault:
fullThe 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_DETECTORSType:
stringDefault:
email,phone,payment_card,iban,us_ssn,jwt,bearer_token,api_key,private_keyA 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_BYTESType:
integerDefault:
262144The 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_BYTESType:
integerDefault:
1048576The 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_BINARYType:
booleanDefault:
falseStores binary content. When
false, AI Studio stores a reference to the binary content. Enterprise Edition only. Available from v2.3.0.
AGENT_TRACING_MIN_LINK_CONFIDENCE
ENV: AGENT_TRACING_MIN_LINK_CONFIDENCEType:
stringDefault:
weakThe 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_WINDOWType:
durationDefault:
300sThe 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_TOLERANCEType:
durationDefault:
2sThe 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_TIMEOUTType:
durationDefault:
5mA 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_TIMEOUTType:
durationDefault:
30mA 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_DURATIONType:
durationDefault:
4hAn 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_SPANSType:
integerDefault:
5000An 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_HEADERSType:
stringDefault:
helicone,portkey,openrouter,bifrost,agent_router,cloudflare,agentcore,mcp_sessionA 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_HEADERSType:
stringDefault:
claude_code,codex_cli,opencodeA 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_STRIPType:
stringDefault:
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_PROVIDERSType:
booleanDefault:
trueSends 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_UPSTREAMSType:
booleanDefault:
trueSends trace context to HTTP upstreams, such as tools. Enterprise Edition only. Available from v2.3.0.
AGENT_TRACING_PROPAGATE_MCP
ENV: AGENT_TRACING_PROPAGATE_MCPType:
booleanDefault:
trueSends 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_IDType:
booleanDefault:
trueSends 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_HEADERSType:
booleanDefault:
falseForwards the
X-Tyk-* tracing headers to upstreams. Enterprise Edition only. Available from v2.3.0.
AGENT_TRACING_BAGGAGE_ALLOWLIST
ENV: AGENT_TRACING_BAGGAGE_ALLOWLISTType:
stringDefault:
session.idA 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_DAYSType:
integerDefault:
30The 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_DAYSType:
integerDefault:
7The 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_TTLType:
durationDefault:
24hThe 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_RATEType:
numberDefault:
1.0The 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_FILEType:
stringThe 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_PROFILEType:
stringDefault:
genai-1.41The 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_MODEType:
stringDefault:
tykThe 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_EVENTSType:
stringDefault:
eventsHow 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_CONTENTType:
stringDefault:
noneThe 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_BYTESType:
integerDefault:
16384The 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_DELAYType:
durationDefault:
30sThe 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_IDType:
booleanDefault:
trueExports 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_FALLBACKType:
stringDefault:
neverSet 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_MODEType:
stringDefault:
hashedHow 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_ENABLEDType:
booleanDefault:
trueExports agent tracing metrics. Enterprise Edition only. Available from v2.3.0.
AGENT_TRACING_METRICS_INCLUDE_APP_ID
ENV: AGENT_TRACING_METRICS_INCLUDE_APP_IDType:
booleanDefault:
trueAdds 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_INTERVALType:
durationDefault:
30sThe 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_BYTESType:
integerDefault:
2097152The largest captured content in bytes that the UI shows (2 MiB). Enterprise Edition only. Available from v2.3.0.