Production-ready Next.js boilerplate with: - Runtime env validation (fail-fast on missing vars) - Feature-gated config (S3, Stripe, email, OAuth) - Docker + Coolify deployment pipeline - PostgreSQL + pgvector, MinIO S3, Better Auth - TypeScript strict mode (no ignoreBuildErrors) - i18n (en/es), AI modules, billing, monitoring Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4.9 KiB
4.9 KiB
title, description, url
| title | description | url |
|---|---|---|
| Google AI | Setup Google Generative AI provider and learn how to use its models like Gemini in the starter kit. | /ai/docs/google |
Google AI
The Google Generative AI provider integrates Google's state-of-the-art models, including the versatile Gemini family, into your applications through the AI SDK.
Setup
### Generate API KeyVisit the [Google AI Studio](https://aistudio.google.com/app/apikey) to create your API key. For enterprise applications using Google Cloud, you can alternatively configure authentication via Application Default Credentials or service accounts.
### Add API Key to Environment
Add your API key to your project's `.env` file (e.g., in `apps/web`):
```bash title=".env"
GOOGLE_GENERATIVE_AI_API_KEY=your-api-key
```
If using Google Cloud credentials instead, ensure they're properly configured in your environment.
### Configure Provider (Optional)
The starter kit automatically uses the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable. For advanced configurations (such as proxies, custom API versions, or specific headers), you can create a tailored provider instance using `createGoogleGenerativeAI`. See the [AI SDK Google documentation](https://sdk.vercel.ai/providers/ai-sdk-providers/google-generative-ai#provider-instance) for comprehensive details.
