# AI provider keys

FeatWire calls the AI model with **your project's own key** at the AI provider (Google for Gemini, OpenAI for OpenAI). The provider bills you directly for the tokens; FeatWire does not resell them. Without a key, no call reaches the model: your app gets the `provider_key_missing` error.

You need the key of each provider whose models your Features use. One provider is enough to start.

## Add, replace or delete a key

1. Open **Settings**, card **AI provider keys**. There is one row per provider.
2. Paste the key and click **Add key** (or **Replace key**).
3. FeatWire checks the key with the provider before saving it. A key the provider refuses is not saved.

After that, the dashboard only shows the key's last 4 characters, the date it was added and who added it. **Delete** removes it: calls to that provider's models are refused until you add a new one.

The key is encrypted before it is stored, and it never leaves FeatWire's servers: your app holds only its FeatWire API key, never your AI provider key.

## Gemini

Models: Gemini 3.5 Flash-Lite (`gemini-3.5-flash-lite`), Gemini 3.1 Flash-Lite (`gemini-3.1-flash-lite`).

**Where to create the key:** [Get a key in Google AI Studio](https://aistudio.google.com/apikey).

1. Open [Google AI Studio](https://aistudio.google.com/apikey) and sign in with a Google account.
2. Click **Create API key** and pick (or create) a Google Cloud project for it.
3. For real users, turn on billing for that project: the free tier has low limits, and Google may use its data (see below).

**What Google does with the data of your calls:** On Gemini's free tier, Google may use the data of your calls. For real users' data, use a key from a Google project with billing enabled.

**Why a key gets refused:** the key was revoked, or its Google project disabled. Your app then gets the `provider_key_invalid` error, and the dashboard shows a banner.

**When the account cannot pay:** the key reached its daily quota or its billing limit. Retrying does not help until its plan allows more. Your app then gets the `provider_quota_exhausted` error.

## OpenAI

Models: GPT-6 Luna (`gpt-6-luna`), GPT-6.1 Terra (`gpt-6.1-terra`).

**Where to create the key:** [Get a key on the OpenAI platform](https://platform.openai.com/api-keys).

1. Open [the OpenAI platform](https://platform.openai.com/api-keys) and sign in.
2. Create a project for your app, then a secret key in it.
3. If you restrict the key's permissions, give it **Responses: Write**: FeatWire calls the Responses API.
4. Add credit to the account: OpenAI's API is prepaid.

**What OpenAI does with the data of your calls:** OpenAI does not train its models on API calls and keeps abuse-monitoring logs for 30 days. Use a key from an OpenAI project of its own, with a spending limit set at OpenAI.

**Why a key gets refused:** the key was revoked, or it lacks the Responses: Write permission. Your app then gets the `provider_key_invalid` error, and the dashboard shows a banner.

**When the account cannot pay:** the account has no credit left or reached its spending limit. Retrying does not help until you add credit or raise the limit. Your app then gets the `provider_quota_exhausted` error.

## Set a spending limit at the provider

FeatWire has its own [monthly spending limit](/docs/limits), but it works on **estimated** costs, and it only sees the calls that go through FeatWire. The real bill is your provider's. Set a limit there too, as a second safety net:

- **OpenAI**: in the billing settings of your organization ([Open billing at OpenAI](https://platform.openai.com/settings/organization/billing/overview)), set a monthly budget, and keep only a small amount of prepaid credit to start.
- **Gemini**: in the Google Cloud project behind the key, set a budget with alerts.

Advice: start low, such as $10 a month, watch **Overview** for a few days, then raise it. Use a key made for this app only, so that a limit or a revoked key affects nothing else.

## Banners in the dashboard

**Overview** and each Feature's page warn you when:

- a live Feature uses a provider that has no key;
- the provider refused the key (with the number of refused calls in the last 24 hours);
- the provider's account has no credit left (`provider_quota_exhausted` in the last 24 hours).
