The OpenAI Compatible API integration lets you connect ThunderAI to any server that follows the OpenAI API format.
This covers local servers like LM Studio, hosted services like DeepSeek, Grok, Mistral AI, OpenRouter, and Perplexity, as well as any custom or self-hosted endpoint.
| API key required | Free option | Best for |
|---|---|---|
| Depends on the service | Depends on the service (local servers are free) | Flexibility: local servers, alternative providers, custom endpoints |
Predefined configurations
ThunderAI includes ready-made presets for the most popular OpenAI-compatible services. If you are using one of these, select the preset and only provide your API key:
| Preset | Notes |
|---|---|
| DeepSeek API | Fast and cost-effective, strong reasoning models |
| Grok API | xAI's Grok models |
| Mistral API | Mistral AI's hosted models |
| OpenRouter API | Access many providers through a single API key |
| Perplexity API | Includes web-search augmented models |
Setup
The quickest way is the Setup Wizard: open it from the ThunderAI welcome page, the toolbar popup or the
settings page, choose OpenAI Compatible API, pick a service or enter your server address, choose a model and test the connection.
The wizard then lets you turn on the AI features you want.
To set it up by hand, follow the steps below.
1. Open the ThunderAI settings
In Thunderbird, go to Tools → Add-ons and Themes → ThunderAI → Preferences.
2. Select the OpenAI Compatible API integration
In the Connection Settings panel, choose OpenAI Compatible API in the Connection Type dropdown.
3a. Using a preset
If your provider has a preset, select it in Available Services and confirm. ThunderAI fills in the server address, the "v1" setting and the chat name, and empties the models list. Enter your API key and continue from step 5.
3b. Manual configuration
If your provider is not in the list, choose Custom and configure it by hand:
- Host Address: the base URL of your server, without
/v1. For LM Studio running locally this is typicallyhttp://localhost:1234. A remote server address works too. - Keep the "v1" compatibility (in the advanced options, checked by default): ThunderAI adds
/v1to the address, as inhttp://localhost:1234/v1/chat/completions. Uncheck it if your provider's endpoints have no/v1segment.
4. Enter your API key (if required)
Enter it in the OpenAI Comp API Key field, which is optional. Local servers like LM Studio usually do not require an API key, so you can leave it empty. Hosted services require a valid key.
5. Choose a model
Click Update list next to OpenAI Compatible API Models, then select your model from the list.
If the server does not provide a models list, click Add manually and type the model name as specified by your provider. Clear list empties the list.
6. Test the connection
Settings are saved as soon as you change them: there is no Save button.
Click Test now in the bar below the connection settings and accept Thunderbird's permission request, if it appears.
When everything is fine, the bar shows "Connected — OpenAI Compatible API reachable".
Then open any email, click the ThunderAI toolbar button and run a prompt.
Advanced options
Click Advanced options in the Connection Settings panel to show these settings:
- Keep the "v1" compatibility: see step 3b.
- Chat Name: the name shown for the AI in the ThunderAI chat window.
- Temperature: between 0 and 2. Higher values make the output more random, lower values more focused.
- Extra body data: additional parameters as a JSON object, for options the service supports but ThunderAI does not show,
e.g.
{"top_p": 0.9}, or{"chat_template_kwargs": {"thinking": false}}to turn off the thinking mode on the servers that support it.
You can also set these options on a single prompt, in the custom prompts page, and on each AI feature (Add Tags, Spam Filter, Summarize, Translate, Calendar Event, Task), with the Advanced options button of its specific connection.
LM Studio — quick setup
LM Studio provides a local server with an OpenAI-compatible API and a graphical interface to download and manage models.
- Download and install LM Studio from lmstudio.ai
- Download a model of your choice from LM Studio's model browser
- In LM Studio, start the local server
- In ThunderAI, choose Custom, set the Host Address to
http://localhost:1234, keep the "v1" compatibility checked, leave the API key empty, and select your model
Tips
- OpenRouter is a great option if you want to access many different models (including Claude, Gemini, and Mistral) through a single API key and billing account.
- When using local servers, performance depends on your hardware — see the Ollama guide for hardware tips.
- If requests fail with a CORS error and you can't change the server configuration, click Give permission to the current host in the ThunderAI settings
(under "Problems setting CORS?"). For a server on
localhostor127.0.0.1, Thunderbird asks for access to all websites (<all_urls>). - If the service's rate limit or quota is exceeded while ThunderAI processes several emails (Add Tags, Spam Filter, Summarize, Translate), the processing stops by itself and tells you how many messages were processed.
Troubleshooting
"Connection refused" on a local server
Make sure the local server (e.g. LM Studio) is actually running and the Host Address in ThunderAI matches the port it is listening on.
"401 Unauthorized" error
Check your API key. For local servers that do not require a key, try entering a dummy value like none. Some servers reject empty key fields.
Empty model list
Click Add manually and type the model name as specified by your provider or server documentation.
"404 Not Found", or errors caused by "v1" in the URL
Check that the Host Address does not end with /v1, since ThunderAI adds it when Keep the "v1" compatibility is checked. If your provider's endpoints have no /v1 segment, uncheck that option.