# Create an AI key

> Create an OpenAI or Google Gemini API key and add it to the Signal Parser tab so the app can read Discord and Telegram trade calls.

*Source: https://tradelabs.org/docs/reference/how-to/creating-an-ai-key*

An AI key lets the app read plain-English trade calls from Discord and Telegram and turn them into orders. You add the key in the **Signal Parser** tab of Settings. The app works with either **OpenAI** or **Google Gemini**, and you only need one.

> **Note**
>
> You only need an AI key for **Discord** and **Telegram** strategies. TradingView and serverside strategies send structured data, so they parse without a key.

## Create an OpenAI key

1. Go to [platform.openai.com](https://platform.openai.com/) and sign in, or create an account and verify your email.

2. Open the [API keys](https://platform.openai.com/api-keys) page and click **Create new secret key**. Set permissions to **All**.

3. Copy the key the moment it appears. It starts with `sk-` and is shown only once, so store it somewhere safe.

*The whole flow: sign in, open API keys, create a secret key, and copy it once.*

> **Note**
>
> An OpenAI key needs at least a small balance on your OpenAI account before it will work. Add credit in the billing section if the test call fails with a quota error.

## Add the key in the app

1. Open **Settings** from the sidebar, then select the **Signal Parser** tab.

2. Leave **Provider** set to **OpenAI**. Paste your key into the **OpenAI API key** field (it starts with `sk-`).

3. Click **Save**. You see an **OpenAI key saved** confirmation, and the key is stored securely on your device.

4. Click **Test**. A **Test result** row pings the provider and, on success, shows Connected with the model it reached, the tokens used, and the tiny cost of the test call.

5. In the **Model** row, pick a model. **gpt-4o-mini** is marked Recommended: it is the cheapest option that handles signal parsing well.

![The Signal Parser tab in Settings, with the provider, API key and model controls marked](/docs-assets/app-settings-parser-key.png)

1. **Provider** — **OpenAI** or **Google Gemini**.
2. **API key** — paste it here, then **Save**. **Test** confirms it works before you rely on it.
3. **Model** — **gpt-4o-mini** is the recommended default.

## Use Google Gemini instead

The app also parses with Google Gemini. To use it, get a key at [aistudio.google.com](https://aistudio.google.com/), then in the same **Signal Parser** tab:

1. Change **Provider** to **Google Gemini**.

2. Paste your Gemini key into the **Gemini API key** field. It starts with `AIza`.

3. Click **Save**, then **Test**.

4. In the **Model** row, pick a model. **gemini-2.5-flash-lite** is marked Recommended.

> **Tip**
>
> The provider and key are per provider. If you save an OpenAI key and a Gemini key, switching **Provider** brings back whichever key you saved for that provider. The parser uses the provider currently selected.

## Fixing common problems

- **Test shows an error:** re-check that you pasted the full key with no extra spaces, and that it matches the selected provider (`sk-` for OpenAI, `AIza` for Gemini).
- **Quota or billing error:** add credit to your OpenAI or Google account, then click **Test** again.
- **Discord or Telegram calls are not turning into trades:** confirm a key is saved for the selected provider. Without a key here, those messages are not parsed at all.
