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

# Configure AI Provider

> Configure your AI provider in ChatterMate — OpenAI, Anthropic (Claude), Google Gemini, Mistral, xAI Grok, DeepSeek, Groq, or any OpenAI-compatible endpoint (self-hosted, Ollama, vLLM, OpenRouter) — with your own API key.

# AI Provider Configuration

Configure your preferred AI provider to power ChatterMate's intelligent customer support capabilities.

![AI Provider Configuration](https://mintcdn.com/chattermatechat/jxGyU3MQNVRda1Oo/images/ai-configuration.png?fit=max\&auto=format\&n=jxGyU3MQNVRda1Oo\&q=85\&s=b94352b88cb94911c6b194991c770740)

## Available Providers

ChatterMate supports multiple AI providers, giving you the flexibility to choose the one that best fits your needs:

> [card] OpenAI
>
> GPT-4.1, GPT-4o, and o-series models

> [card] Anthropic (Claude)
>
> Claude Opus, Sonnet, and Haiku

> [card] Google Gemini
>
> Gemini 2.5 Pro / Flash

> [card] Mistral
>
> Mistral Large, Medium, and Small

> [card] xAI (Grok)
>
> Grok 4 and Grok 3

> [card] DeepSeek
>
> DeepSeek Chat and Reasoner

> [card] Groq
>
> Ultra-fast inference (GPT-OSS, Llama)

> [card] [OpenAI-compatible](https://docs.chattermate.chat/deployment/self-hosted-models.md)
>
> Self-hosted or gateway endpoints — Ollama, vLLM, llama.cpp, OpenRouter, LiteLLM

Every provider is **bring-your-own-key** — you supply your own API key, encrypted at rest. When you pick a provider, a **"Get your API key"** link points to that provider's console. The exception is **OpenAI-compatible**, which has no hosted console: you point ChatterMate at an endpoint you control or subscribe to, so the key comes from that endpoint.

> [!NOTE]
>
> **Want to keep inference on your own hardware?** Pick **OpenAI-compatible** and give
> ChatterMate the base URL of your own server. See
> [Self-hosted and gateway models](https://docs.chattermate.chat/deployment/self-hosted-models.md) for worked
> Ollama, vLLM, llama.cpp, OpenRouter, and LiteLLM setups.

## Configuration Fields

### AI Provider

Select your provider from the grid. The seven hosted providers all support tool calling and structured output, so any of them works with ChatterMate's agents, knowledge search, and workflows:

* **OpenAI** (Recommended): Best-in-class models with consistent performance
* **Anthropic (Claude)**: Strong reasoning and analysis
* **Google Gemini**: Large context windows, great price/performance
* **Mistral / xAI (Grok) / DeepSeek / Groq**: Cost and speed options
* **OpenAI-compatible**: Any endpoint that speaks the OpenAI chat-completions API — your own server (Ollama, vLLM, llama.cpp) or a gateway (OpenRouter, LiteLLM). This is the option to pick when the model should run on your own hardware.

> [!WARNING]
>
> Features that depend on structured output — automatic **lead capture**, **ending
> a resolved chat**, and **human handoff** — are most consistent on OpenAI and
> Anthropic models. Smaller open models (e.g. Groq's GPT-OSS, some Grok variants)
> handle these well most of the time but can occasionally miss a step. If you find
> a model isn't capturing leads or closing chats reliably, switch to a stronger
> model like GPT-4.1 or Claude.
>
> This applies with much more force to **OpenAI-compatible** endpoints, because the
> model behind them is whatever you chose to run. Many small local models have weak
> tool calling or none at all, and a server that doesn't implement `tools` or
> `response_format` will make knowledge search, lead capture, chat-ending, and
> handoff fail rather than degrade quietly. Pick a model whose card explicitly
> claims tool-calling support, and test those flows before you go live.

### Base URL

**Only shown for the OpenAI-compatible provider** — the other seven have no base URL field, because ChatterMate already knows where to reach them.

Enter the root of your endpoint's OpenAI-compatible API, including the version segment. ChatterMate appends the rest of the path itself:

```bash theme={null}
http://host.docker.internal:11434/v1   # Ollama on the Docker host
http://vllm:8000/v1                    # vLLM on the same Docker network
https://openrouter.ai/api/v1           # OpenRouter
https://litellm.internal.example.com/v1  # LiteLLM proxy
```

> [!NOTE]
>
> Trailing slashes and a trailing `/chat/completions` are trimmed for you, so pasting
> the full completions URL works too. The URL must be reachable **from the ChatterMate
> backend**, not from your browser — see
> [Self-hosted and gateway models](https://docs.chattermate.chat/deployment/self-hosted-models.md) for the Docker
> networking details.

### Model Name

Pick a suggested model from the dropdown, or choose **"Custom model ID"** to type any model your provider supports (handy when a provider ships a new model before this list updates).

> [!NOTE]
>
> **OpenAI-compatible has no suggested models.** The model list belongs to your
> endpoint, not to ChatterMate, so the dropdown offers only **"Custom model ID…"** —
> select it and type the exact model ID your server reports. `ollama list`, or
> `curl <base-url>/models -H "Authorization: Bearer <key>"`, tells you what to enter.

Suggested models for the hosted providers:

```bash OpenAI (Recommended) theme={null}
gpt-4.1        # Strong general default
gpt-4o         # Fast, capable
gpt-4o-mini    # Cost-effective
o4-mini        # Reasoning model
```

```bash Anthropic (Claude) theme={null}
claude-opus-4-8    # Most capable
claude-sonnet-5    # Balanced performance
claude-haiku-4-5   # Fast and efficient
```

```bash Google Gemini theme={null}
gemini-2.5-pro     # Highest quality
gemini-2.5-flash   # Best price/performance
```

```bash Mistral theme={null}
mistral-large-latest    # Flagship
mistral-small-latest    # Cost-effective
```

```bash xAI (Grok) theme={null}
grok-4    # Flagship reasoning model
grok-3    # Previous generation
```

```bash DeepSeek theme={null}
deepseek-chat       # General model
deepseek-reasoner   # Reasoning model
```

```bash Groq theme={null}
openai/gpt-oss-120b        # Top quality on Groq
llama-3.3-70b-versatile    # Fast, reliable
```

> [!NOTE]
>
> Model IDs change over time as providers release and retire models. If a suggested ID stops working, use **Custom model ID** and paste the current identifier from your provider's docs.

### API Key

Your provider's API key for authentication. Security measures:

* Keys are encrypted before storage
* Keys are never logged or exposed in plaintext
* Access is restricted to authorized systems only
* Regular key rotation is supported
* Compliance with SOC 2 standards

> [!NOTE]
>
> Never share your API keys or commit them to version control. ChatterMate encrypts and stores them securely.

An API key is **always required**, including for OpenAI-compatible endpoints. If your
server doesn't check authentication — the default for Ollama and `llama-server` — enter
any non-empty placeholder (`ollama` is the conventional one). The value is sent as a
bearer token and ignored by a server that isn't looking at it.

> [!NOTE]
>
> Saving the form runs a **live test message** against the provider with the key, model
> ID, and base URL you entered. A save that fails with "Invalid API key" on an
> OpenAI-compatible endpoint usually means the backend couldn't reach the URL, or the
> model ID doesn't exist on that server — not that the key itself is wrong.

## Best Practices

1. **Provider Selection**
   * Start with OpenAI's GPT-4.1 / GPT-4o for best overall performance
   * Consider Anthropic's Claude for complex reasoning tasks
   * Use Groq (GPT-OSS / Llama) when you want the fastest, lowest-cost inference
   * Use **OpenAI-compatible** when prompts and customer messages must not leave your infrastructure

2. **Model Choice**
   * Balance between capability and cost
   * Test different models before production
   * Monitor usage and adjust as needed
   * On a self-hosted model, verify tool calling works before going live — see [Self-hosted and gateway models](https://docs.chattermate.chat/deployment/self-hosted-models.md)

3. **Security**
   * Use environment-specific API keys
   * Rotate keys periodically
   * Monitor usage for anomalies

## What's Next?

After configuring your AI provider:

1. Test the configuration with sample queries
2. Customize the AI agent's behavior
3. Add domain knowledge to improve responses
4. Set up human handoff rules

> [card] [Customize AI Agent](https://docs.chattermate.chat/features/ai-customization.md)
>
> Next: Learn how to customize your AI agent's behavior

> [card] [Self-hosted and gateway models](https://docs.chattermate.chat/deployment/self-hosted-models.md)
>
> Run the model on your own hardware with an OpenAI-compatible endpoint


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.