# Set Up an AI Provider

Source: https://help.dashboardfox.com/ai-query/set-up-an-ai-provider

An AI provider connects DashboardFox to your AI account: the vendor, your API key, the model, and who may use it. Until a provider is added and assigned, AI stays off for everyone.

## Prerequisites

- **Admin** role
- An API key from Anthropic, OpenAI or Google Gemini, or the address and key of an OpenAI-compatible service

## Add a Provider

1. Go to **Settings → AI Query → Providers** and select **Create Provider**.
2. Choose the **Scope**: **All apps**, or a single app.
3. Choose the **Provider** and paste your **API key**. For an OpenAI-compatible service, also enter the **Base URL**.
4. Select **Fetch models** and choose a model. See [Choose and Test an AI Model](https://help.dashboardfox.com/ai-query/choose-and-test-an-ai-model).
5. Under **Assigned Groups** and **Assigned Users**, tick who may use this provider. Tick **All Users** for everyone.
6. Select **Test**, check the result, then **Save**.

**Note:** Adding a provider does not switch AI on. AI must also be turned on for each app. See [Turn On AI for an App](https://help.dashboardfox.com/ai-query/turn-on-ai-for-an-app).

## Provider Settings

**Scope:** **All apps** makes the provider available on every app with AI turned on. Choose one app to limit it to that app.

**Provider:** Anthropic, OpenAI, Google Gemini, or **OpenAI-compatible**. OpenAI-compatible covers services such as Azure OpenAI, Groq, Together, DeepSeek and xAI, and servers you host, such as Ollama or vLLM.

**Base URL:** Required for OpenAI-compatible providers only. Leave it blank for the others.

**API key:** Stored encrypted and never shown again. When editing, the saved key appears locked. Click it to replace it.

**Model:** The model that builds your documents. **Fetch models** lists the models your key can use.

**Timeout (ms):** How long to wait for the vendor to answer. The default suits most models.

**Prompt cache:** Lets the vendor reuse the repeated part of each question, which lowers cost. Choose **5 minutes** (the default), **1 hour** for busy systems, or **Off**.

**Routing model (optional):** A smaller, cheaper model used for small steps, such as picking tables on very large categories. Left blank, the main model is used.

**Prices per million tokens (optional):** Your vendor's **Input**, **Cached input** and **Output** prices. Enter them to see estimated cost in Test results, the Providers list and the AI Audit.

**Custom headers** and **Custom CA certificate:** For private endpoints and gateways that need extra headers or your own certificate.

**Enabled:** Turn off to keep a provider without using it.

## Who Gets Which Provider

You can create several providers. When more than one covers a user, the most specific wins:

1. A provider assigned to the user by name
2. Otherwise, a provider assigned to one of the user's groups
3. Otherwise, a provider assigned to **All Users**

At each level, a provider for one app wins over a provider for all apps. A user covered by no enabled provider cannot use AI.

**Note:** A Virtual App uses the provider of the app its source document is built on.

## Common Setups

### One Provider for Everyone

**Goal:** The simplest setup.

- Scope: **All apps**
- Assigned to: **All Users**

### A Pilot Group First

**Goal:** Try AI with a few people before rolling it out.

- Assign the provider to one group of Composers.
- Widen access after a week of reviewing the AI Audit.

### A Key per Client or Department

**Goal:** Separate usage and billing.

- Create one provider per group, each with its own API key.
- Each group's usage is then separate in the AI Audit and on the vendor's bill.

### A Private Model for a Sensitive App (Self-Hosted)

**Goal:** Keep everything inside your network.

- Add an **OpenAI-compatible** provider scoped to that app, pointing at a model you host.
- Run **Test** before giving it to users. Local models are usually less reliable than hosted ones.

**Important:** On DashboardFox Cloud, the provider's address must be reachable over the internet. Models running only inside your network require the self-hosted edition.

## Provider Health

Once people are asking questions, the **Last 30 days** column on the Providers list shows how each provider's model is doing: questions asked, how many were built on the first try and, with prices entered, the estimated cost. A warning appears when too many questions are not being built.

When you open a saved provider whose model the vendor no longer offers, DashboardFox tells you. Choose a current model, **Test**, and **Save**.

## Additional Resources

- [Choose and Test an AI Model](https://help.dashboardfox.com/ai-query/choose-and-test-an-ai-model)
- [Turn On AI for an App](https://help.dashboardfox.com/ai-query/turn-on-ai-for-an-app)
- [Troubleshooting Ask AI](https://help.dashboardfox.com/ai-query/troubleshooting-ask-ai)
- **DashboardFox Academy:** [Set up AI providers](https://dashboardfox.com/academy/ai-providers/)
