> ## Documentation Index
> Fetch the complete documentation index at: https://tyk.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tyk AI Studio Environment Variables

> Environment variables and configuration options for Tyk AI Studio.

## Availability

| Edition | Deployment Type |
| :- | :- |
| [Community](https://tyk.io/docs/ai-management/ai-studio/overview.md#community-edition) & [Enterprise](https://tyk.io/docs/ai-management/ai-studio/overview.md#enterprise-edition) | Self-Managed |

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:

```bash theme={null}
./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 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": "..."}'` |

> [!NOTE]
>
> 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.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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`. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### ENABLE\_TRACING

ENV: **ENABLE\_TRACING**\

Type: `boolean`\

Default: `false`\


Exports OpenTelemetry trace spans. Trace propagation (`traceparent`) works whatever this value is. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### LLM\_UPSTREAM\_BLOCK\_INTERNAL

ENV: **LLM\_UPSTREAM\_BLOCK\_INTERNAL**\

Type: `boolean`\

Default: `false`\


Refuses connections to LLM upstreams that resolve to internal or reserved IP ranges. AI Studio checks the address when it connects. We recommend `true` in production. If an LLM runs on an internal host, add that host to `LLM_UPSTREAM_ALLOWED_INTERNAL_HOSTS`. Available from v2.2.0.

### 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. Available from v2.2.0.

### AI\_STUDIO\_PLUGIN\_ALLOWED\_DIRS

ENV: **AI\_STUDIO\_PLUGIN\_ALLOWED\_DIRS**\

Type: `string`\


A comma-separated list of directories that plugin binaries can run from. When not set, AI Studio uses a built-in list. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### CHAT\_UI\_V2\_ENABLED

ENV: **CHAT\_UI\_V2\_ENABLED**\

Type: `boolean`\

Default: `true`\


Selects the chat interface that was added in v2.2.0. Set to `false` to use the previous chat interface. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Enterprise Edition only. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### AUDIT\_ENABLED

ENV: **AUDIT\_ENABLED**\

Type: `boolean`\

Default: `true`\


Records management API actions in the audit trail. Enterprise Edition only. Available from v2.2.0.

### AUDIT\_STORE\_TYPE

ENV: **AUDIT\_STORE\_TYPE**\

Type: `string`\

Default: `db`\


Where AI Studio writes audit records: `db`, `file`, or `both`. Enterprise Edition only. Available from v2.2.0.

### 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. Available from v2.2.0.

### AUDIT\_FILE\_FORMAT

ENV: **AUDIT\_FILE\_FORMAT**\

Type: `string`\

Default: `json`\


The format of the audit file. Enterprise Edition only. Available from v2.2.0.

### 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. Available from v2.2.0.

### AUDIT\_RECORD\_READS

ENV: **AUDIT\_RECORD\_READS**\

Type: `boolean`\

Default: `false`\


Also records `GET` requests. Enterprise Edition only. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### WEBHOOKS\_ENABLED

ENV: **WEBHOOKS\_ENABLED**\

Type: `boolean`\

Default: `true`\


Turns on outbound webhooks. Webhooks need `TYK_AI_SECRET_KEY`. Enterprise Edition only. Available from v2.2.0.

### 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. Available from v2.2.0.

### WEBHOOKS\_WORKER\_COUNT

ENV: **WEBHOOKS\_WORKER\_COUNT**\

Type: `integer`\

Default: `4`\


The number of delivery workers on each node. Enterprise Edition only. Available from v2.2.0.

### WEBHOOKS\_MAX\_ATTEMPTS

ENV: **WEBHOOKS\_MAX\_ATTEMPTS**\

Type: `integer`\

Default: `10`\


The number of attempts before a delivery goes to the dead-letter queue. Enterprise Edition only. Available from v2.2.0.

### 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. Available from v2.2.0.

### WEBHOOKS\_MAX\_BACKOFF

ENV: **WEBHOOKS\_MAX\_BACKOFF**\

Type: `duration`\

Default: `1h`\


The maximum retry delay. Enterprise Edition only. Available from v2.2.0.

### WEBHOOKS\_REQUEST\_TIMEOUT

ENV: **WEBHOOKS\_REQUEST\_TIMEOUT**\

Type: `duration`\

Default: `10s`\


The HTTP timeout for each delivery attempt. Enterprise Edition only. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Internal targets (loopback, private ranges, link-local, and cloud metadata addresses) are always refused, unless `WEBHOOKS_ALLOW_INTERNAL_TARGETS` is `true`. Enterprise Edition only. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### TYK\_MCP\_SYNC\_MIN\_INTERVAL

ENV: **TYK\_MCP\_SYNC\_MIN\_INTERVAL**\

Type: `duration`\

Default: `60s`\


The minimum sync interval for each Tyk Dashboard connection. Enterprise Edition only. Available from v2.2.0.

### 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. Enterprise Edition only. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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`). When not set, any public host is allowed. Enterprise Edition only. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### 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. Available from v2.2.0.

### BASE\_PATH

ENV: **BASE\_PATH**\

Type: `string`\


Serves the API, OAuth, and the console under this path prefix. `SITE_URL` keeps its path. Available from v2.2.1.

### DATABASE\_SCHEMA

ENV: **DATABASE\_SCHEMA**\

Type: `string`\


PostgreSQL only. Keeps all AI Studio tables in this schema. Use 41 characters or fewer. Available from v2.2.1.

### 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. Available from v2.2.1.

### 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. Available from v2.2.1.

### CSRF\_COOKIE\_NAME

ENV: **CSRF\_COOKIE\_NAME**\

Type: `string`\

Default: `_gorilla_csrf`\


The name of the CSRF cookie. Available from v2.2.1.

### 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. Available on AI Studio from v2.2.1.

### 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. Available from v2.2.1.

### 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`. Available from v2.2.1.

### METRICS\_ENABLED

ENV: **METRICS\_ENABLED**\

Type: `boolean`\

Default: `true`\


Enables the Prometheus metrics endpoint. Set to `false` or `0` to turn it off. From v2.2.0, 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.
