# Connect your agency's AI provider keys in AI Gateway

How to add, check, replace and remove your agency's own AI provider keys in AI Gateway, and what they are used for.

URL: https://help.substy.ai/en/articles/connect-ai-gateway-keys
Language: en

**AI Gateway** is where your agency keeps its own API keys for AI providers. A key is connected once for the whole agency and is used for every creator.

## What a connected key changes

- **Custom chat translators** run on your agency's key. You can only create or pick a custom translator on the **Translation** page while the key is connected.
- Whatever runs on your key is billed by the provider to your own account with them, not by Substy.
- Nothing else changes. The AI Chatter and Substy's own translators keep working as before, with or without a key.

## Before you start

| You need | Why |
| --- | --- |
| The **View AI Gateway** permission | To open the page and see the keys and their status. |
| The **Manage AI Gateway** permission | To connect, check, replace or remove a key. |
| Access to every creator of the agency | A key serves all creators, so changing one needs access to all of them. Otherwise you see "Changing the agency's AI keys needs access to every creator". |
| An account with the AI provider | You create the key there. |

If your role can only view, the page says "Your role can see the keys but not change them". If your role has no access, it says "Your role does not include the AI Gateway. Ask your agency owner for access". Roles are set up in [Create and assign custom roles](https://help.substy.ai/en/articles/create-and-assign-custom-roles).

## Open AI Gateway

In the sidebar, open **AI** and select **AI Gateway** (or go to app.substy.ai/ai-gateway).

The table lists the AI providers available to your agency, one per row:

| Column | Shows |
| --- | --- |
| **Provider** | The provider's name and what it is used for. |
| **Status** | The result of the latest check (see below). |
| **Key** | The last four characters of the key. The full key is never shown again. |
| **Checked** | When the key was last checked. |

## Connect a key

1. On the provider's row, select **Connect**.
2. In the dialog, select **Open** followed by the provider's name. The provider's key page opens in a new tab.
3. Create a key there and copy it.
4. Back in Substy, paste it under **Paste it here**.
5. Select **Connect**.

The provider checks the key before Substy keeps it. When it is accepted, you see a confirmation ending in "connected". If the provider refuses the key, nothing is saved and the dialog shows the reason, for example "rejected this key. Check it and try again."

You can also connect the key from the **Translation** page when you create a custom translator: the same dialog opens there.

## Key status

| Status | Meaning | What to do |
| --- | --- | --- |
| **Connected** | The provider accepted the key at its last check. | Nothing. |
| **Key refused** | The provider refused the key at its last check. | Create a new key with the provider and use **Replace key**. |
| **Not checked** | The provider could not be reached or gave no clear answer. The key is kept. | Try **Check again** later. |
| **Not connected** | No key yet. | Select **Connect**. |

When the status is not **Connected**, the provider's message appears under it.

## Check, replace or remove a key

Open the row's actions menu:

| Action | What it does |
| --- | --- |
| **Check again** | Asks the provider to check the saved key now and updates **Status** and **Checked**. |
| **Replace key** | Opens **Replace the … key**. Paste the new key and select **Replace key**. The new key replaces the old one. |
| **Remove key** | Asks you to confirm. What runs on the key stops until a new key is connected, custom chat translators included. |

## Troubleshooting

| Message | Fix |
| --- | --- |
| "A key is at least 8 characters" | The pasted text is too short. Copy the whole key again. |
| "… rejected this key. Check it and try again." | The key is wrong, revoked or expired. Create a new one with the provider. |
| "Changing the agency's AI keys needs access to every creator" | Ask your agency owner to give your role access to every creator. |
| No **Connect** button | Your role can only view the AI Gateway. |
