Bring Your Own Gemini Key (BYOK)¶
Use your organization's own Google Gemini API key instead of ConnectGain AI for any or all AI features.
Why BYOK?¶
- Zero ConnectGain AI cost — Google bills you directly.
- Data residency / compliance — calls go from ConnectGain's servers straight to Google.
- Higher quota if your Google account has a paid Gemini plan.
1. Get a key¶
- Go to Google AI Studio.
- Click Create API key and copy the value (it starts with
AIza…).
2. Paste it in ConnectGain¶
- Navigate to Settings → AI & Automation → AI Provider.
- Select My Google Gemini key (BYOK).
- Paste the key, choose a model (
gemini-2.5-flashrecommended). - Pick a scope:
- All AI features — chatbots, classification, internal assistant, web assistant, translations, auto-tag, call analysis, re-engagement.
- Re-engagement only — only the AI Re-Engagement add-on uses your key; everything else stays on ConnectGain AI.
- Click Test key. A green badge confirms it works.
There is no ConnectGain-funded fallback. Your key is the only thing behind every AI feature, so if Google stops accepting it, those features stop until you fix the key. See If your AI stops working below — we tell you the moment it happens rather than leaving you to notice.
3. Supported models¶
gemini-2.5-flash(default — best price/perf, recommended)gemini-2.5-pro(heavier reasoning)gemini-2.5-flash-lite(cheapest, simple classification)
Gemini 3.x models (3.5-flash, 3.5-pro, 3.1-flash-lite) are intentionally not supported. They are agentic/thinking models that don't reliably follow the JSON-output prompts our AI features (re-engagement, classification, auto-tag, analyze-conversation, etc.) rely on.
Security model¶
- The key is encrypted at rest using AES-GCM with a key that never leaves ConnectGain's servers.
- It is never returned to the browser. The UI only shows a masked preview (
AIza••••1234). - Only OWNER / ADMIN can set, change, or clear the key.
- Every set / clear / scope-change / validation is audited.
- Error reports never include the key or message bodies.
Billing¶
- Google bills the account that owns the key.
- The ConnectGain AI Re-Engagement add-on is unaffected — it's an orchestration fee, not an AI fee.
- Cancelling the add-on stops the scanner; your key remains configured for other AI features.
- Bot-flow Gemini usage still appears on Bot Flows → AI Usage as an estimated cost for visibility. Google’s invoice remains the source of truth for BYOK spend.
If your AI stops working¶
Google can stop accepting your key without warning — a key gets regenerated, a quota runs out, or Google restricts the Cloud project the key belongs to. When that happens every AI feature fails, so you are told straight away on three channels rather than finding out from a customer who never got an answer:
- A red banner at the top of the dashboard, on every page, for everyone on the team, for as long as the problem lasts. It clears itself once the key works again — immediately if you press Test key or save a new one, and otherwise within the hour, when the next automatic check confirms the recovery.
- An email to every owner and admin, saying what Google is refusing, how to fix that particular problem, and exactly which features have stopped.
- A push notification to the browser and the mobile app.
You get one round of these per problem per day, not one per failed request. The only thing that brings an early one is the reason changing — a quota problem that turns into a blocked project needs different advice — and even that is limited to one extra in six hours. A key that flaps between working and failing shows up in the banner in real time without mailing anyone again.
AI features stop trying until the key is fixed¶
Once Google has refused your key for a reason that cannot fix itself — a
blocked project or an invalid key — ConnectGain stops sending it work
instead of retrying every AI call and failing each one. There is no point: a
banned project answers the ten-thousandth request exactly as it answered the
first.
That means the features below fail immediately rather than after a round trip to Google, and your Gemini project stops accumulating refused requests.
It resumes when the key works again:
- Press Test key, or save a new key — within about a minute.
- Do nothing — it re-checks by itself about every 25 minutes, and the automatic hourly health check probes in the background too, so everything turns back on on its own once Google accepts the key again.
A quota problem is treated more lightly, because it heals on its own sooner:
it pauses for about a minute and a half at a time, then lets a call through to
see whether your credits or daily allowance have come back.
Pausing is never permanent. Even a blocked project is retried roughly every 25 minutes, so nothing depends on anybody noticing.
Embeddings are not affected by a problem with your chat model. Product search, document search and memory indexing use a separate Gemini endpoint, so they keep working even while generative features are paused.
Nothing your customers send is ever lost while this is happening. Messages on every channel still arrive, your team can still reply, and automations, routing, contacts, deals, tasks and reporting are untouched. Only the AI features below stop: AI auto-replies and AI agent bot flows, conversation summaries and analysis, AI re-engagement nudges, reply suggestions, the internal AI assistant, automatic tagging, the voice agent, and call and meeting transcription with everything built on it. Message translation keeps working — it does not use Gemini.
Troubleshooting¶
| Badge | What it means | Fix |
|---|---|---|
blocked |
Google has restricted the Google Cloud project your key belongs to — often with "your project has been denied access". The key itself is fine. | A new key from the same project will not help. Take it up with Google Cloud support for that project, or paste a key from a different project that has the Generative Language API enabled. |
invalid |
The key was revoked, deleted, regenerated, or the Generative Language API was switched off for its project. | Generate a new key in Google AI Studio and paste it again. |
quota |
The key has run past its Gemini request or billing quota. | Raise the quota or enable billing in Google Cloud, or use a key from a project with headroom. Free-tier quotas reset on Google's own schedule. |
billing |
Google refused the key with “your prepayment credits are depleted” — the prepaid balance on the Google AI Studio account that owns the key is used up. The key itself is fine. | Add credits in Google AI Studio (ai.studio/projects → Billing). AI features resume by themselves within a few minutes; you do not need to change the key. |
network |
Google could not be reached on the last attempt. Usually temporary and not an outage on your side. | Press Test key again. |
How to switch back¶
Settings → AI & Automation → AI Provider → ConnectGain AI (default) → Save. Your key is cleared from the encrypted store.
See also¶
- AI Re-Engagement guide
- Call Intelligence
- Bot flows
- Integrations overview
- AI Intelligence on connectgain.cloud — feature overview on the ConnectGain website
ConnectGain — omnichannel inbox, CRM & automation for WhatsApp, Messenger, Instagram, Telegram and more. Open the app · Docs home