# Environment Variables Reference

Complete reference of all environment variables that configure the Web Search tool at the platform level. All variables must be available in the `assistants-core` pod environment at startup.

Variables are loaded via Pydantic Settings from the process environment and optionally from a `.env` file.

---

## Core Settings

| Variable                        | Type          | Default     | Description                                                 |
|---------------------------------|---------------|-------------|-------------------------------------------------------------|
| `WEB_SEARCH_MODE`               | `v1` / `v2`  | `v2`       | Default search mode for new spaces.                        |
| `ACTIVE_SEARCH_ENGINES`        | JSON array    | `[
"google"
]` | Which search engines are available in the space configuration UI. |
| `ACTIVE_INHOUSE_CRAWLERS`      | JSON array    | `[
"basic",
"crawl4ai"
]` | Which built-in crawlers are available.                         |
| `DISABLE_WEB_SEARCH_TOOL`       | string        | `"false"` | Feature flag to disable the tool entirely.                 |

---

## Google Search API

| Variable                        | Type          | Default     | Description                                                 |
|---------------------------------|---------------|-------------|-------------------------------------------------------------|
| `GOOGLE_SEARCH_API_KEY`        | string        | `null`      | API key for Google Custom Search JSON API.                |
| `GOOGLE_SEARCH_API_ENDPOINT`   | string        | `null`      | API endpoint URL (e.g., `<https://customsearch.googleapis.com/customsearch/v1`).|
| `GOOGLE_SEARCH_ENGINE_ID`      | string        | `null`      | Custom Search Engine ID (cx parameter).                    |

---

## Bing / Azure AI

| Variable                        | Type          | Default     | Description                                                 |
|---------------------------------|---------------|-------------|-------------------------------------------------------------|
| `AZURE_AI_PROJECT_ENDPOINT`     | string        | `null`      | Azure AI project endpoint URL.                             |
| `AZURE_AI_BING_RESOURCE_CONNECTION_STRING` | string | `null` | Bing resource connection string from Azure.                |
| `AZURE_AI_BING_AGENT_MODEL`    | string        | `--` (required) | The deployed model name used by the Bing Foundry Agent in auto-provisioned mode. |
| `AZURE_AI_ASSISTANT_ID`        | string        | `null`      | Pre-configured Foundry Agent ID. When set, skips auto-provisioning and uses this agent as-is. |

---

## Brave Search API

| Variable                        | Type          | Default     | Description                                                 |
|---------------------------------|---------------|-------------|-------------------------------------------------------------|
| `BRAVE_SEARCH_API_KEY`         | string        | `null`      | API key for Brave Search.                                  |
| `BRAVE_SEARCH_API_ENDPOINT`    | string        | `null`      | Brave Search API endpoint URL.                             |

---

## Jina AI

| Variable                        | Type          | Default     | Description                                                 |
|---------------------------------|---------------|-------------|-------------------------------------------------------------|
| `JINA_API_KEY`                 | string        | `null`      | API key for Jina AI. Also enables Jina search and crawler.|
| `JINA_SEARCH_API_ENDPOINT`      | string      | `<https://s.jina.ai/>` | Jina Search API endpoint.                                   |
| `JINA_READER_API_ENDPOINT`     | string      | `<https://r.jina.ai/>` | Jina Reader API endpoint (used by crawler).                 |

---

## Tavily

| Variable                        | Type          | Default     | Description                                                 |
|---------------------------------|---------------|-------------|-------------------------------------------------------------|
| `TAVILY_API_KEY`               | string        | `null`      | API key for Tavily. Also enables Tavily search and crawler.|

---

## Firecrawl

| Variable                        | Type          | Default     | Description                                                 |
|---------------------------------|---------------|-------------|-------------------------------------------------------------|
| `FIRECRAWL_API_KEY`            | string        | `null`      | API key for Firecrawl. Also enables Firecrawl search and crawler.|

---

## VertexAI (Google Cloud)

| Variable                        | Type          | Default     | Description                                                 |
|---------------------------------|---------------|-------------|-------------------------------------------------------------|
| `VERTEXAI_SERVICE_ACCOUNT_CREDENTIALS`  | string | `null`      | GCP service account credentials (JSON string).            |
| `VERTEXAI_SERVICE_ACCOUNT_SCOPES`   | list of strings | `null` | OAuth scopes for the service account.                       |

---

## Custom API

| Variable                        | Type          | Default     | Description                                                 |
|---------------------------------|---------------|-------------|-------------------------------------------------------------|
| `CUSTOM_WEB_SEARCH_API_METHOD` | `GET` / `POST` | `null`      | HTTP method. When set, the field is hidden from space-level config. |
| `CUSTOM_WEB_SEARCH_API_ENDPOINT` | string      | `null`      | API endpoint URL. When set, the field is hidden from space-level config. |
| `CUSTOM_WEB_SEARCH_API_HEADERS` | string (JSON) | `null`      | Request headers. When set, the field is hidden from space-level config. |
| `CUSTOM_WEB_SEARCH_API_ADDITIONAL_QUERY_PARAMS` | string (JSON) | `null` | Additional query parameters. When set, the field is hidden from space-level config. |
| `CUSTOM_WEB_SEARCH_API_ADDITIONAL_BODY_PARAMS` | string (JSON) | `null` | Additional request body parameters. When set, the field is hidden from space-level config. |
| `CUSTOM_WEB_SEARCH_API_CLIENT_CONFIG` | string (JSON) | `null` | HTTP client configuration (e.g., SSL settings).              |

---

## Proxy Settings

| Variable                        | Type          | Default     | Description                                                 |
|---------------------------------|---------------|-------------|-------------------------------------------------------------|
| `PROXY_AUTH_MODE`              | `none` / `username_password` / `ssl_tls` | `none` | Proxy authentication mode.                                   |
| `PROXY_PROTOCOL`               | `http` / `https` | `http` | Proxy protocol.                                            |
| `PROXY_HOST`                   | string        | `null`      | Proxy hostname.                                           |
| `PROXY_PORT`                   | integer       | `null`      | Proxy port number.                                       |
| `PROXY_HEADERS`                | dict (JSON)   | `{}`        | Additional headers sent through the proxy.                 |
| `PROXY_SSL_CA_BUNDLE_PATH`     | string       | `null`      | Custom CA bundle path for proxy SSL verification.          |
| `PROXY_USERNAME`               | string        | `null`      | Username for `username_password` auth mode.              |
| `PROXY_PASSWORD`               | string        | `null`      | Password for `username_password` auth mode.              |
| `PROXY_SSL_CERT_PATH`         | string        | `null`      | Client certificate path for `ssl_tls` auth mode.         |
| `PROXY_SSL_KEY_PATH`          | string        | `null`      | Client key path for `ssl_tls` auth mode.                 |

---

## Azure Identity

| Variable                        | Type          | Default     | Description                                                 |
|---------------------------------|---------------|-------------|-------------------------------------------------------------|
| `UNIQUE_PRIVATE_ENDPOINT_TRANSPORT_ENABLED` | boolean | `false` | Whether to use Azure private endpoint transport.           |
| `DEFAULT_AZURE_IDENTITY_CREDENTIAL_TYPE` | `workload` / `default` | `default` | Azure identity credential type. Use `workload` for AKS workload identity. |
| `DEFAULT_AZURE_IDENTITY_CREDENTIALS_VALIDATE_TOKEN_URL` | string | `<https://management.azure.com/.default>` | URL used to validate Azure identity tokens.            |

---

## Other

| Variable                        | Type          | Default     | Description                                                 |
|---------------------------------|---------------|-------------|-------------------------------------------------------------|
| `ENV`                          | string        | `null`      | Environment name (e.g., `production`, `staging`).         |
| `LOG_LEVEL`                   | string        | `null`      | Logging level (e.g., `INFO`, `DEBUG`).                    |
| `TIKTOKEN_CACHE_DIR`          | string        | `./tiktoken_cache/` | Directory for caching tokenizer data.                      |
