-
Notifications
You must be signed in to change notification settings - Fork 1
Getting a Gemini API Key
dudarenok-maker edited this page Jul 14, 2026
·
2 revisions
Castwright can use Google's Gemini models to analyse your book — finding who speaks and tagging each line — and, optionally, to voice it. Google gives every account a free tier that's more than enough to get started; you just need an API key. It takes about a minute.
In a hurry? Go straight to https://aistudio.google.com/apikey, sign in, create a key, copy it, and paste it into Castwright. The steps below walk through exactly that.
- Open the Google AI Studio → API keys page linked above and sign in with any Google account. (First visit? Accept the terms when prompted.)
- Click Create API key. If you're asked to pick a Google Cloud project, the default one it offers is fine.
- Your key appears — a long string starting with
AIza…. Click Copy. - Back in Castwright, go to Account → Server configuration → Gemini API key, paste the key into the field, and click Save key. (The same field appears in the setup wizard's Analyzer step.)
That's it — pick any Gemini model under Defaults for new books → Analysis model and Castwright will use your key.
- The free tier is fine for analysis. You don't need billing enabled to start. Google publishes the current free-tier limits on the same site.
-
Your key stays on your machine. Castwright stores it in your per-user settings file (
~/.castwright/user-settings.json, plaintext, gitignored) — the same trust model asserver/.env. It's never sent anywhere but Google. -
Analysis fails immediately with "Gemini … returned an empty response"? That's Google's recitation filter blocking a copyrighted-book chapter, not a bad key. Switch the analysis model to
gemma-4-31b-it, or go fully local with Ollama. See Installing Castwright and Analysis & the Analyzer for the details. - Prefer not to use the cloud at all? A local Ollama model is the free, private alternative — no key required. See Analysis & the Analyzer.
- Home
- Getting Started
- Installing Castwright
- Uploading a Book
- Manuscript Management
- Analysis & the Analyzer
- Getting a Gemini API Key
- Reviewing Low-Confidence Speaker Tags
- Generating Audio
- The Quality Gate
- Listening & Revising
- Exporting