Skip to main content

Availability

EditionDeployment Type
Community & EnterpriseSelf-Managed, Hybrid
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: The application checks if a variable is already set in the environment before loading it from the file, ensuring shell variables are preserved.

Command Line Flags

You can specify a .env file using the -env flag when starting the binary:
./ai-studio -env /path/to/my.env

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.
Go TypeEnvironment Variable FormatExample
stringA regular string of text.TYK_GW_SECRET="mysecret"
int, int64A whole number.TYK_GW_LISTENPORT=8080
booltrue or false.TYK_GW_USEDBAPPCONFIG=true
[]stringA comma-separated list of strings.TYK_PMP_PUMPS_STDOUT_FILTERS_SKIPPEDAPIIDS="api1,api2,api3"
map[string]stringA comma-separated list of key:value pairs.TYK_GW_GLOBALHEADERS="X-Tyk-Test:true,X-Tyk-Version:1.0"
map[string]interface{}A JSON string representing the object.TYK_GW_POLICIES_POLICYSOURCE_CONFIG='{"connection_string": "..."}'
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

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.

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.

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
A secret key used for encrypting secrets and SSO.

DOCS_URL

ENV: DOCS_URL
Type: string
The URL for the documentation.

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.

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: false
Require OCI plugins to be signed.

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 verifying OCI plugin signatures. See the .env.example file for more details.

ALLOW_INTERNAL_NETWORK_ACCESS

ENV: ALLOW_INTERNAL_NETWORK_ACCESS
Type: boolean
Default: false
Allow plugins to access internal network addresses.

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.

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: false
Disable license 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.