# Configuring AI Provider Keys

By default, Mito uses our server to send AI requests to the model provider. If instead you want to use your own AI API keys, you can set the following configuration options.&#x20;

### Available Model Providers (Open Source)

If you want to use your own API key instead of ours, you can set the following environment variables depending on which model you want to use. By setting your own API key, you can send unlimited AI requests with Mito without hitting the 150 completion request limit. &#x20;

If you're not sure how to set an environment variable, [read our instructions here](#setting-up-environment-variables).&#x20;

#### OpenAI

* Set `OPENAI_API_KEY` to your OpenAI API key

#### Anthropic (Claude)

* Set `ANTHROPIC_API_KEY` to your Anthropic API key

#### Gemini (Google)

* Set `GEMINI_API_KEY` to your Google API key

### Available Model Providers (Enterprise)&#x20;

If you are a [Mito Enterprise](https://www.trymito.io/plans) user, you can configure Mito to use your enterprise LLM providers. If you have questions about Mito Enterprise, please contact [jake@sagacollab.com](https://app.gitbook.com/u/kv2S9THStxfPRSFA6B0j7QPPdk82).&#x20;

There are several benefits to using enterprise model providers:

1. **LLM Model Lockdown**: AI calls ONLY go to IT-approved LLM models. End users cannot change to unapproved LLM models
2. **Telemetry Elimination**: No telemetry is sent to Mito servers

#### Azure Open AI

Set the following environment variables:

* Set `AZURE_OPENAI_API_KEY` to your Azure OpenAI API key
* Set `AZURE_OPENAI_API_VERSION` to specify the API version
* Set `AZURE_OPENAI_ENDPOINT` to your Azure OpenAI endpoint URL
* Set `AZURE_OPENAI_MODEL` to specify the deployed model name

#### Lite LLM

To use LiteLLM, you must set the following environment variables:&#x20;

* Set `LITELLM_BASE_URL` to your LiteLLM server endpoint. ex: `https://my-litellm-server.com`
* Set `LITELLM_MODELS` as a comma-separated list of approved model names for users to select from. ex: `"litellm/openai/gpt-4o,litellm/anthropic/claude-4-5-sonnet"`
  * Model names must be formatted as `litellm/<provider>/<model>` (e.g., `"litellm/openai/gpt-4o"`)
  * Users will default to the first model that you provide.&#x20;
* Set `LITELLM_API_KEY` to the user's API key for authentication with the LiteLLM server.

#### Abacus AI

To use LiteLLM, you must set the following environment variables:&#x20;

* Set `ABACUS_BASE_URL` to your Abacus endpoint. For most users, this will be `https://routellm.abacus.ai/v1`
* Set `ABACUS_MODELS` as a comma-separated list of approved model names for users to select from. ex: `"abacus/gpt-4.1,abacus/abacus/gpt-5"`
  * Model names must be prefixed by `abacus` (e.g., `"abacus/gpt-4o"`)
  * Users will default to the first model that you provide.&#x20;
  * **For best performance with Abacus, use OpenAI models only.**&#x20;
* Set `ABACUS_API_KEY` to the user's API key for authentication with the Abacus AI.

### Setting Up Environment Variables

**The following steps are only for the mito-ai pip package. If you are using Mito Desktop, please see the instructions below.**&#x20;

**Note that** environment variables must be set **before** launching JupyterLab, as they are read when the Mito server extension initializes during startup.

#### Method 1: System Environment Variables

Set environment variables at the system level before starting JupyterLab:

**On Windows:**

```
set GEMINI_API_KEY=your-api-key-here
```

**On macOS/Linux:**

```
export GEMINI_API_KEY=your-api-key-here
```

#### Method 2: .env File with jupyter\_server\_config.py

1. Create a `.env` file in your Jupyter config directory:

```
GEMINI_API_KEY=your-api-key-here
```

2. Create or modify your `jupyter_server_config.py` file to load these variables on startup:

```python
import os
from dotenv import load_dotenv

# Load environment variables from .env file
load_dotenv('/path/to/your/.env')
```

#### Method 3: Shell Configuration

Add the environment variables to your shell's configuration file for permanent setup:

**On Windows:**

Add environment variables through System Properties > Environment Variables.

**On macOS/Linux:**

Add to your `.bashrc`, `.zshrc`, or equivalent:

```
export GEMINI_API_KEY=your-api-key-here
```

### Setting Environment Variables on Mito Desktop

When using **Mito Desktop**, the steps for setting environment variables vary by operating system. Follow the instructions below for your platform.

**macOS**

On macOS, environment variables can be configured directly through Mito Desktop’s Jupyter settings.

1. Open the Jupyter config directory:

   ```bash
   ~/.jupyter
   ```
2. Open (or create) the file:

   ```
   desktop-settings.json
   ```
3. Update the main JSON object to include your environment variables under `serverEnvVars`:

   ```json
   {
     "serverEnvVars": {
       "GEMINI_API_KEY": "your-api-key-here"
     }
   }
   ```
4. Launch **Mito Desktop**.
5. In a new notebook cell, verify the variable was set:

   ```python
   !printenv
   ```

**Windows**

**Option 1: Using the Windows GUI (recommended)**

From the **Start Menu**, search for **“Edit the system environment variables”** and open it.

1. Click **Environment Variables…**.
2. In the **Environment Variables** window, under **User variables for \<your username>**, click **New…**.
3. Enter the variable name and value, then click **OK** to save.
4. Fully restart **Mito Desktop**.

To verify the variable was set, open a notebook and run:

```python
!set
```

<figure><img src="https://2294704369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP_U5ZCmiamDOXEOOTC%2Fuploads%2FqJX2iHpailYscCriIpwh%2Fenv-vars-steps.png?alt=media&#x26;token=f5b51240-f88f-4b63-bcb3-1eac300b452f" alt=""><figcaption><p>Steps for adding a new environment variable on Windows</p></figcaption></figure>

**Option 2: Using the terminal**

If you prefer the command line, you can set the environment variable using PowerShell or Command Prompt:

```powershell
setx GEMINI_API_KEY "your-api-key-here"
```

After running this command:

1. Close any open terminals.
2. Restart **Mito Desktop**.
3. Verify the variable in a notebook cell:

   ```python
   !set
   ```

### Data Protection Considerations

Remember that when using external AI providers:

* Private data in dataframe names, column headers, or the first five rows of data might be shared with the AI provider
* To maximize data protection, Mito Enterprise users can connect to a self-hosted model
