Gemini starter module
Setup
Maps API keys, approved models, media limits, spending caps, and app integration points.
- Files
- 16
- Lines
- 934
- Languages
- Config + Markdown + TypeScript + JSON
Included files
This page lists paths and purposes, not source contents.
.env.example
Configuration required by this starter pack.
Config
28 lines
ADAPT.md
Give these instructions to the coding agent working in the buyer's Next.js project.
Markdown
132 lines
app/api/gemini/ask/route.ts
POST /api/gemini/ask returns one guarded Gemini answer.
TypeScript
6 lines
app/api/gemini/stream/route.ts
Mounts the guarded Gemini stream handler in the Next.js App Router.
TypeScript
4 lines
app/api/gemini/structured/route.ts
Mounts the guarded Gemini structured-output handler in the Next.js App Router.
TypeScript
4 lines
app/api/gemini/tools/route.ts
Mounts the guarded Gemini function-loop handler in the Next.js App Router.
TypeScript
4 lines
app/api/gemini/verify/route.ts
GET /api/gemini/verify reports missing settings and validates local Gemini configuration.
TypeScript
5 lines
app/chat/page.tsx
Renders a dependency-free client page for trying the guarded Gemini ask route.
TypeScript
181 lines
app/usage/page.tsx
Renders a server-side usage summary for the current application account.
TypeScript
210 lines
OPERATIONS.md
The code handles the machines.
Markdown
42 lines
package.json
Configuration required by this starter pack.
JSON
17 lines
README.md
This starter gives a Next.js App Router application a guarded server-side Gemini integration: model requests with spending checks, streaming, function calling, structured outputs, multimodal input, a production-mined model and key fallback chain, honest usage metering, and a readable verification route.
Markdown
88 lines
src/setup/check-setup.ts
Checks Gemini environment settings and model fallback chains from the terminal.
TypeScript
111 lines
starter.json
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Find your symptom, apply the fix.
Markdown
81 lines
tsconfig.json
Configuration required by this starter pack.
JSON
15 lines
Questions about setup
Is this a Gemini Next.js starter?
Yes. The pack is built for Next.js apps that need trusted Gemini calls, streaming, approved functions, image, video, and audio inputs, usage records, and spending caps.