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

# Use your own Google AI key

> Run Raily's model calls on your Google AI (Gemini) API key, so usage is billed to your Google account and counts against your quota.

Raily runs its model calls on Raily's own models by default, and you don't need to change that. Add your own Google AI key when you want model usage billed to your Google account, under your own quota and data-processing terms. You then choose which tasks run on your key and which stay on Raily.

> [!NOTE]
>
> This page is turned on per Account. If you don't see **AI models provider** in Settings, ask your Raily contact to turn it on. Adding and using a key is part of paid plans. On a trial, the page shows your tasks but you can't add a key, and everything keeps running on Raily.

## Before you start

* A Google AI Studio API key. Create one in Google AI Studio under **API keys**, in a Google Cloud project with billing turned on. On keys without billing, Google may use the content you send to improve its products.
* You must be an owner or admin of the Account.

The settings apply to the whole Account. If you have an Organization other than the top-level one selected, the page still shows and edits the Account's settings, and says so.

## Add your key

**1. Open the page**

Go to **Settings** > **AI models provider**. Stay on the **Tasks** tab.

**2. Add the provider**

Under **Providers**, click **Add provider** and choose **Google AI**. The other providers listed are not available yet.

**3. Name the key and paste it**

Enter a **Name** that tells your keys apart (for example, "Google AI · production"). Only your team sees it. Paste your key into **API key**.

**4. Check and save**

Click **Check and save**. Raily checks the key with Google before storing anything. If the check fails, nothing is saved and the dialog shows which step failed.

**5. Choose where to use it**

Raily asks **Where should Raily use it?**

* **Make it the default** runs every task that can use your key on it, including tasks you start using later.
* **Not now** keeps everything on Raily, so you can pick tasks one by one.

**6. Adjust tasks and save**

In the **Tasks** table, use the **Runs on** menu for each task: **Follows default**, **Raily**, or your key by name. Under **If your key fails**, choose what happens when Google rejects your key: **Stop the task**, or **Use Raily until it's fixed**. Click **Save changes**.

Your key now shows under **Providers** with a **Healthy** badge. After saving, Raily shows only a short hint of the key, never the full value. The key is stored encrypted.

Raily picks the model for each task on your key, the same one it would use on its own account. You don't choose a model per task.

## What runs on your key

These tasks can run on your Google AI key. The **Exposure** column on the page lists what each one sends to the model.

* **Query understanding**: analyzes and rewrites every query before retrieval, including queries on API Sources and data tables.
* **Chat answers**: writes the answer in chat and in deep research.
* **Source setup**: setting up and regenerating a Source's search config, Knowledge Base builds, search rules, and tool descriptions.
* **Quality evaluators**: grades search results, on every query when evaluations are on.
* **Reranking**: only when a search config uses an LLM reranker with a Gemini model. That reranker keeps the model set in its search config.

These always run on Raily, and their row shows **Raily** without a menu:

* **Content processing**: reading your documents and videos when Raily indexes a Source.
* **Agent discoverability** and **Image generation**, where your Account has them.
* Cross-encoder reranking.
* Embeddings. The **Embedding models** tab shows the models that turn your content and searches into vectors. Raily's embedding model needs no key.

> [!NOTE]
>
> Quality evaluators on your key can run through Google's Batch Mode, which Google bills at half the price. Evaluation scores then arrive a few minutes after the search instead of right away. Ask your Raily contact to turn it on for your Account.

## Track usage

Once you have a key, the page shows usage for the last 7 days per task: **Calls on your keys**, **Tokens on your keys**, **Calls on Raily**, and **Failed calls**. A key you removed keeps its name in this table.

## Replace or remove a key

* **Check** re-runs the check against Google and updates the badge.
* **Replace key** swaps in a new key. Tasks keep their settings. Raily checks the new key before it replaces the old one.
* **Remove** deletes the stored key. Tasks set to that key move to Raily and count toward your plan. You can remove a key even if your plan changes or the page is turned off.

## Next steps

> [card] [LLM Providers](https://docs.raily.ai/integrations/llm-providers.md)
>
> See which models Raily uses

> [card] [Evaluations](https://docs.raily.ai/features/evals.md)
>
> Check how well searches find the right content


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