---
url: /relyai-acellemail/guides/connect-an-engine.md
description: >-
  Add an OpenAI, Anthropic or Ollama engine to RelyAI — create it, test the
  connection, set a default, and decide between a system key and letting
  customers bring their own.
---

# Connect an engine

Before any AI feature runs, RelyAI needs an **engine** — an AI provider plus a model, with a key to
reach it. This guide walks you through adding one, testing it, and choosing a default. You can add
several engines and switch the default whenever you like.

::: info What an engine is
An engine is one AI provider + model combination (for example OpenAI GPT-4o mini). RelyAI sends every
AI request to whichever engine you mark **Default**. Extra engines can sit enabled but idle until you
promote one.
:::

Open **RelyAI → Settings → Engines & Keys**. This is where providers, models and API keys live.

![The Engines & Keys settings tab](/relyai-acellemail/img/relyai-connect-an-engine-list.png)
*RelyAI → Settings → Engines & Keys*

## Step 1 — Add an engine

Click **Add Engine**. You will see these fields:

* **Name** — a label you'll recognise, e.g. "OpenAI GPT-4o".
* **Provider** — OpenAI, Anthropic or Ollama.
* **Model** — the model ID for that provider (see below).
* **Max Tokens** — the response length ceiling.
* **API key** — the secret for the provider. The placeholder shows the expected shape
  (`sk-…` / `sk-ant-…` / *(leave blank for Ollama)*). When you edit an engine later, leaving this
  blank keeps the existing key.

Fill these in for your provider, then move to testing.

## Step 2 — Get a key for your provider

### OpenAI

Sign in at **platform.openai.com → API keys → Create new secret key** and copy the `sk-…` value into
the API key field. For **Model**, `gpt-4o-mini` is the fast, low-cost default; `gpt-4o`, `gpt-5`,
`gpt-5-mini` and `gpt-3.5-turbo` are also available.

### Anthropic

Sign in at **console.anthropic.com → Settings → API keys** and copy the `sk-ant-…` value. For
**Model**, the Claude Opus, Sonnet and Haiku families are available; `claude-haiku-4-5` is a good
low-cost default.

### Ollama

Ollama runs open-weight models with **zero per-token cost when self-hosted**. Start it locally with
`ollama serve`, set the **Base URL** to your endpoint (for example `http://127.0.0.1:11434`), and
**leave the API key blank**. To use Ollama Cloud instead, paste the key from your Ollama dashboard.
Models include `llama3.1:8b` (a good default), `llama3.1:70b`, `mistral:7b`, `qwen2.5:7b` and
`qwen3:8b`.

## Step 3 — Test the connection

Click **Test Connection**. The button shows **Testing…** and then **Connection successful** when the
key and model check out. If it doesn't, re-check the key, the model ID and — for Ollama — that the
Base URL is reachable.

## Step 4 — Set a default and manage the rest

Click **Set as Default** on the engine you want RelyAI to use for every AI call. Other engines can
stay **Enabled** as alternatives or be disabled. Only one engine is the default at a time; promoting
another switches all AI traffic to it instantly.

## System key vs customer keys

The key on an engine here is your **system key** — used whenever a customer hasn't supplied their own.
If you turn on **Allow customers to use their own API key**, customers can enter a key under
**Account → AI**, and their AI usage then runs on *their* provider quota instead of yours. This is a
handy way to shift cost — see [Quotas, limits and credits](/relyai-acellemail/guides/quotas-limits-and-credits).

## Related pages

* [Configuration](/relyai-acellemail/configuration)
* [Settings reference](/relyai-acellemail/settings)
* [Quotas, limits and credits](/relyai-acellemail/guides/quotas-limits-and-credits)
