Availability
| Edition | Deployment Type |
|---|---|
| Community & Enterprise | Self-Managed, Hybrid |
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: 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:
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 Type | Environment Variable Format | Example |
|---|---|---|
string | A regular string of text. | TYK_GW_SECRET="mysecret" |
int, int64 | A whole number. | TYK_GW_LISTENPORT=8080 |
bool | true or false. | TYK_GW_USEDBAPPCONFIG=true |
[]string | A comma-separated list of strings. | TYK_PMP_PUMPS_STDOUT_FILTERS_SKIPPEDAPIIDS="api1,api2,api3" |
map[string]string | A 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_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.
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.
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:
stringA secret key used for encrypting secrets and SSO.
DOCS_URL
ENV: DOCS_URLType:
stringThe URL for the documentation.
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.
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:
falseRequire OCI plugins to be signed.
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 verifying OCI plugin signatures. See the
.env.example file for more details.
ALLOW_INTERNAL_NETWORK_ACCESS
ENV: ALLOW_INTERNAL_NETWORK_ACCESSType:
booleanDefault:
falseAllow plugins to access internal network addresses.
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.
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:
falseDisable license 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.